5
$\begingroup$

Hi I am learning about geometry nodes and they are very powerful and interesting, but I don't understand if it is possible to build meshes starting from primitives.

For example, I have two line meshes with the same number of vertices and I would like to create a strip of triangles or quads by mapping their vertices by index. How can I achieve that?

Clarification screenshot following: I would like to procedurally build the faces by joining pairwise vertices belonging to each of the two curves, e.g. creating a face from the green-cyan vertices, then a face from the cyan-yellow vertices, and so on. This is a quad strip pattern, but a triangle strip would be fine as well, for the sake of learning.

screenshot of two curves that I want to connect vertex-by-vertex

$\endgroup$

3 Answers 3

4
$\begingroup$

It so happens that the order of indices in a GN-generated Mesh Primitive > Grid is quite convenient. So, being a bit naughty, and depending on that Blender implementation detail, we can make a mesh loft between any 2 splines, presented as 1 curve:

enter image description here

... just by transferring Position, by index, from the curve to a 2 x Resolution grid. Resampling means we don't have to care about the number of control-points or resolution of the splines, the point-counts will always match.

The curve could just as well be the 2 arcs you've generated within a GN Tree:

enter image description here

$\endgroup$
3
  • $\begingroup$ This was exactly I was hoping for, thank you very much! $\endgroup$
    – ARDVL
    Jun 1, 2022 at 7:29
  • 1
    $\begingroup$ Out of curiosity, I wonder if index can be considered stable and safe (i.e. it's really being naughty here?) or if can change and it's possible to re-index vertices. $\endgroup$
    – ARDVL
    Jun 1, 2022 at 7:32
  • 1
    $\begingroup$ Hi @ARDVL! I can't realistically imagine any reason the devs would suddenly change the index-order on either a Mesh>Grid or a multi-spline curve, so I'm being super-strict, with that remark. I would personally be happy to rely on the order. But it is under someone else's control, and there's no published guarantee. So if I was doing this for intended re-use at some unknown future time in a commercial studio, possibly incurring costs / other people's time chasing a mysterious bug, I would feel the need to give a more limited, but reliable solution, more like @quellenform's. $\endgroup$
    – Robin Betts
    Jun 1, 2022 at 8:21
4
$\begingroup$

I would construct it like this:

enter image description here

You obviously want to use a curve as a base and create a mesh.

The node Curve to Mesh does not really help you in this case.

But you can create a new line with the node Mesh Line, and adjust its positions to the curve by transferring them with the node Transfer Attributes and resetting them with Set Position.

After that you can extrude the mesh line with the node Extrude Mesh.

If you use the value $0$ as Offset Scale, you can scale the individual edges away from the center by any value with the node Scale Elements and get exactly the mesh you have sketched.

$\endgroup$
2
$\begingroup$

You can create a Mesh Grid with Vertices Y equal to 2 and Vertices X equal to the arcs resolution. That way even ad odd indexes are on opposite sides of the grid.

enter image description here

After that, you just need to transfer the position from the arcs to the vertices, even indexes are for the larger arc. The index for transferring needs to be the index of the vertex divided by 2, that way we get the same index for every two vertices in the grid.

enter image description here

Result:

enter image description here

$\endgroup$

You must log in to answer this question.

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