Then I have another tree with surface information. It has a ton of branches but it has a structure like {A,B} where A goes from 0 to 511, i.e., 512 branches (same as the first one).
I basically want to transform the thickness tree into a new one with same structure/size of that of the surface tree. The idea is that the thickness value in {a} repeats in all branches {a;0}, {a;1}, {a;2}, …{a,n}.
I forgot to mention that, in the new tree, the original number of items N per branch must be respected.
In cases where N = 1, the thickness should apear once. For N = x, the thickness should be repeated x times inside the branch. If N = 0, I think the best way is to keep it empty. See below: