I have a flattened list of surfaces, some of wich are coplanar, but not all coplanar surfaces intersect. I need to union these into separate regions. Unfortunately the component needs to know in wich plane it unions. Has anyone got an idea how to put coplanar surfaces into branches?
You can try formatting a textual description for each of those surface planes. If you pick the right kind of formatting you should end up with a list of text where identical values mean the associated surfaces all belong to the same plane.
If all your surfaces are oriented orthogonally (as your picture seems to imply) this formatting will be somewhat easier. You’d need to figure out whether the absolute x or y values of the plane normals are bigger, then combine that with the appropriate coordinate from the plane origin.
For example if the plane normal points (mostly) in the positive y direction and the plane origin is at (4.04, 8.08, 3.03), your text format for that plane might look like
"Y/8.08". Any other surface which also has a normal pointing in Y and an origin at the y=8.08 value is co-planar.
Does that make sense?
Using a bunch of rectangles which only belong to 4 distinct planes, here’s how to combine them into different branches of a single datatree: orientation-based-merging.gh (27.9 KB)
Thanks a lot @DavidRutten, that is exactly what i needed, helpful as always.
Have a good one!
I’ am trying to solve a similar problem. This solution fails if you simply rotate the input surfaces by 45deg. Perhaps we need some more tolerances
Mr.A.orientation-based-merging_ReRun.gh (28.4 KB)
Use a better algorithm.
orientation-based-merging_2020Apr13a.gh (26.9 KB)
I hear ya! That is cool!