1
$\begingroup$

I'm pretty new to Geometry Nodes and don't quite know, how to solve my problems and I'm afraid it's a bit more complex.

I want to create some simple triangular roofs on rectangular baseshapes. The roofs shall work even if the baseshape is rotated a bit. All the Baseshapes are in one Object so I need only one Geo Node System.

enter image description here

So maybe I can shift the center of each individual Mesh Island to its longest side? I don't know much about adressing individual Edges to make them move. Nor do I know how to shift something in it's Local direction. Do individual Mesh Islands even have Local Direction? I don't know what to google anymore and maybe you can give me some hints?


Briefly summarized:

How am I able to select only the upper vertices and then push them to the side, so my roofs have this triangular shape?

enter image description here

I thought maybe it will work kinda like this:

  1. having a plane
  2. extruding the plane up
  3. merging the upper vertices in the middle
  4. shifting the upper edge to the side

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ Instead of extruding then shifting, why don't you extrude only the part you want to ? The offset Scale input from the Extrude Mesh node takes a field input $\endgroup$
    – Gorgious
    Commented May 16, 2023 at 16:35

1 Answer 1

1
$\begingroup$

You haven't said which long side you want extruded.. here's a clunky approach which might do

  1. A group which finds the longest edge of any polygonal face,stores the edge-index, and (anticlockwise to normal) ordered positions of the edge's end-points, capturing per-face:

enter image description here

  1. We're only in rectangles, so can get away with extruding the whole thing, and collapsing the side raised from the longest edge to 0 down the face normal, towards one of the edge's endpoints..

enter image description here

You might want to specify more tightly, but this might be a start.

enter image description here

$\endgroup$
7
  • $\begingroup$ ...interesting aproach! I had to think a little bit about how you nested it. $\endgroup$
    – quellenform
    Commented May 16, 2023 at 20:34
  • $\begingroup$ @quellenform I'm sure you can do it in 3 nodes :).. I feel a deletion coming on ... :) $\endgroup$
    – Robin Betts
    Commented May 16, 2023 at 20:35
  • $\begingroup$ @Robin Betts Awesome, that looks great and is very helpful, even if I don´t understand it completely by now^^ For me it´s not important which side, it´s okay when it is as random as now :) Sry, I could`ve added this beforehand but is it possible to detect the vertex count of each mesh island and then only spawn/extrude the roofs on quads? $\endgroup$
    – Tucker
    Commented May 17, 2023 at 8:29
  • $\begingroup$ Hi, @Tucker .. I thought you might want to tighten up the spec. :) Sure. Do you mean all quads, or only rectangles? $\endgroup$
    – Robin Betts
    Commented May 17, 2023 at 8:33
  • $\begingroup$ @Robin Betts If you ask me like this, I think only rectangles would be better, cause roofs on extreme trapeze-shaped houses for examples will look weird and they better have flat roofs then. Maybe it´s possible to define a corner degree to which it´s allowed to spawn roofs? $\endgroup$
    – Tucker
    Commented May 23, 2023 at 13:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .