Use the triangulation of a triangle triangle to triangulate a polygon

I have a delaunay constraint (CDT) triangulation algorithm, and I have a polygon (it can be concave or convex) as input. How can I use this delaunay constraint triangulation algorithm to split a polygon into triangles without introducing new points?

Edit: the union of all the triangles should match the polygon. Thus, one cannot simply take the CDT together with the boundary as the edge of the constraint for generating triangles, because this will create a convex polygon, regardless of whether the input is concave or convex.

+4
source share
1 answer

The easiest way, since you have a polygon and not a point cloud, it would be naive to least triangulate and then visit each edge and check if it is outside the original polygon using simple tests of intersecting lines and polygons.

Depending on your algorithm, you can run this test as part of a triangle and skip the passage at the end. I'm sure there is a slightly better way, but this is the first thing that comes to mind.

Edit:

I implemented this on my triangulator, and it gave the wrong results, because I have no limits. If you make sure that all of your polygon edges are used, I believe that it should work.

+1
source

Source: https://habr.com/ru/post/1343788/


All Articles