Outer curve without convex hull


(Edward) #1

Outer curve without convex hull.
So, I want the green curves that are connected to points and that are the the edge of the form. I do not want to use convex hull because it makes a blob out of it rather than a form similair shown as in the image.

Field 01.gh (19.2 KB)


(David Rutten) #2

Should the boundary follow the intersection of these lines, or should it be made up entirely of intact lines?


(Edward) #3

Yes, that was for me an optional option, but if you know that also.

I assume, it will probably be, intersection curves, split curves, and get the points or something.
And thank you for your response.


(David Rutten) #4

What you can do is create a plane surface which is significantly bigger than the bounding rectangle of all your points, then use the Surface Split component using all your lines as splitting geometry. It’ll give you a whole lotta triangles and one surface surrounding your line network. You have to find this surface (biggest area would be my first approach, but there are other ways), then get the edges, join all edges together, you now have two closed polylines, one outer boundary containing 4 segments and 5 points, and one inner boundary which is the one you want.

I think that’s the only way to do it in vanilla GH. Some plugin may provide a much easier way, but I do not know for sure or which one.


(Edward) #5

Outer curve 02.gh (10.5 KB)


(Pfotiad0) #6

A challenging problem that one. With code it can been addressed via classic closed cirquit detection in a given Line Graph and then a concave (not convex) hull … or by the classic concave hull approach.


(Edward) #7

Thanks Pfotiad0,

I never heard about a 'classic concave hull approach.'
I will try to remember that. :+1:t2:


(Pfotiad0) #8

Here’s a not classic (i.e. Graham, Jarvis et al) approach

ConcaveHull_ACM_MYS.pdf (1.4 MB)

Here’s convex (white) VS concave hull - using points … but for a flat Line graph the cirquit way (working on integers given a VV connectivity tree) is rather the faster way.