Simple Clash detection in Grasshopper/Rhino API

Hi all,
As shown in the screenshot I have a few curves that marginally intersects with each other. This is a major thing that gives us a lot of headache at work so I am wondering if I could make a highlight where these intersection events occur, hopefully with a Grasshopper Plugin. (which I am learning to write)


Because in each model we may have 1000 curves where these minute intersection occurs so normal grasshopper script that loops 1000^1000 times would be very slow.

Is there a way or plugin or somewhere in the RhinoCommon where I could find a solution?

I saw in RhinoCommon there is a Intersect CurveCurve method. Does it mean I have to let every Curve loop with all the other ones in C#? Or is there a better way?

In a first pass I would exclude any pair of curves whose bounding boxes don’t intersect. This can be speeded up with a spatial search structure like an R-tree.
Then indeed curve-curve intersection is the next step. That could take a long time still though depending on the amount of overlapping bounding boxes.

1 Like

Thanks Menno.
I would look into this!
Will post any result if any.