0

I have a quite specific task.
I need to compute alpha shape of a set of points. (You can frolic with already implemented algorith there)

The point is that I have predefined subsets of points (let's call them details) and I do not want their structure to be changed. For example, suppose these polygons to be details:

enter image description here

Then, the following hulls are ok depending on alpha-radius:

enter image description here

enter image description here

And the following is not:

enter image description here

In brief, I want the structure of specified subsets of points to stay unchanged during reducing the radius.

So, how do you think:

  1. May I use any of already implemented algorithm or should I figure out some specific one?
  2. Is there implemented example of Alpha-Shape algorithm with open source code anywhere? (Alpha-Shape, not Concave hull. It must split contour into several parts when reducing the radius)
  • Why do you say that the third case is not ok ? What is wrong with the "structure" ? –  Jul 03 '19 at 14:56
  • Well, as I mentioned above these quadrangles are just examples of details that cannot be crossed by the result contours. Why? Because of the application area of the algorithm I'm trying to find. These contours will be cut from material on the next step and it would be wrong to split the details. Should I edit the question to make it clearer? – Sviatoslav Iakovlev Jul 03 '19 at 15:08
  • "that cannot be crossed by the result contours": what ?? –  Jul 03 '19 at 15:11
  • Oh, I get it. You want the alpha-shape not of the points but of the initial polygons (the term *details* is not intuitive). This is not the standard algorithm. –  Jul 03 '19 at 15:12
  • 1
    The same way that a standard alpha-shape is a subset of the Delaunay triangulation of the points, it could be that what you are after is a subset of the constrained triangulation around the polygons. –  Jul 03 '19 at 15:18

1 Answers1

0

Well, Finally I solved this using constrained Delaunay triangulation.

The idea (that Yves Daoust shared in comment to the question) was to use not just Delaunay triangulation during building Alpha shape, but constrained Delaunay triangulation.

Algorithm: In brief, I:

  1. Took convex hull of the promoted polygons
  2. Computed its constrained triangulation. (Constraining segments are polygon's edges)

On this step I used Triangle .NET library for C#. I guess, every popular language has alternatives to it.

  1. Built alpha shape: threw away all triangles where any edge is longer than predefined alpha

Results of my struggles:

  1. Alpha = 1000, alpha shape is just a convex hull

enter image description here

  1. Alpha = 400

enter image description here

  1. Alpha = 30. Only very small concavities are smoothened

enter image description here

Feel free to write me for a deeper explanation, if you wish.