2
$\begingroup$

I have a bunch of edges which are the result of spliting a curve into splines and getting those splines trimed and convert them to mesh. Now I need to create new edges in order to close those gaps, I've been trying multiple options such as merge by distance which wont work as I need to keep all my vertices and not create new ones, I've also tried to connect each vertex with its next one by index but this also wont work as indices are unsorted because of the spline split. My only hope is to be able to find the nearest vertex to each vertex and create new lines from there, but the sample nearest node or geometry proximity will always return the same vertex which is being sampled.

I would really like to avoid using any kind of booleans.

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ You can't go a step back and just not trim the splines so you don't have to fill the gaps that you create? 🤔 I think a new node to sample 2nd nearest is coming to Blender 3.6, other than that, you could take a look here: Selectively join points using geometry nodes - using my answer you could set the "Count" to $1$ and adjust min and max distance to ensure only the gaps are filled and no other edges are created. $\endgroup$ Commented May 31, 2023 at 12:32
  • $\begingroup$ YAY! the new node from 3.6 did the job thank you. With it I was able to create a vector from each vertex to it nearest, then I extruded each vertex using the previously created vector as the offset and its lenght as the offset scale. $\endgroup$ Commented May 31, 2023 at 13:40
  • $\begingroup$ Please add an answer answering your own question for future visitors 👍 $\endgroup$ Commented May 31, 2023 at 13:53

1 Answer 1

2
$\begingroup$

As @MarkusvonBroady commented there is a new node in blender 3.6 which returns the index of the nearest position (Index of Nearest), with it we can sample the position for each vertex and its nearest vertex, now just subtract both vectors to get a new vector which can be used with the extrusion node as its offset direction and for the offset scale we input the vector's length. Lastly its a matter or merging vertices by distance.

enter image description here Starting point with the mesh gaps

enter image description here Once we have the vector between the gaps we extrude each vertex using the vectors length as the offset scale

enter image description here Last plug the normalized vector into the offset to get the correct direction for the extrusion. The multiply by -1 is just to invert vectors direction.

$\endgroup$
2
  • $\begingroup$ What is inside the custom group? isn't it simply a single node "Vector Math: Subtract"? If so, instead of normalizing it and using length as offset scale, you could directly connect it to the offset, and use 1 or -1 as the offset scale $\endgroup$ Commented Jun 1, 2023 at 10:04
  • $\begingroup$ Yes, the nodegroup is just a substraction, so it makes perfect sense to do as you say $\endgroup$ Commented Jun 1, 2023 at 12:42

You must log in to answer this question.

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