Search code examples
c++mathgraphicstriangulationconvex-polygon

Polygon Partitioning vs Triangulation


I recently asked this question about how to cut down a concave polygon to convex ones, and I was suggested to do Triangulation or Polygon Partitioning.

The library I'm using (SFML\Box2D) only takes convex shapes.

This is what I want to know:

  1. Is Polygon Partitioning, or Triangulation of Polygons faster?

  2. How does Polygon Partitioning work/ How do you do it?


Don't forget Triangulation doesn't require convex shapes to be made either...


Solution

  • Not a full answer to your question, but if you have a general polygon (concave, convex, whatever) and you are looking to triangulate it (for subsequent openGL style rendering perhaps) you could look into "constrained Delaunay triangulation" packages. One such example is the Triangle package, which is reputed to be fast and robust.

    As I understand it, the algorithms used in Triangle exhibit O(nlogn) runtime complexity.