How to sort points within different branches in a tree?

Hi there,

I was wondering if its possible to sort different tree branches by a X or Y coordinates?

What I want to get is as you can see the X-coordinates are sorted, but i want that the first branch starts with the 0 Y value and the second branch with 8.5 value. Is there a way to sort tree branches?

Regards,

Giorgio

Hello Giorgio,

something like this?

1 Like

Thats what i was looking for! Thank you Pavel!

Each branch has a single Y value so you can sort the Tree Statistics ‘P’ (Path) output by that Y value, then construct a new tree using Tree Branch, as I did just ten hours ago here:

If you had posted your points I would use them to show you, With only a screen shot, advice is the best I can do. Here is the relevant portion of that code:

1 Like

Thank you Joseph, i will look at your solution also and see if that works and try to understand it first what is happening. Thanks for your information!

Of course it works! You could post your points and I’ll show you.

Here are the files. One Rhino and one GH file.
ExamplePoints.3dm (37.0 KB)
PointsExample.gh (8.5 KB)

Points are internalized, no need for Rhino file.


ten_point_2022_Nov9a.gh (14.9 KB)

1 Like

Hello, i have a similar problem, but my branches have different size. I followed your solution but it seems like it gonna keep the same branch size as previously but not “rearrange” branches… Do you have any idea?