Sort faces by naked edges

Hello,

sort faces.gh (167.0 KB)

I am struggling on sorting the faces of this brep. My goal is to create a tree where each branch is the container of all the faces that are sharing the same edge direction.
i think i am almost there but i can’t find it.

Please help !

Thanks to all

Hi,

Here are two methods.
One bu intersecting all curves to all surfaces. If there is an intersection than the surface is culled. The problem is that some surfaces share sides so end up duplicated.

The second one is more complex, but also closer to what you did.
First I associate each surface to one curve. Then I remove all unused curves. Then I match curves by direction using dot product as you did and cull surfaces per branch.

sort faces.gh (139.5 KB)

Top !

thank you very much !