Point List Order & Distance From Average

Afternoon All,
Im following this method to sort point list in order which works well.
However doesn’t obtain the desired outcome, i assume this is the issue but am unsure how to apply it in dynamo, any thoughts would be greatly appreciated.
Sort Points in Clockwise Order | Baeldung on Computer Science

230329_OrderPointsClockwise.dyn (58.2 KB)

image
Unsorted
image
Sorted
image
Preferred Order

Cheers,
KS

Hi @Kai ,

The method you are using seems correct. I suspect the plane’s origin/ the polygon center is higher than expected, and thus the more outlying point is actually earlier in the sorted list. Unfortunately I don’t have Revit installed on this pc so I can’t confirm that.

1 Like

Probably need to factor in the weighting of angle versus weighting of closeness to the centre of the points. As Daan pointed out its working the way the article describes (their actual diagram early on is flawed and wouldn’t work that way using their algorithm). If i recall correctly the name for this challenge is concave hull if that gives some research leads.

Heres a good post about it: How to find the concave hull for a cloud of points in 3D space? - Geographic Information Systems Stack Exchange

1 Like