Populate new tree to match size of existing tree

Hi everyone,

I have a tree that has thickness information with 512 branches and 1 item per branch:

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}.

Edit #1:

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:

If I understood you correctly, here’s one possible approach:


FilipeBelga.gh (137.0 KB)
P.S. It’s always helpful to share your Grasshopper definition: Help Us Help You

3 Likes

@Mahdiyar,

This part of my .gh file was too entangled in other dependencies. I tried to simplify it but eventually gave up…

Anyway, after your edit, with the trim tree, it worked perfectly!

Thank you!

solved ?
please mark @Mahdiyar post as solution

2 Likes