Arranging Points on different Rotated Geometries in GH

Hello everyone,

I have two sets of lists of points, Let’s say A and B. The picture you see is what I want to achieve:


The numbering should be chronological and two rectangles’ point indices should be “mirrored” so to say.

This I have already achieved by creating a plane on an average point of each 4pts and arranging them according to an angle they create to this “local” plane x-axis.
However, I also have a variable that rotates those rectangles and if the angle of rotation of A & B doesn’t match, logically points of A and B also mismatch. So my solution is inconsistent.


I am stuck in a loop of trying the same stuff so maybe someone has an experience with similar problems?
I appreciate your help!

NO Files Attached

Reverse & shift list.

Thank you for your answer. However, this does not fix my problem since I do not know if The indices I want to start my numbering from will be exact in two of my rectangles.

could you please let us know, given rectangle A, which workflow you are using to construct rectangle B, ans also what is the min/max rotation angle and on which plane?
posting your grasshopper file would be of big help with that

If you want help then post some code.

The problem itself is a little bit more complicated. I have a tree of 2 lists of rectangle points which should be mirrored right and left. The rotation of the points depends on three angles: alp (that rotates both rectangles together as a whole) and bet 1 & bet 2 (which rotate the rectangles separately).
The solution script I wrote (in purple sketch) works fine when bet 1=bet 2 and gives me desired result (see picture below)


However, once bet 1 != bet 2 the ordering doesn’t match anymore.
I hope the scripts makes it more clear.
Sort Points.gh (41.2 KB)