pub struct PcurveFitReport {
pub residual: f64,
pub floor: f64,
pub samples: usize,
pub exit: PcurveFitExit,
pub off_surface: f64,
pub raised: bool,
}Expand description
What a pcurve fit ACHIEVED, returned beside the curve so a ceiling exit can never be mistaken for a met floor.
fit_pcurve_on_surface asks for [PCURVE_REFINEMENT_TOLERANCE] and stops
at [MAX_PCURVE_SAMPLES] — or, where that ceiling bound and the floor is
reachable, at [PCURVE_RAISED_SAMPLES]. Until 2026-09-12 a trim that ran
out of samples came back exactly like one that met the floor; on
boolean_fuzz_corpus/25_cube_pierce_solid that silence hid a 1.65e-3 volume
error. Now every fit says which it was: residual is measured on the curve
that is actually returned and exit names why refinement stopped.
This is a MEASUREMENT taken at a construction, not a band. Per invariant I1
of per-entity-tolerances.md nothing may read it as the acceptance
tolerance of the very curve it describes; its consumers are the
PcurveFitLedger (operation diagnostics) and the per-trim budget
decision inside [refine_pcurve], which reads off_surface — a property
of the INPUT, not of the returned curve — to decide whether a raise can
help.
Fields§
§residual: f64Largest 3D distance between the returned pcurve’s image on the surface
and the edge curve. On a PcurveFitExit::Converged exit whose final
round probed every span this is that round’s maximum — the refinement’s
own acceptance test. On every other exit, including a converged round
that skipped spans narrower than 1e-3 of the parameter range, it is a
sweep over EVERY span of the returned curve.
floor: f64The residual the refinement was asked to reach.
samples: usizeInterpolation samples in the returned curve.
exit: PcurveFitExitWhy refinement stopped.
off_surface: f64Largest distance from the edge curve to the surface at every station
the fit inverted — the part of residual no pcurve can remove, since a
pcurve’s image lies ON the surface. Zero for an affine carrier. A value
above floor says the floor is unreachable for this input; a ceiling
exit is retried only while residual exceeds it by more than the floor,
i.e. while the returned curve is worse than its input.
raised: boolWhether the fit re-entered refinement with [PCURVE_RAISED_SAMPLES]
after [MAX_PCURVE_SAMPLES] bound with the floor unmet.