#[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
impl Copy for TriangulationError
Source§impl Debug for TriangulationError
impl Debug for TriangulationError
Source§impl Display for TriangulationError
impl Display for TriangulationError
impl Eq for TriangulationError
Source§impl Error for TriangulationError
impl Error for TriangulationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()