Tree Branch inconsistency

Hello everyone,

I’ve used List Item for a long time to order indices with some logic, and feed them through the component in order to build complex trees out of lists.

I found myself stuck multiple times as I tried to use Branch Tree component the same way to build complex trees out of already ordered trees. Indeed, the component does not seem to understand trees of path as branches path, the structure of my branch paths is flattened by the component :

I don’t really know here if it is a bug, or by design, but it does not look very consistent to me. And indeed if I use the RhinoCommon Tree.Branch(Ix); function inside a C# component, it works as I would expect :

Here are the trees to reproduce, as well as the “fixed” tree branch component :
Tree Branch.gh (12.5 KB)

1 Like

?

Yes, the branch paths structure has still been flattened…

Tree Branch with Renumber option then Match Tree seems to return your expected tree structure ?

Yes, you get the expected tree structure, but the datas are not properly matched : the {0;0} branch of the output tree does not correspond to the {0;0} branch that List Item is asking Tree Branch component to get

This is a nice workaround ! But is this the expected behaviour of the Tree Branch component ? It seems weird to me that it trims the input tree without asking.

It doesn’t really trim the tree, it just spits out the entire branch it is asked for from the original tree, with the same branch number, regardless of the branch numbering of the Path input.
So because you are asking for the same branch number several times, they get merged in the output.
The Renumber option is made for cases like this.

So I would say it’s the intended behaviour.