Merge and sort path tree

Hi all
I struggle a lot with tree path, i need to join Breps from multiple tree but last of them need to go from:
{0} N=2
{1} N=2
{2} N=2
{3} N=2
to
{0} N=4 ({0+1})
{1} N=4 ({1+2})
{2} N=4 ({2+3})

I tried to solve with path mapper but i get this
{A} {(A+1)/2} —>{0} N=2
{1} N=4
{2} N=2
That doesn’t match…

Any clue? I’m not good enought…

There are probably more elegant ways of doing it, but this might be a solution you’re interested in:
treepath.gh (9.0 KB)

(if you’re to reconstruct the script, make sure the tree branch node is set to renumber instead of maintain the path)

1 Like

Perfect !
Thanks a lot, i need time to get the logic.