Currently I am making a dynamo graph which generates beams with lines imported from CAD.
I have used the Group Curves node from the archi-lab package successfully to group curves by closed lines per beam to find the centre line for each rectangle, however when the rectangle endpoints overlap, multiple beams get grouped together (understandably).
I am trying to understand the logic to separate rectangles where some of the endpoints overlap, and rectangles where all endpoints overlap.
Please see the image below.
Case 1 is a list of 16 lines, where 3 points overlap. I would like to group the lines into 4 different groups, where the lines form a closed rectangle. The final list will contain sublists red, green, blue, black, each with their respective four lines.
Case 2 is where the all rectangles have overlapping points. I would like to group the curves in the same way as Case 1.
Ideally a routine would be able to cover case 1 and case 2, or I could filter lines depending on the case?
It would be great if you guys could point me in a direction to find a solution to this problem!
Thanks