# Sorting point question

good evening everybody,

I came across a problem today.

-I have x amount of points

-out of this pool of points I would like to extract just the points at the perimeter

-then connect those points with a closed polyline ,creating an outline.

It is easy with the example shown but becomes tedious if you have to deal with 50000 points.

I would appreciate if someone could help me with this problem.

Thank you!!!
sort point.gh (4.3 KB)
sort point.3dm (167.3 KB)

How do you define â€śperimeterâ€ť? If you imagine stretching a rubber band around the set of points you end up with a convex hull, which can be arrived at with a built-in component (Mesh->Triangulation):

Maybe this helps:

Here is one potential approach. But it is not automated. To be automated you need to create script capable of iterations and you also need to find and unknown value for each iteration. Maybe somebody has a better idea?

PS1.gh (8.4 KB)

@Baris Interesting link I had a bit of fun trying to implement alpha shapes (non-convex hull) using native GH components, itâ€™s probably robust enough for the planar case:
alpha_shapes.gh (13.6 KB)

Another test case:

3 Likes

Damn this is clever

Yeah, itâ€™s quite an elegant construction - hereâ€™s the paper I referred to https://graphics.stanford.edu/courses/cs268-11-spring/handouts/AlphaShapes/as_fisher.pdf
(Although Iâ€™m not sure if the above corresponds 100% to a standard alpha shape algorithmâ€¦)

So many people use Voronoi and Delaunay stuff just for aesthetic purposes without realising thereâ€™s some really useful maths behind it

2 Likes

You gave me a very nice toy to play with this weekend Thank you mate!

1 Like

How about the AlphaShape plug-in: http://www.grasshopper3d.com/group/milkbox/forum/topics/alpha-shape-mesh

1 Like

Good morning Everybody,

just woke up and saw your posts.
thank you for your interest in this subject.

qythiums approach is elegant indeed.

qythium and everybody else

Thank you for your support !!!

Yeah, I saw that plugin in the forum posts Baris linked to above, but didnâ€™t like the idea of linking to a solution which requires people to sign up on an officially-discontinued forum and wait a day or two to be accepted into the closed Milkbox group ( never understood the rationale for this ).

And especially so for a one-off compiled .gha plugin, which severely limits the portability of the solution where it looks like a simple C# scripting component would have sufficed.