7

I have a mesh in which I have two vertices in a vertex group. I would like to create a line between those two points. For that, I have tried to add a Line node which requires a start location and an end location. I have also added a Point Separate node to get the two mentioned vertices in my original mesh. However, I have no idea how to obtain the vertices position in order to feed the Line node.

What I want to achieve with this is to create a solid geometry between those two points by instancing a cube on the line points.

How can I position my line between the two points in the vertex group? enter image description here

jjcasmar
  • 359
  • 1
  • 4
  • 15
  • the point separate node separates between all points in a vertex group and all other points of that mesh. So this would "maybe" only work, if you mesh just has 2 vertices at all....it would be much if you hook two empties to your two vertices and then you can can the position of the empties and create a line between them – John MC Sep 30 '21 at 12:09
  • I have tried to add the empties with a copy location constraint, but that is not working correctly. The transform of the empty not yet updated apparently when computing the geometry nodes – jjcasmar Sep 30 '21 at 12:49

1 Answers1

13

As of 3.0 you can use Transfer Attribute + Set Position to remap a mesh or curve line to any series of points as long you place them in the correct index order.

How good are you at connect the dots games?

From

Scattered vertices

to

Geometry Nodes Transfer Attribute + Set Position

Use the Selection input to use the relevant vertices:

Isolate Vertices

The Mesh to Points node isn't necessary for this method work if you're using all vertices, it's only there to isolate vertices and make the vertices > (something) conversion explicit.

Right now you could replace that Mesh Line with a Curve Line node and plug the geometry Group Input directly in the Target and the vertices would be automatically converted to curve control points as required by the node tree. With a little creativity you can do a lot more with this, like welding procedurally generated lines, curves and faces into something new.

Rhaenys
  • 1,374
  • 11
  • 20
  • "Transfer Attribute" seems to no longer exist in summer of 2023. I have Blender 3.6.0. Is it merely renamed or must this be done some other way now? – DarenW Aug 08 '23 at 09:21
  • @DarenW: https://blender.stackexchange.com/questions/276087/where-is-transfer-attribute-in-3-4 – gordie Oct 28 '23 at 23:06