pub struct EntityTolerances<'s> { /* private fields */ }Expand description
Lazily-measured, capped per-entity tolerances for one solid.
Construct once per operation on the operand you are about to consume, ask for the entities you actually touch, and drop it with the operation. Each entity is measured at most once.
See the module documentation for the invariants; in particular a caller
takes max(its own global band, this), never this alone.
Implementations§
Source§impl<'s> EntityTolerances<'s>
impl<'s> EntityTolerances<'s>
Sourcepub fn for_solid(
solid: &'s BrepSolid,
policy: &KernelTolerances,
) -> EntityTolerances<'s>
pub fn for_solid( solid: &'s BrepSolid, policy: &KernelTolerances, ) -> EntityTolerances<'s>
A view over solid with policy’s spatial tolerance as the floor.
Sourcepub fn with_floor(solid: &'s BrepSolid, floor: f64) -> EntityTolerances<'s>
pub fn with_floor(solid: &'s BrepSolid, floor: f64) -> EntityTolerances<'s>
A view whose floor is given directly — for the several callers that
carry a bare tolerance: f64 rather than a whole policy.
Sourcepub fn edge(&mut self, id: u64) -> f64
pub fn edge(&mut self, id: u64) -> f64
The identity band for edge id: min(cap_E, max(floor, d_meas(E))).
Answers the floor for an unknown edge, an edge with no coedge, or a measurement that could not be taken — I2’s fail-safe direction. Never returns a non-finite or negative value.
Sourcepub fn vertex(&mut self, id: u64) -> f64
pub fn vertex(&mut self, id: u64) -> f64
The identity band for vertex id: min(cap_V, max(floor, g_meas(V))),
where g_meas is the largest gap between the vertex’s point and the
endpoints of the edges that claim it.
Sourcepub fn worst_edge(&mut self, ids: impl IntoIterator<Item = u64>) -> f64
pub fn worst_edge(&mut self, ids: impl IntoIterator<Item = u64>) -> f64
The largest edge band over ids — the band a decision that involves
several edges at once (a junction sitting where two boundary edges meet)
must respect, since it can be no more certain than its worst input.
Sourcepub fn floor(&self) -> f64
pub fn floor(&self) -> f64
The policy floor this view was built with — what every band degrades to.
Sourcepub fn measured_edge_deviation(&mut self, id: u64) -> Option<f64>
pub fn measured_edge_deviation(&mut self, id: u64) -> Option<f64>
The raw d_meas(E) for edge id: the largest 3D disagreement between
the edge’s curve and its pcurve images, over every coedge that
references it — UNCLAMPED, neither floored nor capped, so a defective
entity (measured above cap_E) reads as what it is rather than as the
cap. None for an unknown or degenerate edge, one no coedge
references, or one whose every measurement failed.
For REPORTING (the import’s stated-precision consistency check, a
census). It is never a band: the band is Self::edge, and nothing a
caller reads here may widen anything (I1/I2 in the module doc).
Sourcepub fn measured_vertex_gap(&mut self, id: u64) -> Option<f64>
pub fn measured_vertex_gap(&mut self, id: u64) -> Option<f64>
The raw g_meas(V) for vertex id: the largest gap between the
vertex’s point and the ends of the edge curves that claim it —
unclamped, as Self::measured_edge_deviation is for edges. None
for an unknown vertex or one no non-degenerate edge ends at.
On an imported solid this is the gap AFTER endpoint healing
(heal_imported_edge_endpoints), not the vendor’s raw miss.
Sourcepub fn edge_bound_under(&mut self, id: u64, ceiling: f64) -> bool
pub fn edge_bound_under(&mut self, id: u64, ceiling: f64) -> bool
cap_E = min(EDGE_CAP_FRACTION * len(E), PCURVE_ACCEPTANCE_REL * D).
AFFINE BAND BOUND (lane O row 25, 2026-10-29; on by default since the
batch 6 promotion, BREP_EDGE_BAND_AFFINE_BOUND=0 samples). An upper bound on what
Self::raw_edge would measure, without its sampling, when every use
of edge is a straight non-rational pcurve on a non-rational bilinear
patch and the edge is a straight non-rational segment; None otherwise.
Every sample measure_edge_against_pcurve_image takes, uniform,
subdivided or knot-span midpoint, reads d(f) = S(p(q0 + (q1 − q0) f)) − C(t(f)) at some f in [0, 1], with p and t affine in f. On a
bilinear patch S(p(f)) is quadratic in f with second coefficient
Δs Δr T (T the patch twist, Δs, Δr the pcurve’s normalised
extents), and C(t(f)) is affine, so |d(f)| ≤ max(|d(0)|, |d(1)|) + |Δs Δr T| / 4. A rounding allowance covers the evaluations. When this
bound is under half the floor, the measured worst is under the floor and
[clamp_band] returns the floor, the same band the sampling yields.
Whether edge id’s Self::affine_edge_bound is at most ceiling:
then every value the sampled measurement could return is at most
ceiling too. False with the switch off, for an unknown or degenerate
edge, and wherever the bound does not apply.