Skip to main content

EntityTolerances

Struct EntityTolerances 

Source
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>

Source

pub fn for_solid( solid: &'s BrepSolid, policy: &KernelTolerances, ) -> EntityTolerances<'s>

A view over solid with policy’s spatial tolerance as the floor.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn floor(&self) -> f64

The policy floor this view was built with — what every band degrades to.

Source

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).

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'s> !RefUnwindSafe for EntityTolerances<'s>

§

impl<'s> !Send for EntityTolerances<'s>

§

impl<'s> !Sync for EntityTolerances<'s>

§

impl<'s> !UnwindSafe for EntityTolerances<'s>

§

impl<'s> Forget for EntityTolerances<'s>

§

impl<'s> Freeze for EntityTolerances<'s>

§

impl<'s> Move for EntityTolerances<'s>

§

impl<'s> Unpin for EntityTolerances<'s>

§

impl<'s> UnsafeUnpin for EntityTolerances<'s>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more