Hi, I have a list of points which I know sit on the perimeter of a rectangle. They’re currently in a random order but I’d like to reorder them in as if you cycle round the perimeter of the rectangle in a clockwise fashion.

The best way I could think of is to divide the list into 4 groups based on which of the 4 edges they sit on, sort them, then recombine them. My script is failing at this stage - I can’t get it to happily find the points that sit on the Y=0 edge. What am I missing? I’ve deconstructed the points, and asked it to list those that = 0, but it’s not picking them up.

What @Volker_Rakow said but sometimes I also take my unsorted points and use a Fit Circle or Fit Line component on the points and then use that curve as the input for the Sort Along Curve component.

Depending on the shape of the points being sorted this will sometimes yield much more consistent results.

Perhaps I should mention that to get the points to order themselves in the “clockwise” direction along the rectangle, you might have to change the direction of the rectangle curve with Flip Curve