Polygon Triangulation

A Project by Christopher R. Wicks
for Computational Geometry
Rochester Institute of Technology
Fall 2016 Semester

View the Project on GitHub wickstopher/triangulation

To build and run the project from source, download the above .zip file or tarball and check out the README file. Prerequisites for building the project from include GNU Make, the Java 8 SDK, and Apache Maven.

You can also simply download a prebuilt executable JAR file of the application and run it in the usual way (Java 8 required).

x-monotonicity

A polygon is said to be x-monotone if for any given vertical line on the plane, that polygon is intersected by that line at most twice. Fun fact: since monotonicity is defined with respect to a given axis, note that the example provided below is not y-monotone. If we were to run the algorithm from, for example, top-to-bottom instead of left-to-right, we would require a y-monotone polygon.







As stated previously, this is a two phase algorithm. The second phase of the algorithm requires monotone polygons as input, so in the first phase we break down an arbitrary closed polygon into monotone polygons.





The process for doing this is by using a sweep-line algorithm with one event per polygon vertex. We literally sweep across the polygon and any time we "bump into" a vertex, we process the event at that vertex.

Vertex Types for Event Processing

image source: David Mount's Lecture Notes for Computational Geometry

Monotone Polygon Subdivision Algorithm

First, we define Fix-up(v,e) as follows: if helper(e) is a merge vertex, add a diagonal from v to helper(e).

Recall too that the event vertices are in a list sorted by x-coordinate.

For each event vertex, v:

* This detail was missing from the algorithm source, but is crucial for the algorithm to function correctly
Algorithm source: David Mount's Lecture Notes for Computational Geometry.

Event Types for Polygon Triangulation

Now that we have subdivided our polygon into monotone polygons, we can use the next phase of the algorithm to triangulate each polygon individually! Much like with our previous sweep-line algorithm, there is only one event per polygon vertex, and they are sorted from left-to-right by x-coordinate. The event type for this algorithm is a little simpler, but like the previous algorithm corresponds to the vertex's location on the polygon:

Monotone Polygon Triangulation

A given vertex on a monotone polygonal curve is said to be a "reflex" vertex if its interior angle is greater than π.





For each vertex following the leftmost vertex, let vi be that vertex and let vi-1 be the vertex associated with the previous event. We maintain a stack uf untriangulated vertices.


Previous        Next