Sorting point question

unhandled

(Tiscasilaban) #1

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)


Make Line from points
(qythium) #3

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):


#4

Maybe this helps:


(David S. Mavrov) #5

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)


(qythium) #6

@Baris Interesting link :slight_smile: 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:


Mesh from concave boundary points
(David S. Mavrov) #7

Damn this is clever :slight_smile:


(qythium) #8

Yeah, it’s quite an elegant construction :slight_smile: - 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 :smile:


(David S. Mavrov) #9

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


(Michael Pryor) #10

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


(Tiscasilaban) #11

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 !!!


(qythium) #12

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.


(David S. Mavrov) #13

True. And once accepted… where the hell is the download link anyways :smiley:


(Michael Pryor) #14


alphaShape.gha (22.5 KB)


(David S. Mavrov) #15

Yeah I know. It was just a joke :slight_smile: