How to group Breps by the intersecting curves or Breps?

I like to ask this question in two cases.
First is Breps scatter in space not touching each other, but some of them intersecting with same curves(or Brep, may pipe from the curves).
Second is Breps(surfaces) are sharing same edges.

In first scenario I like to group(tree structure) the Breps by the same intersecting curves in the space.
In second case I like to group the Breps by the sharing edges.

group Breps or surfaces by intersecting curves.gh (85.7 KB)

Have a look at the attachment.


group Breps or surfaces by intersecting curves_re.gh (95.4 KB)

5 Likes

Thank you for the help! This is exactly what I am trying to understand.