Sorting struggles

yes, you are completely right, I think this is a very clean solution, while my previous one was a patch into another patch into another patch…


sorting subbranches_Re_Re.gh (23.6 KB)

basically, it was not completely clear to me how the contour outputs were organized… but after your thoughts + one more minute of attention + some coffee it became clear enough that the Contour output data structure has the very same sorting order of its Shape input, so it’s possible to use tree stat + replace paths to re-create the very same branching structure you have on the Shape input itself (= data-structure of your Breps)

in my first post -which does the job, the wrong way- I did not get that the Contour output did retain the same order of the Shape input, so I went in berserker mode and tried to retrieve to which Brep each Contour did belong with AreaCenter+PointInBrep (which is not mechanically wrong, but because the outputs are already correctly sorted for us, it’s just logically wrong :rofl: )

2 Likes