#[non_exhaustive]pub enum TriangulationError {
TooFewPoints,
AllPointsCollinear,
VertexUnplaceable {
index: u32,
},
ConstraintOutOfRange {
index: u32,
},
CrossingConstraints {
a: u32,
b: u32,
},
}Expand description
Why a triangulation could not be produced.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooFewPoints
Fewer than three points were supplied, so no triangle exists.
AllPointsCollinear
Every input point is collinear, so the triangulation has zero area.
Reported rather than returning an empty triangulation: a caller that asked to triangulate a degenerate polygon has a bug upstream, and an empty result would hide it.
VertexUnplaceable
A vertex could not be placed in any triangle during insertion.
Indicates a corrupted adjacency rather than bad input. Reported so a missing vertex surfaces as an error instead of as a silent hole in an otherwise valid-looking mesh.
ConstraintOutOfRange
A constraint referenced a vertex index that does not exist.
CrossingConstraints
A constraint could not be recovered after insertion.
Only reachable when two constraints cross: an edge cannot survive if another required edge passes through it. The crossing point would have to be inserted as a vertex, which changes the caller’s input, so this is reported instead of silently repaired.
Trait Implementations§
Source§impl Clone for TriangulationError
impl Clone for TriangulationError
Source§fn clone(&self) -> TriangulationError
fn clone(&self) -> TriangulationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more