Surfaces Sort by Distance

Hi,

I splited surfaces by curves, then the order of surfaces became a mess.
I have tried to Sort surfaces by distance between the center of each surfaces and a point of the red lines as below.
But only B part is correct.
There is even flipped part as A part.

It would be very helpful for me to know the reason and solution.

Here is GH:
Surfaces Sort by Distance.gh (17.0 KB)

Thanks for you help in advance!

Surfaces Sort by Distance why not.gh (26.1 KB)

Hi
Is it what you look for?

1 Like

when I see some sorting of points does not look right, I always drop a line component on the canvas to check what actually is going on in the data tree

in this case it looks like this:

you can use the nice solution shown by @Petrol , or use a few trim tree and partition list in your definition to break and rebuild the outmost branches of your data tree after the Distance component


Surfaces Sort by Distance_Re.gh (23.4 KB)

2 Likes

Hi Petrol,

Thanks for the your solution.
It is half correct.
I need to get the surface order like the points in your scripts.

Hi Inno,

Thanks for the your solution.
It works nicely.

My bad.gh (29.1 KB)

1 Like

Check this as well.


Surfaces Sort by Distance_re.gh (22.4 KB)

3 Likes

Thanks a lot.
It works and I am trying to understand it.

Nice tricky one

Hi Kim.

Thanks for the solution. :+1:
It is amazing to learn many different solutions.