pub enum ClosureReading {
Measured {
residual: f64,
bar: f64,
spans: usize,
at_depth_limit: usize,
},
Unmeasured {
reason: &'static str,
spans: usize,
faces_read: usize,
faces: usize,
},
Open {
residual: f64,
faces: usize,
},
}Expand description
What a shell’s closure scan came back with — a measurement, or nothing.
The reason this is a type rather than a float: NaN is a value, and a value
gets folded into a comparison. ShellVectorArea::is_over_bar is
residual() > bar, and NaN > bar is FALSE, so a shell the scan gave up on
reads exactly like a shell that closed — the worst possible answer, since the
scan gave up on the bodies whose geometry is hardest. A caller that matches on
this cannot make that mistake without writing the arm.
Variants§
Measured
The trims were integrated to the end. at_depth_limit spans were
accepted at the bisection’s depth limit rather than because they
converged; their last difference is inside quadrature_error either way.
Unmeasured
No residual exists for this shell: the scan stopped before it had read every face, and a partial sum of a boundary integral is not a smaller version of the answer.
Open
An OPEN shell is not judged by this check at all: Σ ∫ n dA = 0 is a
statement about a closed one, and an open shell’s residual is its own
boundary’s vector area, which is a fact about the sheet.