Separate vertical curves of a rectangle based on the centroids

Dear all,

I have some windows (rectangles) and I am trying to separate left and right vertical curves but I am seeing some dissident curves which do not follow the same formation. I came up with the idea of using the centroids as the local origin point and categorizing left & right curves (mid-points) based on their position. However, I’m failing in putting this seemingly easy idea into practice. Could anyone please provide me with some pointers on how can I move forward?
Thanks a lot!
Bests,


Problem 1.gh (31.6 KB)


Problem 1_re.gh (25.8 KB)

I solved it also but it was very messy and a long script. Yours one is very concise and great and will help me to adapt my approach. Thank you so much Kim.