简体   繁体   中英

Identify out of the polygon triangulation as a result of Constraint Delaunay Triangulation

I have a set of polygons, which may share common edges and nodes. All these polygons are strictly non-overlapping, although they can share a common vertex or edge.

I want to triangulate all these polygons in batch, as such, the solution I can think of is constraint delaunay triangulation. But the output of Constraint Delaunay Triangulation will generate triangles that are not in the original polygons.

Is there a way to identify these out-of-polygon triangles?

Edit: Matlab has a way to do it via the inOutStatus ; I am looking for such an algorithm independent of the language.

Many Delaunay triangulation packages (such as Triangle , which I would recommend) generally include the option to remove the "outer" triangles from the triangulation auto-magically. Check out the documentation.

If this is not the case for your algorithm, you should be able to prune off the outer triangles by testing whether the centroid of each triangle lies within the polygon(s) that you've specified as constraints, via a point-in polygon test for instance. This should always work since a constrained Delaunay triangulation will ensure that no triangle edges cross the polygonal constraint edges (there's no chance of a partially in/out triangle).

Another consideration for your problem is the batch processing you describe. The complexity of most (if not all) Delaunay triangulation algorithms is non-linear (Triangle achieves O(n*log(n)) ), so I would think you would actually achieve a speed-up by processing the polygons one-by-one rather than all at once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM