Branch according to index

I’m trying to branch a number of branches of curves according to the sheet they are on (using Opennest)

See below for a screenshot as an example. Opennest outputs contour curves in a series of branches, organised in branches. The IDS number is a list of indexes for which sheet the curve appears on. For example Branch {0,4,0} (labelled RR in 3d) has only 1 element on sheet 1, and 4 elements on sheet 0

How can I branch the curves so that curves are organised in branches according to their sheet. So {0,4,0} becomes {0,4,0} for sheet 0, and {0,4,1} for sheet 1.

Post the definition.

The logic of the file:
A pipeline looks for Brep
Contours for each Brep is then created
OpenNest organsises cutting sheets per Brep (labelled)

Users are able to then to create layouts from the sheets created by OpenNest (205.6 KB)
SITEMODEL0.5.3dm (379.0 KB)

Here’s one solution: (221.0 KB)
This file references geometry from your 3dm file posted above.


Hey Kevin,

Thanks for the message. I wonder if it can’t be done more simply though - finding the centres of each curve does seem like a lot of work when there is a list of digits which denote which sheet it is on (under IDS).

I was hoping that it could be solved just by working with the trees created from opennest.

many thanks for taking a look though :pray::pray:

Earlier today I tried a couple of methods just working with the DataTrees but wasn’t having success, so I re-started using the point-in-curve method that I posted above and found a solution fairly quickly.

Made another attempt working with the DataTrees and came up with this: (222.7 KB)
(Again, this model references your 3dm file posted above.)

It’s not really simpler, but it is slightly faster (neither method takes long with your file).


1 Like

Belated thanks for this! I still struggle to get my head around branching logic.

Thanks again!