Enclosing line for a list of points
-
There are likely many examples for that task available on the web, but I do not know the technical terms. I have a list of point (in this case, System.Drawing.Point), and I am looking for a closed line around them. All points of the list must be inside, some other points may be inside additionally, but their number should be as low as possible. And, actually, I do not need the line proper: knowing its length is enough. Finding a rectangle enclosing all the points of the list is very easy - but there are too many other points enclosed. Another issue is that there might be "holes", not all points have a direct neighbor (in "8 neighborhood"). Could you give me some pointers where to look for? Thanks a lot.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
-
There are likely many examples for that task available on the web, but I do not know the technical terms. I have a list of point (in this case, System.Drawing.Point), and I am looking for a closed line around them. All points of the list must be inside, some other points may be inside additionally, but their number should be as low as possible. And, actually, I do not need the line proper: knowing its length is enough. Finding a rectangle enclosing all the points of the list is very easy - but there are too many other points enclosed. Another issue is that there might be "holes", not all points have a direct neighbor (in "8 neighborhood"). Could you give me some pointers where to look for? Thanks a lot.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
Hi, you want a “convex hull” algorithm; there are some excellent articles on the subject right here at CP, mostly by Eric Ouellet. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
There are likely many examples for that task available on the web, but I do not know the technical terms. I have a list of point (in this case, System.Drawing.Point), and I am looking for a closed line around them. All points of the list must be inside, some other points may be inside additionally, but their number should be as low as possible. And, actually, I do not need the line proper: knowing its length is enough. Finding a rectangle enclosing all the points of the list is very easy - but there are too many other points enclosed. Another issue is that there might be "holes", not all points have a direct neighbor (in "8 neighborhood"). Could you give me some pointers where to look for? Thanks a lot.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
Convex hull - Wikipedia[^] is probably a good starting point. Good hunting!
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
-
Hi, you want a “convex hull” algorithm; there are some excellent articles on the subject right here at CP, mostly by Eric Ouellet. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
You type faster than me ;P
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012