6
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ 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 $\endgroup$
    – John MC
    Sep 30, 2021 at 12:09
  • $\begingroup$ 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 $\endgroup$
    – jjcasmar
    Sep 30, 2021 at 12:49

1 Answer 1

12
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ "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? $\endgroup$
    – DarenW
    Aug 8 at 9:21
  • $\begingroup$ @DarenW: blender.stackexchange.com/questions/276087/… $\endgroup$
    – gordie
    Oct 28 at 23:06

You must log in to answer this question.

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