K. Barresi
K. Barresi

Reputation: 1315

Algorithm for a "Blob" Border

I have several 2 dimensional circles that I want to draw a border around. I've done this using a convex hull before, but my goal is to make the border almost like a surrounding "blob". I attached a picture to show what I mean.

enter image description here Essentially, I want the border to outline the circles, and be pulled slightly into the middle of the area if no circles are present. The center shape shows my current train of thought -- create normal lines for each circle, and somehow merge them into a complete shape.

Summed up, I have 2 questions: 1. Are there any existing algorithms to do this? 2. If not, are there any algorithms that would help me merge the circle outlines into a single larger path?

Thank you!

Upvotes: 2

Views: 690

Answers (2)

user3146587
user3146587

Reputation: 4320

One way to get this border could be to simply compute the distance to the centers of circles: for a given point this distance is the minimum of the distances from this point to all the centers of the given circles. Then sample this distance function over a regular grid. And finally extract the f-level of this function as a collection of polylines with an isocurve extraction algorithm (like Marching Squares). f should be the radius of the circles augmented with the desired margin.

Upvotes: 1

user1196549
user1196549

Reputation:

"Everything You Always Wanted to Know About Alpha Shapes But Were Afraid to Ask" is for you http://cgm.cs.mcgill.ca/~godfried/teaching/projects97/belair/alpha.html

Upvotes: 3

Related Questions