Shortest path between two sets of points

shortest path.3dm (94.7 KB) shortest (9.6 KB)

I was able to create lines between these two sets of points. However, I need each point to connect to the closest point from the second set of points.

If a point already has a connection, the link is created at the next point it is closest to. So every point has a different connection from the first set of points to the second set of points.

How can i do this?

You can use looping by anemone for instance.

shortest (14.2 KB)


Thank you for your reply. This is exactly what i wanted to achieve. However, the loop only works with the same number of points in each set. How do I go about this when the number of points in the second set of points is more than the number in the first?



Thank you! It was a small error I had made sorry