# How to judge whether the order of 2 groups of points in 3D space has changed in space?

As shown in the figure below, the points of the closed curve on the left are arranged counterclockwise. The open curve on the right has a change in the order of points in the square. The two groups of points are two-dimensional np.array with the point number as the index. : How to judge that the group of points on the right has changed in spatial order?

If the point ordering outside the square remains constant, the first suggestion coming to mind is to compare distances along the curve between points inside and outside the square. If point 11 is closer to point 1 than point 10, you may know that point 11 is not in sequential ordering.

1. The problem to solve has changed. You declared open and closed curves in your OP. The markups files that you post are Fiducial ones.

2. How does ordering of points change ? By code that is controlled by the developer ? By user UI actions ?

3. How is ordering of points relevant for a Fiducial node ?

It’s hard to try solving a vaguely posed problem, the more so if it’s dangling.

This question has puzzled me for a long time - how to judge whether the surface is closed…I have tried some methods, but none of them are ideal.Later, I found that the order of the generated point clouds is arranged in a certain direction (clockwise here) when it is closed, but when it is not closed, its spatial order has changed, so there is the above problem .
How to extract the vertex coordinates of a polygon of a model in the current section?
How to judge a curve model obtained with vtkplanecut or vtkcutter is closed?

Yesterday I came up with a function that calculates the included angle of each point relative to the center of mass and the initial point… If you sort by the angle of the included angle, the order of the ‘closed’ state remains the same, and if the order changes, it is not ‘closed’.