"Hello, I want to sort the points of this shape so they follow a clockwise order. When I rotate the shape in Rhino, the sorting should remain consistent regardless of the rotation. Can anyone help me? I already tried using ‘To Polar’ combined with the points of the shape and a plane constructed from its vectors, but for some points it didn’t work as expected, as you can see.
Point on joined and/or curves don’t have a random order. So joining curves is the first thing to try.
If you just have a list of points with no order, in some cases it is possible to fit a circle through the points and use the circle to sort the points.
Convex hull can also be used to create a first curve for sorting.
Here’s a method to set the 0 point of each polyline to a corner nearest to a desired vector. Rotation of the resulting polylines will not change the vertex numbering. If different polylines require different target vectors at the input stage, you’ll need to make multiple copies of the MDslider and make sure they’re merged/duplicated in the same order as the input geometry.
This does appear to be the same project as your previous threads, so I’ll repeat myself too: Without knowing what the inputs and desired outputs are, it will be hard to help you. The fact that you are still trying to sort points on a polyline after two months says to me that there is probably a better way to achieve your desired results.
EDIT: You said clockwise, so we need to reverse the list and adjust the shift by 1.
@Tom_Newsom wrote: "This does appear to be the same project as your previous threads, " That triggered me, and made me wondering what was happening. It seems: @Nick31:
is working on a classified project (some building I guess).
while doing so he runs into issues, he cannot solve. Looking at those issues:
– in earlier stages of the project movements, errors, etcetera were made, what gives problems in later stages.
– Beste way (advice to @Nick31 a couple of times) is to go back to where the issue was caused and solve it at the root.
maybe this may or cannot be done, so the next best step is to solve the issue at the later stages, what gives great puzzles for grasshopper fanatics (there are many on the forum, so best place to go (this is a compliment).
Because the material is classified, @Nick31 cannot share the files he is working on, so that is why he makes us work with images. To compensate he creates examples, what explain better what he is asking. Problem is, that these examples, just do not have the context from the real problem.
How to workaround this:
At @Nick31 : Please provide us with the “real stuff”. And I understand you cannot share your classified files. So the best would be to isolate the part with the problem and save this in a second file, to be shared with us. Without the real context, I think this will not break the classification. How to do this. Let me show this on an example what I worked on last weeks:
Then select all components you want to show to the forum.
create a new .gh file. Copy paste those components to the new file. (Shift + Command + V (in Mac)) . Connect the correct lines to the internalised data.
Check if the result is OK to be shown on the forum. (In my example , you see the endresult, so probably I had be better to cripple this a bit before uploading. But because it is no classified I am OK)
send to forum TESTEXPORTEW.gh (10.6 KB)
and ask your questions with trust.
NB: Delete those temporarely NUM GEO holders in your original.
Maybe this procedure can help to get you better and faster answers. Regards, Eef
Thankyou for undestanding my goals and your advice. I internalised the data before sorting the points for each surface.
The goal is that each surface has a consistent point ordening. If I rotate or move or mirror the surface, the point ordening must still be the same. So the number 0 must be at the same position. To achieve this I thought of making a plane for each surface. In the end I want to determain where I want my zero point for each surface but also for all surfaces.
making a plane for each surface based on the vectors from each surface
control polygon node. but it was not consistent for every surface
clashing the smaller surfaces with the bigger ones. result short lines of both sides but that only worked for the 4 cornered squares. And if there is no surface there I can’t clash also.
tried to sort the lines with help of the world xy plane for each surface.