Skip to main content

build_pcurve_on_surface_range_dense

Function build_pcurve_on_surface_range_dense 

Source
pub fn build_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<NurbsCurve, String>
Expand description

Range fitter with explicit sampling knobs. The default entry above keeps the long-standing (base 64, 3 refinement rounds, 513 cap) budget.

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.