Hi,
I’m struggling with a data tree issue in Grasshopper, and I can’t seem to get the structure right…
I have a tree of planes organized in branches with single-level paths like:
{0} {1} {3} {4} {5} {7} {8}…
Each branch contains several planes.
What I want to do:
Detect branches with consecutive path numbers (for example {0} and {1}; {3},{4},{5} and so on).
Group those consecutive branches together. So the structure should become something like:
{0} → former {0},{1}
{1} → former {3},{4},{5}
{2} → former {7},{8}
I managed to extract branch indices using Deconstruct Path
Detect consecutive numbers
Create group indices (like 1,1,2,2,2,3,3)
But I get stuck when trying to properly rebuild the tree so that the grouped branches are merged into new paths.
Any help appreciated!
Best,
Vince
Pathgrouping.gh (14.9 KB)




