Expand description
Checking a shape against the model’s invariants.
Everything in docs/DATA_MODEL.md that can be checked with geometry in
hand, checked in one place. The builders enforce what they can at the moment
of construction; this catches what only becomes wrong later: an edge whose
tolerance was widened past its face’s, a shell left open by an operation
that dropped a face, a pcurve that has stopped agreeing with its curve.
§It reports, it does not judge
The result is a list of what is wrong and where, not a boolean. A boolean
answers “should I panic”, which is never the question: an imported shape is
usually invalid in some specific, fixable way, and healing it needs to know
which way. A caller that only wants the boolean asks
Diagnosis::is_valid.
§Severity is not a comment
Severity::Broken means an algorithm reading this shape will get a wrong
answer rather than an error: an open shell has no inside, so every
containment test against it is a coin toss. Severity::Suspect means
something is out of order but every operation will still behave: a tolerance
larger than the feature it describes is alarming and not yet wrong.
The distinction is what lets a pipeline decide. Booleans refuse Broken
input because they would produce nonsense from it; they proceed on
Suspect because refusing would reject most real imported geometry.
Structs§
Enums§
- Severity
- How badly a problem breaks the shape.
Functions§
- check
- Check a shape and everything below it.
- check_
self_ intersection - Faces of one shape that reach each other without sharing topology: self-intersection, detected as the interference it is.
- check_
tessellation - Check that a shape’s tessellation agrees with its topology.
- restore_
containment - Restore tolerance containment below
shape: every edge widened to at least the faces it bounds, every vertex to at least the edges it bounds.