object Triangulator
signedArea
(
points
)
|
Computes the signed area of a polygon using the shoelace formula. Positive = CCW.
Signature
fun signedArea(points: List<Point2D>): Float Parameters points: ListReturns Float |
triangulate
(
outer
, holes
)
|
Triangulates a polygon that may contain holes.
The outer boundary and holes are pre-classified by the caller (typically using the even-odd fill rule). Winding is auto-corrected internally.
Signature
fun triangulate(outer: List<Point2D>, holes: List<List<Point2D>> = emptyList()): TriangulationResult Parameters outer: List
Vertices of the outer boundary
holes: List
List of hole boundaries (inner contours)
Returns TriangulationResult
Merged vertex list and triangle index triplets. Indices reference positions in the merged list (outer vertices first, then hole vertices in order).
|