#[non_exhaustive]pub enum TriangulationError {
Show 13 variants
TooFewPoints,
AllPointsCollinear,
VertexUnplaceable {
index: u32,
},
ConstraintOutOfRange {
index: u32,
},
CrossingConstraints {
a: u32,
b: u32,
},
CoincidentConstraint {
a: u32,
b: u32,
},
RingOutOfRange {
ring: u32,
index: u32,
},
TooFewRingVertices {
ring: u32,
},
RepeatedRingVertex {
ring: u32,
index: u32,
},
FoldedRing {
ring: u32,
index: u32,
},
MisnestedRing {
ring: u32,
winding: i32,
},
EmptyDomain,
NonFinitePoint {
index: 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
Two constraint pieces cross; a constraint is split at the vertices on it first.
Only reachable when two constraints cross at a point that is no input vertex: 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. A constraint that runs through input vertices, or ends on another constraint, is not a crossing.
CoincidentConstraint
A constraint joins two input points at exactly the same position.
Coincident points are merged into one vertex, so the constraint would be an edge from that vertex to itself. Reported rather than dropped: a caller who asked for an edge between two distinct indices has two points where they meant one, or one where they meant two.
RingOutOfRange
A ring referenced a vertex index that does not exist.
TooFewRingVertices
A ring has fewer than three vertices, so it encloses nothing.
RepeatedRingVertex
A ring visits the same vertex twice.
Two indices at one position count as one vertex, and so does repeating the first index at the end to close the ring: a ring is closed implicitly.
Fields
FoldedRing
A ring doubles back on itself at a vertex.
Both neighbours of the vertex lie on one side of it on a common line, so the ring has a zero-width spike (or no area at all) there.
Fields
MisnestedRing
The rings nest in a way that is neither inside nor outside: a region has a winding other than 0 or 1.
A hole outside every outer ring, a hole inside a hole, a hole listed
twice and an outer ring inside another all end here. Rings (or a
ring and itself) that cross between vertices are refused earlier, as
CrossingConstraints.
Fields
EmptyDomain
The rings enclose no triangle, so the domain is empty.
NonFinitePoint
An input point has a non-finite coordinate (NaN or infinite).
The orientation and incircle predicates are exact only for finite doubles; a non-finite one would read as exactly collinear and place a made-up edge, so the input is refused.
Trait Implementations§
Source§impl Clone for TriangulationError
impl Clone for TriangulationError
Source§fn clone(&self) -> TriangulationError
fn clone(&self) -> TriangulationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl 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()