Change Partition List Order | Rearrange order of branches of data tree

Hello! :blush:

I’m currently working on a design involving twisted boxes that I want to populate with a beam structure. My goal is to extract the outer faces of these twisted boxes (image A) to create a kind of cage.

I’ve successfully extracted the left and right surfaces (image B),

but I’m having trouble with the top, bottom, front, and back surfaces. When I use the partition and tree branch features, the tree branches selected don’t align with the ones I need for top and bottom surfaces (Images C and D)


and same goes for front and back surfaces (Images E and F).


Is there a way to manipulate the data tree so it consistently selects the correct partitions?

Thanks so much in advance for your help!
Voxels03.gh (382.0 KB)

Is there a way to save the file with the plug-ins still embedded, similar to the “internalize” feature for geometry, so you’ll be able to open it? Right now, if I delete the plug-ins, the script won’t run.

I figured I could internalize the faces! :smiley:
I think now there shouldn’t be any plug-ins from the list
Voxels03.gh (382.0 KB)

Looks to me like the pieces you want are in List Item components, before Partition List?

Using the list item, I get all the grouped surface layers, including all the internal surfaces. However, I only need the outer surfaces that form the “cage” of the shape, and I haven’t been able to isolate those— even with the list item component. Is there something I might be missing or misunderstanding?

've managed to extract all the surfaces except the front and back. When I try to split the list or use the tree branch component to select them, it behaves unpredictably, selecting random faces instead. Any idea why this might be happening?

Is there genereally a way to change the order of a list or tree branches?

Voxels04.gh (394.3 KB)

Initially, I used this expression for X, Y and Z: round(abs(x))
But I had to fudge it slightly because some angled surfaces fooled it: round(abs(x)-0.1)


Voxels03_2024Nov4aa.gh (386.4 KB) UPDATED!!

Later… this got a lot more complicated :bangbang:


Voxels03_2024Nov4bb.gh (411.7 KB) UPDATED!!


Might be that each voxel has six sides, like a cube, so there are many adjacent faces.

I went to extraordinary (ugly) measures (yellow group in version ‘c’ below) to separate two breps joined together at the “nose” of this shape, colored red in this image:


Voxels03_2024Nov4c.gh (407.5 KB)

This approach has nothing to do with “partition list order”.

Oh wow really kind of you to always take the time the time and solving the problem :slight_smile: For now it helps me achieve what I want, really appreciate it, thank you!
I will however start a new post on data trees, because I really want to understand how they work and how I can manipulate them. :smiley:

I was about to say there is no need to start a new thread, but I see you already have.

You have presented a data tree with 200 branches, each with six faces of a “voxel” (200 * 6 = 1200 faces total):


Voxels03_2024Nov4d.gh (386.9 KB)

If you apply Shift List it becomes five branches (40 voxels per branch, 5 rows of 8 voxels per row, or 40 * 6 = 240 faces per branch - 5 branches * 240 = 1200 faces total):

It’s great to understand data trees :bangbang: Many ways to manipulate them.

In this case, adjacent faces are effectively duplicate faces (if I understand your goal?) and there must be a way to ignore duplicates and get six branches of surface faces (left, right, top, bottom, front and back).

Have fun.

Thanks to your help, I was able to extract the faces I needed! :heart_eyes:

I’ve started a new project where I not only need the faces but also need to select voxels in specific orders. To clarify: for creating the beam structure, I’d like to reduce the thickness of the voxels in the back area (the red “nose” in your picture), as it’s quite dense there. So I need to divide the structure into sections and select the correct data branches to adjust the thickness.

I’m still a bit confused about how data trees work, but I’m here to learn—and very grateful for the community’s help as I improve. :blush:

Let’s consider voxels instead of faces. We can always deconstruct voxels to get faces later.

Before that, I’ve separated the geometry from the code by putting it in a separate file and using Data Output and Data Input. This file must be run first:


Voxels_set_2024Nov5a.gh (380.6 KB)

Then the geometry is available to multiple versions of this:


voxels_2024Nov5a.gh (37.8 KB)

Left and right


Top and bottom


Front and back

(using Sort Points)


I find the ColorBa and ColorJa components very useful for visualizing data trees of geometry but you might find another tool useful too; ‘Tree/List Viewer’ uses a ‘path idx’ slider to select branches and a ‘list idx’ slider to highlight (in yellow) one geometry in the selected branch.

voxels_2024Nov5bb
Full size
voxels_2024Nov5b.gh (46.8 KB)

Examine each of the four geometry trees connected to it,

I feel really bad that you’re going through all this trouble to help, but I’m also extremely grateful—I’m learning so much from your scripts! I can’t thank you enough. These are all approaches I wouldn’t have thought of.

Don’t feel bad :bangbang: Understanding data trees is crucial to understanding GH. :+1:

One more way to look at front and back, using Flip Matrix.

voxels_2024Nov5c
Full size
voxels_2024Nov5c.gh (54.5 KB)

I wanted to share the progress I’ve made, thanks to all the help! :blush: There are still a few parts of your script I don’t fully understand, so I might have a few more questions for you down the line, if that’s alright. But for now, I’m really happy with the result! :smile:

I might have missed it but how did you create these twisted boxes?