Order lines within tree in positive X,Y,Z direction, and keep the same tree/branch format

Hi,

Challenge:
There is a tree which contains multiple lists, all containing lines.

I would like to reorder the Start-End sequence of the lines. In a way that the lines (startpoint A, Enpoint B) always run in the positive X-direction, positive Y-direction or positive Z-direction.

Besides, Its important that the original tree/branch format remains the same.

So for example see figure below, the startpoints represent 0, the endpoints 1.
(at the moment (see GH file) of them are wrongly oriented).

2020-05-13 Reorder start-end points of lines.gh (3.8 KB)

Do you have any suggestions?
thanks :slight_smile:

image

something like this?

Another solution:


ReorderLines.gh (5.2 KB)

1 Like

Cluster Flip_XYZ:


start-end points_2020May13a.gh (16.5 KB)

1 Like

Looks good but I’m not going to wire up your model from a screen image. Where’s the GH file?


start-end points_2020May13b.gh (12.3 KB)

1 Like

Ahh perfect, thanks! :+1: :+1: