Skip to main content

triangulate_simple

Function triangulate_simple 

Source
pub fn triangulate_simple(ring: &[Point2]) -> GeomResult<Vec<[u32; 3]>>
Expand description

Triangulate a simple CCW polygon by ear clipping.

Returns index triples into ring. Fails rather than emitting a partial fan: a caller that receives triangles must be able to trust they cover the input.

ยงErrors

GeomError::InvalidInput for a NaN or infinite coordinate, which no orientation predicate can decide; GeomError::Degenerate for a ring that is too short, self-intersecting or without area.