I’m struggling with sorting brep according to a number of criteria, creating subbranches.
Below is an explanition of the logic so far…
First step is to filter according to name (using elefront)
Then, sort breps according to which layer they are in.
Then, create sub branches according to the volume of the brep (which is where my script fails)
…
Then create contours for each brep, fitting to the same branch structure as the above
Regardless of how struggling the entire definition is, is the last component your desired output?
No I plan to work with the data further after the contour step
Do you expect a branch for every combination (layer+volume)?
Potentially
Do you want the contours merged back to the tree as how extrusions are sub-branched, as it seems each extrusion has one contour only?
The contours will need to be in a subbranch according to each extrusion
Below is a diagram of branching i’m looking for. It’s important to note that the number of layers, and volumes are not fixed (though there needs to be at least one volume per layer)
If I follow the logic correctly, if I wanted to add more parameter branching, I’d just need to plug more Cset’s into that integer component before creating the tree?
If I follow your changes correctly I was missing some grafting when branching according to volume…
Could you explain the part you highlighted in purple. I was struggling to organise the contour curves according to the previous mentioned branching logic… your method works, but I can’t help feel it seems a little complicated. Wouldn’t maybe a path mapper help for example?
Any help explaining the process would be greatly appreciated!
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 )