pub struct PcurveFitReport {
pub residual: f64,
pub floor: f64,
pub samples: usize,
pub exit: PcurveFitExit,
pub off_surface: f64,
pub raised: bool,
pub clamped_excursion: f64,
pub clamped_distance: f64,
}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.
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.
clamped_excursion: f64Largest parameter distance a station’s inversion was pulled back into
an OPEN direction’s domain when the returned curve was interpolated: a
trim asked for outside its chart is folded onto the chart’s boundary,
the edge stays right and the face becomes the wrong region on a body
validate() passes (3.03e-2 of volume on the rib-base document). Zero
when nothing was pulled. A REPORT, not a bar: nothing here refuses on
it. Its coverage is the clamp in build_interpolant, which is the only
place a raw out-of-domain parameter reaches today — an affine carrier’s
inversion is unclamped, so an affine plane fitted through the station
lane reads here. It does NOT see a clamp the projector applied before
the fit: the analytic Plane closed form (a non-affine net) clamps to
its domain, RuledRevolution clamps its axial parameter to [0, 1]
and the general Newton clamps through fit_parameter; those stations
arrive in-domain and read as off_surface instead. The exact affine
lanes (fit_pcurve_on_surface on an affine carrier,
affine_pcurve_on_range) never clamp and read zero by construction.
clamped_distance: f64The 3D distance the clamp corresponds to: between the extended surface at the raw parameter and the clamped foot, at the station of the largest such distance. Zero when nothing was pulled.
Implementations§
Source§impl PcurveFitReport
impl PcurveFitReport
Sourcepub fn on_bar(&self) -> bool
pub fn on_bar(&self) -> bool
Whether the returned curve is on the ACCEPTANCE BAR: the floor it was asked for, plus the stations’ own standoff from the carrier.
A pcurve’s image lies on the carrier, so at a station standing g off
it no image can come closer than g; a fit whose residual is within
the floor of off_surface is as good as the input allows, and one over
it is worse than its input — the same condition [refine_pcurve] uses
to decide that a raise can still buy accuracy. This is the bar every
station builder refuses over (build_pcurve_on_surface_stations).
It is blind to sideways error quadratically (a station tracked d
aside of the projection of a point g off the surface reads only
d²/(2g) further away), which is stated rather than hidden: on the
import corpus the stations that stand off their carriers are the
FILE’s curves, and the bar there is the file’s own number.