Skip to main content

triangulate

Function triangulate 

Source
pub fn triangulate(
    points: &[Point2],
    constraints: &[Constraint],
) -> Result<Triangulation, TriangulationError>
Expand description

Build a constrained Delaunay triangulation of points.

Every edge in constraints appears in the output as an edge of some triangle. Away from constraints the result satisfies the Delaunay empty-circumcircle property, decided exactly.

ยงErrors

Returns TriangulationError when the input has fewer than three points, a point with a non-finite coordinate, is entirely collinear, references a vertex that does not exist, has a constraint between two coincident points, or contains constraints that cross one another.

Exactly coincident points are merged into the lowest input index at their position and reported by Triangulation::merged_points; the triangles and Triangulation::constraints use the kept indices.