public class PolygonTriangulator extends Object
Geometry.
A polygon triangulation is a non-overlapping set of triangles which
cover the polygon and have the same vertices as the polygon.
The priority is on performance rather than triangulation quality,
so that the output may contain many narrow triangles.
Holes are handled by joining them to the shell to form a (self-touching) polygon shell with no holes. Although invalid, this can be triangulated effectively.
For better-quality triangulation use ConstrainedDelaunayTriangulator.
ConstrainedDelaunayTriangulator| Constructor and Description |
|---|
PolygonTriangulator(Geometry inputGeom)
Constructs a new triangulator.
|
| Modifier and Type | Method and Description |
|---|---|
Geometry |
getResult()
Gets the triangulation as a
GeometryCollection of triangular Polygons. |
List<Tri> |
getTriangles()
Gets the triangulation as a list of
Tris. |
static Geometry |
triangulate(Geometry geom)
Computes a triangulation of each polygon in a geometry.
|
public PolygonTriangulator(Geometry inputGeom)
inputGeom - the input geometrypublic static Geometry triangulate(Geometry geom)
geom - a geometry containing polygonspublic Geometry getResult()
GeometryCollection of triangular Polygons.Copyright © 2024. All rights reserved.