Sort vectores/points in specific order


(Rotis E Mail) #1


new day, new problem. :slight_smile:

I need to sort 6 vectors/points in allways the same order. I have just a defined start, nothing else.
Then i need the other 5 allways in the same spot in the list depending on the defined one.

Lets say the first vector is the first to the right and appears like that first in the list, the second the second to the right and shows second in the list and so on.
If the defined basevector change, i need the first vector to the right to be the first in the list also.
A clockwise sorting or something like that.
Is this understandable? :smiley:
Thats important so the function doesnt put a vector to in direction to the defined one. That messes things up…

Or i have to make sure that the defined vector is not possible anymore between the other 5 when i distribute the vectors to the function.

There is a chance that its ok, but if you slide the randomiser or increase the grid etc. you see that its not allways working.

can someone help me there? I worked on that all night… cant figure it out…
The tree is a bit messy but you just have to look at the grouped boxes.

Cheers! :slight_smile:

sort (51.3 KB)


Not on pc now, could you sort them around a curve( circle)?

(Rotis E Mail) #3

Hey, thanks for replying! :slight_smile:
Tried that but didnt get far. is there a way i can define the list order or direction of listing at a circle? distance to curve or something doesnt work because that doesnt get the right differences in value to sort them correct.

Further down the tree i figure out the degrees between them and the one defined etc. but to get that for every possibility identical i need a identical listing to start wih.

Clockwise or any other way of listing them. that clockwise thing is just something i came up with what i think could work if i could tell that grasshopper. :smiley:

(Rotis E Mail) #4


i may almost got it. But there is something still wrong…
I managed the count along the circle. And it works for the one branch just fine.
But if i feed another start point (here the bottom half) with the exact same function it gets messed up. You can see the ochered colour is the “base” vector. But i cant define it in the circle fit or somewhere else.

Is there a way to tell the function to start allways there? I tried things like seam, shift list etc…