Finding Adjacent Curves

Using Python script.

Is there a method out there that can easily find adjacent curves (curves that are connected to the start and end points of a given curve)? I know I can iterate through the document’s objects and compare start and end points of the given curve to other curves, but I wanted to know if there was a way to do this with one call rather than iterating through.

Do you need Python? Sandbox plugin has some nice features for typology analysis (VB code here: Sandbox_Topology/Sandbox_Topology at master · tobesch/Sandbox_Topology · GitHub)

Hi Mike

you could collect all start and endpoints from all curves and use a RTree methods to compare all points with distance 0.
That method return a list with lists that contains indices.
Iterate one time over this nested list and create a new one and put only lists that are len(list) > 1 and
not in the new created nested list.

Here is a test in grasshopper.

@flokart - Ok thanks. Great idea. I was hoping that there would be some method out there like FindAdjacentCurves that would return a list of adjacent curves, but your suggesting is the next best thing.

1 Like