Reorganizing a flattened data tree into branches

Hello!

I have a data tree problem which seemed to be quite simple but I couldn’t solve it so far.

First of all: It is a data tree organizing question, the points on lines is just a simple example to visualize the problem. (this question originated from a much more complex definition, which I didn’t want to post, as it is not important for solving it, so I settled up a basic example)

I have a flattened data tree (had to because of a Karamba line-line intersection component), and I would like to organize the output based on their original branches.

If the tree is not flattened, then it is very simple with a path mapper component (also incuded in the definition). But I can’t solve it with the flattened data.

I tried with Tree branch and ranges but it doesn’t work the way I expected. (I am not sure if it is possible to use the complonent like this). Also experimented with Split tree, but still no universal solution.

Any recommendations how to solve this?

Data tree_question.gh (12.9 KB)

Thank you!

Zsolt

Not sure but are you looking for a component like Unflatten Tree?

2 Likes

Yes, something like this!

The problem is that in my original project every input line is intersected with others, so the output has more itmes per branches than in the original one. This is why I have to operate with the branches somehow.

Every input line goes to a branch, than it is divided to smaller sections (so the branches now has more elements), and I would like to organize the output in a way that the original data is stored. (so that I can define different properties for the flanges, braces, etc)

The actual problem with internalised lines:
(substituted the Karamba plugin component with a “dummy” and internalised the output, too)
Data tree_question_2.gh (12.8 KB)

So, you want a data tree with 469items into 8 branches just like your initial data tree with 8 branches 250 items total? That doesn’t sound like the Unflatten Treecase. Anyway, have a look at the attached version.


Data tree_question_2_re.gh (20.6 KB)

1 Like

Awesome, thank you for your help!