pub struct KernelTolerances {
pub convergence: f64,
pub model: f64,
pub intersection_fit: f64,
pub pcurve_consistency: f64,
pub export_knit: f64,
pub sew_search: f64,
pub sliver: f64,
pub angular: f64,
}Expand description
Ordered accuracy targets plus deliberately separate geometric search radii.
Search tolerances answer “which entities might match?”. Accuracy tolerances answer “how closely must committed geometry agree?”. Keeping those questions separate prevents a generous sewing search radius from becoming the accuracy of the exported BREP.
Fields§
§convergence: f64Iterative projection/refinement convergence target.
model: f64Vertex identity and exact topological coincidence tolerance.
intersection_fit: f64Maximum geometric error accepted while fitting SSI curves.
pcurve_consistency: f64Maximum edge/pcurve/carrier disagreement in a valid in-memory BREP.
export_knit: f64Output edge-to-carrier contract used before STEP serialization.
sew_search: f64Candidate radius used while looking for endpoints or edges to weld.
sliver: f64Features shorter than this are candidates for explicit sliver repair.
angular: f64Angular tolerance in radians.
Implementations§
Source§impl KernelTolerances
impl KernelTolerances
Sourcepub fn for_scale(scale: f64, model: f64) -> Self
pub fn for_scale(scale: f64, model: f64) -> Self
Construct a scale-aware policy while preserving the historical model identity tolerance used by the public API.
The base spatial identity tolerance model is deliberately NOT coupled
to part size here: coupling it was tried and rejected because model
also feeds fit-accuracy fields (intersection_fit, sew_search), so
scaling it degrades SSI curve fitting on ordinary parts and produces
invalid boolean topology (see revolve_pole_union_fixture). Identity
bands that legitimately scale with size are size-coupled per site via
KernelTolerances::heal_band instead, leaving fit accuracy tight.
pub fn for_solid(solid: &BrepSolid, model: f64) -> Self
pub fn for_pair(first: &BrepSolid, second: &BrepSolid, model: f64) -> Self
Sourcepub fn check(&self) -> Result<(), String>
pub fn check(&self) -> Result<(), String>
Reject policies whose accuracy ladder is inverted or whose search radii cannot even find model-identical entities.
Sourcepub fn spatial(&self) -> f64
pub fn spatial(&self) -> f64
Canonical accessor for the single spatial tolerance x (Golovanov
§4.13). model is that x: the base identity/coincidence band from
which parametric, search, and healing tolerances are derived. Call
sites should prefer this over reaching for .model directly so intent
(the ONE spatial tolerance) reads clearly and later levers have a single
seam to evolve.
Sourcepub fn heal_band(&self, diagonal: f64, k: f64) -> f64
pub fn heal_band(&self, diagonal: f64, k: f64) -> f64
Size-coupled healing/identity band: the base spatial tolerance floored
by a fraction k of the caller’s local diagonal. This is the ONE
charter helper for the max(model, diagonal * k) pattern that healing
and identity sites otherwise hand-roll (e.g. classification’s
near-coincidence probe (model * 10).max(diagonal * 1e-7)), so a
size-relative band is derived from x in a single place instead of
re-hardcoded per call site (Golovanov §4.13). Coupling the band HERE —
at the identity/weld/heal site, taking diagonal explicitly — gives big
parts a proportionally wider identity band WITHOUT inflating the global
model or the fit-accuracy path (intersection_fit, the marcher).
k is a dimensionless part-per-diagonal factor; diagonal is the local
extent the band should scale with.
Sourcepub fn pcurve_acceptance(&self, diagonal: f64) -> f64
pub fn pcurve_acceptance(&self, diagonal: f64) -> f64
Size-coupled acceptance ceiling for the edge-vs-pcurve COINCIDENCE check
in BrepSolid::validate: “does this coedge’s curve-on-surface, pushed
back to 3D, still trace the same locus as the edge’s 3D curve?”
This is an IDENTITY/coincidence band (are the two representations the
SAME edge?), not a fit-accuracy target, so per this module’s taxonomy it
MAY — and, for imported geometry, MUST — size-couple with the part: a
vendor STEP file routinely commits an edge’s 3D curve and its face
surface as INDEPENDENT approximations that disagree by a small fraction
of the model, and (like Parasolid/OCC, which absorb the gap in a widened
per-edge tolerance) a coincidence band floored to a tight ABSOLUTE
pcurve_consistency wrongly rejects such a shared edge on a sub-unit
part. The gap is intrinsic to the vendor data (it is the closest-point
residual of the edge against the surface, so no pcurve fit can beat it),
and the edge is SHARED — snapping it onto one face’s surface only pushes
it off the neighbour’s — so accepting the size-relative gap is the
faithful, non-destructive resolution.
Coupling lives HERE (taking the model diagonal explicitly, floored by
the tight pcurve_consistency) exactly like KernelTolerances::heal_band,
so the fit target and the STEP-import edge-reconcile screen — which read
the raw pcurve_consistency FIELD — stay tight and are NOT relaxed by
this validator-only ceiling. PCURVE_ACCEPTANCE_REL (2.5% of the model
diagonal) sits above the vendor near-miss this admits (~2% of the
diagonal on ABC 00000041) yet far below the many-percent excursion a
genuinely wrong carrier or branch-jumped pcurve produces, so real breakage
is still refused.
Trait Implementations§
Source§impl Clone for KernelTolerances
impl Clone for KernelTolerances
Source§fn clone(&self) -> KernelTolerances
fn clone(&self) -> KernelTolerances
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more