2
$\begingroup$

I'm trying to find the proper logic to access and move specific vertices/edges of a mesh generated with Geometry Nodes.

enter image description here

The basic setup is a curve which has been converted to a mesh with another simple curve to make a strip-like object. Each face of the resulting mesh should get inset, which is a simple extrusion followed by some scaling. This part works without a problem.

Now, one edge of each extrusion should get moved up to get a wedge-like shape as displayed in the screenshot.

The problem is, how to find the specific vertices/edges and how to use these for the translation.

Getting the vertices seems to work by processing each face index and getting the first and second corner index (of course this might need adjustment to get the correct corners).

Also, the Top output of the Extrude Mesh node seems to contain the faces/vertices which can be used to filter which faces to process.

The question is: How to put this all together? In theory this is clear: Use only the extruded face indices to get the corners, pick the two which are required and move them up.

I would really appreciate it, if someone could nudge me into the right direction. I have tested many different approaches, tried to find answers all across the web but unfortunately nothing seemed to contain the needed info.

Thanks in advance.

Edit: Blend File:

$\endgroup$

1 Answer 1

2
$\begingroup$

If, as you show in your example, you extrude a mesh and scale the extruded faces, the newly created points are always indexed according to a specific scheme:

enter image description here

Therefore, you would simply have to select the last two points of the new faces and combine them with the Top selection of the extrusion.

This looks something like this:

enter image description here

...which in turn produces the following result:

enter image description here


(Blender 4.0+)


For explanation:

  • Index returns the consecutive index
  • The Math node Truncated Modulo returns the remainder of a division by 4
  • The Math node Snap with the Clamp setting snaps these values to 2, but limits the result to 1
  • The Boolean Math node with the setting And combines the result with the Top selection

This then looks like this (using an example with two faces):

Index %4 Snap Top selection Result
0 0 0 0 0
1 1 0 0 0
2 2 1 0 0
3 3 1 0 0
4 0 0 0 0
5 1 0 0 0
6 2 1 0 0
7 3 1 0 0
8 0 0 1 0
9 1 0 1 0
10 2 1 1 1
11 3 1 1 1
12 0 0 1 0
13 1 0 1 0
14 2 1 1 1
15 3 1 1 1
$\endgroup$
1
  • $\begingroup$ Thank you very much for the fast response and elegant solution. It seems that I was close and yet far off. At one point I was thinking about using modulo but I failed to examine the indices close enough. I yet have to see and check what these new modulo functions are as well as what snap does. But this is all very helpful. $\endgroup$
    – iclemens
    Commented Nov 30, 2023 at 7:43

You must log in to answer this question.

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