Skip to main content

trim_sample_count

Function trim_sample_count 

Source
pub fn trim_sample_count(curve: &NurbsCurve) -> usize
Expand description

How many chords the containment lanes sample ONE pcurve at: max(2, (k + 1)(p + 1)·4), k the pcurve’s distinct interior knots (two knots are one when they differ by no more than KNOT_DEDUP_EPS, and a knot that close to an end of the active domain is not interior) and p its degree. Knot- and degree-aware, so a spline trim is resolved wherever its shape can bend and a line is two chords.

Nothing compares the count; it IS the polygon parameter_point_in_face classifies against. The generic scan, the wrapped-horizon, sphere-cap and covering-rim-strip lanes sample every pcurve at trim_station(start, end, i, count) for i in 0..count (the rim strip 0..=count), the pcurve’s domain being [start, end].

Published rather than copied: crate::loop_self_crossings and the soundness detectors test EXACTLY these chords, or the kernel could hold that a loop does not cross itself while classifying points against a polygon that does; and a caller that answers containment questions ahead of the kernel (the sheets’ hidden-line pass) must build its polygon from the same stations, or it stops answering as the kernel does.