Package arc.math
Class EarClippingTriangulator
java.lang.Object
arc.math.EarClippingTriangulator
A simple implementation of the ear cutting algorithm to triangulate simple polygons without holes. For more information:
If the input polygon is not simple (self-intersects), there will be output but it is of unspecified quality (garbage in,
garbage out).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeTriangles
(float[] vertices) computeTriangles
(float[] vertices, int offset, int count) Triangulates the given (convex or concave) simple polygon to a list of triangle vertices.computeTriangles
(FloatSeq vertices)
-
Constructor Details
-
EarClippingTriangulator
public EarClippingTriangulator()
-
-
Method Details
-
computeTriangles
- See Also:
-
computeTriangles
- See Also:
-
computeTriangles
Triangulates the given (convex or concave) simple polygon to a list of triangle vertices.- Parameters:
vertices
- pairs describing vertices of the polygon, in either clockwise or counterclockwise order.- Returns:
- triples of triangle indices in clockwise order. Note the returned array is reused for later calls to the same method.
-