Skip to main content

triangulate_earcut

Function triangulate_earcut 

Source
pub fn triangulate_earcut<Pg, P>(polygon: &Pg) -> Vec<Polygon<P>>
where Pg: Polygon<Point = P>, P: Point<Scalar = f64> + Copy, P::Cs: CoordinateSystem, <P::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
Expand description

Triangulate a Cartesian polygon into owned clockwise, closed stock polygons.

Degenerate rings and interiors that cannot be bridged into the exterior return an empty vector. Every returned polygon has exactly three distinct vertices plus the closing duplicate.