Skip to main content

fit_pcurve_on_surface_range_dense

Function fit_pcurve_on_surface_range_dense 

Source
pub fn fit_pcurve_on_surface_range_dense(
    surface: &NurbsSurface,
    curve: &NurbsCurve,
    edge_start: f64,
    edge_end: f64,
    forward: bool,
    tolerance: f64,
    base_samples: usize,
    refinement_rounds: usize,
    parameter_cap: usize,
) -> Result<PcurveFit, String>
Expand description

Range fitter with explicit sampling knobs, reporting what the fit achieved. fit_pcurve_on_surface_range keeps the long-standing (base 64, 3 refinement rounds, 513 cap) budget; a fit that binds at that cap with the bar unmet grows once to PCURVE_RAISED_SAMPLES (fit_pcurve_on_surface_stations).

NOTE (2026-09-03): this comment used to say “STEP import retries failed fits with a denser budget”. No caller passes these knobs any more — that retry was removed and the sentence outlived it. The knobs are kept because they are the honest way to ASK whether a fit had headroom left, which is what examples/pcurve_residual_probe.rs uses them for: on every ABC corpus coedge that failed validate’s pcurve check, budgets up to (512, 8, 8193) with a 1000x tighter target reproduced the coarse fit’s deviation to six decimals, because that deviation is the edge-vs-surface closest-point residual and a curve ON the surface cannot beat it.