Object sorting problem

Hello, everyone,

I currently encounter a situation as follows:

I want to reorder the vertices on the selected object

I first set a fixed point and then compare the distance between the
vertex on the object and the fixed point

But when I select the number amount <5, everything is normal

But when the number amount > 5, because the objects are arranged in a
ring, the order is chaotic

Can someone please tell me a better solution

thank1

Object arrangement problem.gh (25.5 KB)

Hello sailor!
I’m sorry but your script has a component called ‘curve middle’ wich I do not have and I can’t find online. Would you replace it or post the link to this plugin website?

Best regards,
Sir Ernest Shackleton

Hi Sir Ernest Shackleton,

This is the built-in plugin for rhino 6.0 grasshopper

Weird, that component does not appears in my GH. Anyway, here’s my solution:
CONVEXHULLING.gh (32.3 KB)

If this helps you solve your problem, mark it as solution. Thanks.

Best regards,
Sir Ernest Shackleton

Hi Sir Ernest Shackleton

Please forgive my wrong expression

I ended up hoping to rearrange the order of triangle vertices

As shown below!