Grasshopper

algorithmic modeling for Rhino

Hi everyone! I'm trying to order a list containing 10 points so I can create a polyline as shown in the picture (black line).

I could use list item to extract every single point and then feed them into the polyline but maybe there's a more eficient way to do this 

Thanks

Views: 6049

Attachments:

Replies to This Discussion

What I use and it usually works quite well (similar to Tom's) suggestion.

Well ... this is a typical case that requires a concave hull algo (not convex).

1. The "classic" (using SphereFit and PlaneFit and then the circle as sorting curve) fails for more than obvious reasons. BTW: if you use a sorting curve from a convex hull ... sorting also fails.

2. The also "classic" (Sort by angle using a focus point [variable for fun or the centroid]) also fails for different reasons:

3. The concave hull never fails (but unfortunately the C# is classified as strictly internal):

Work around, not confidential, non bulletproof but it works only you eye ball it with a tolerance slider.

you can use this until  something better comes up.

Here's the approach I usually use to sort points radially around a center (using GHPython and RhinoCommon). Similar to a couple of the other suggestions.

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service