For-each brep in my selection, intersect with all others


#1

I need to:

  1. Select, say, 100 solids in my Rhino3D model,

  2. Compare each of the selected solids to the other 99 to see if they intersect, and

  3. Show me all of the intersections.

In my drunken-walk-approach to learning GH, I managed to figure out how to select two Breps and check them for intersections, but I can’t figure out how to select a whole bunch and test each one against all of the others (BUT, not against itself).

Would anyone please give me a bit of guidance, here? Thanks, in advance.


(Michael Pryor) #2

Something like that is going to be very heavy and a bit excessive in the amount of data it will create with GH. The problem is more suited for a loop. If you cannot script, I suggest to use Anemone to make a loop and do it.


BrepIntersect.gh (140.8 KB)


#3

Michael -

Many thanks for your post. Anemone does the job just fine. I also learned a LOT by working through the GH file you provided!

I also learned that, if two of the solids have a single edge in common, it reports an “intersection” consisting of a single-segment curve. I suspect that true intersections will consist of a multi-segment curves, and I should be able to simply filter out those that have only a single section.

Thanks, again!
-Patrick


(David Rutten) #4

If you just need to figure whether there’s any intersection between objects, rather than finding all of them, then maybe the Collision Many|Many component can help you out.


#5

Excellent tip! Thanks.