I would like to build a little experiment with Geometry Nodes.

I have a curve, with a Curve to Points node.

My goal is to connect some of those points, depending on some conditions, like

  • no connection from/to the first/last point (easy one)
  • a point cannot be connected to its previous/next point (it would just redraw the initial curve)
  • a connection angle should be within a certain angle range

enter image description here

Shortest edge trick

I had an attempt by implementing the the shortest edge trick, and it works, but not as expected : in my example, the shortest edges filtered are the ones that "belongs" to the original curve :

enter image description here

I'm not sure that this technique could be used here, or how could I filter only the "good" edges ?

Maybe that the way to achieve this would be that, for each point, I iterate the other points to eventually find a match.

But can Geometry Nodes do that ? Maybe with the shortest edge path node like in this video ?

Any tips ?

Thanks !

  • $\begingroup$ Maybe this trick will help you with the second step: i.sstatic.net/l6t4R.png (...this is taken from this answer here: blender.stackexchange.com/a/263987/145249) The third step could then be done using the node Shortest Edge Paths or via filtering the direction vector. $\endgroup$
    – quellenform
    Commented Sep 16, 2022 at 19:05
  • $\begingroup$ Thanks @quellenform, your shortest edge trick is badass !!! But I'm not sure it applies in my case, or at least I'm wrong filtering the edges. I've edited the question and added a blend file if you have some ideas ! Thank you ! $\endgroup$
    – gordie
    Commented Sep 17, 2022 at 9:00
  • 1
    $\begingroup$ You are right: "The shortest edge trick" doesn't help here, because you don't want to have the shortest edge. In your case it's more about the question how to create a triangulated mesh from the point cloud, hence the link from before. $\endgroup$
    – quellenform
    Commented Sep 17, 2022 at 9:11
  • $\begingroup$ What I would need would be to use the shortest edge trick on a per-point point cloud. right ? $\endgroup$
    – gordie
    Commented Sep 17, 2022 at 9:12
  • $\begingroup$ According to your specification there is no limit of edges, so not only "the shortest edge" is not the right approach, but "the 2nd shortest edge", or in fact any number of shortest edges wouldn't be correct either. You're looking for an angle, so you simply need to create a quadratic search (kind of like in the sorting algorithm, quellenform will know), where for each edge you search among all other edges, and then check if A. they share a vertex, and B, the angle between those edges is correct. $\endgroup$ Commented Sep 17, 2022 at 13:23


You must log in to answer this question.

Browse other questions tagged .