Sorting points by Y axis

Hi everyone,

I bumped into an issue about sorting points, as attached screenshot shown, I’d like to sort the points to the Y-Axis first instead of the default logic (first x, then y, then z)

Before when using lunchbox to do such thing, i can use reverse surface direction to change to sorting, but this time it’s only points and so far i had no luck to get it done.

Would be nice if anyone can give me some hint

cheers.


Sorting points_Y first.gh (39.7 KB)

This might do it:

Hi Anders thanks for the quick reply!!

I tried to hook it up into my file and got this result, any clue?

Hello
do you want something like that ?


If so it seems you didn’t’ really read what was here. I used David Rutten Method that uses a single number calculated with a formula like (Pt.X+1000*Pt.Y)

If you invert X and Y

it is also possible to remap value in order to have just positive values and no surprises!
Sorting points_Y first.gh (39.5 KB)

2 Likes

thank you Laurent, this is exactly i was aiming for. Somehow I overlooked David’s approach but now i get the desired result.

Will also study a bit the script you provide.

Thank you!

Ah sorry I missed the “first Y, then X” part, and obviously the topic was already solved. But just for completeness, one could extend the script I posted like so:


181011_SortPointsByYThenX_00.gh (35.2 KB)

2 Likes

Thank you Anders, this way also works.
I appreciate the different approach you showcased!

1 Like