1

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 !

gordie
  • 2,510
  • 3
  • 25
  • 47
  • Maybe this trick will help you with the second step: https://i.stack.imgur.com/l6t4R.png (...this is taken from this answer here: https://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. – quellenform Sep 16 '22 at 19:05
  • 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 ! – gordie Sep 17 '22 at 09:00
  • 1
    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. – quellenform Sep 17 '22 at 09:11
  • What I would need would be to use the shortest edge trick on a per-point point cloud. right ? – gordie Sep 17 '22 at 09:12
  • 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. – Markus von Broady Sep 17 '22 at 13:23
  • I misread the problem, if all possible edges aren't there to begin with (and the shortest edge trick, if I remember correctly, relies on convex hull and will not work for concavities...) Then you need to create edges between all pairs of vertices, maybe with some length limit, but you will get "overlapping" (in a 2D projection) of a lot of edges probably. – Markus von Broady Sep 17 '22 at 13:25
  • No, "The shortest edge trick" has nothing to do with a convex hull (that was only relevant in the other question). And I repeat the comment from before: this is about creating a triangulated mesh from a point cloud (see first and second comment!). – quellenform Sep 17 '22 at 13:42
  • @quellenform whoops! My bad. – Markus von Broady Sep 17 '22 at 15:32
  • this might perhaps be a way to do it: https://twitter.com/5agado/status/1505591794746241039 - but I don’t know how he achieves this.. – gordie Sep 18 '22 at 09:40
  • @gordie To me it looks like he is moving two spheres here, and moving their points with transfer attribute to the nearest point of the other mesh. After that, he just randomly distributes points on the resulting surface. Just a guess. Try it. – quellenform Sep 18 '22 at 09:48

0 Answers0