pub struct Tolerances { /* private fields */ }Expand description
The threshold constants the kernel decides identity by, for a given model scale.
linear_scale is the length of one model unit in millimetres: 1.0 for a
model in millimetres, 1000.0 for metres, 25.4 for inches. Linear
tolerances scale with it. Angular and parametric ones do not.
Implementations§
Source§impl Tolerances
impl Tolerances
Sourcepub const fn millimetres() -> Self
pub const fn millimetres() -> Self
Tolerances for a model whose unit is one millimetre.
Sourcepub fn with_scale(mm_per_unit: f64) -> OgeomResult<Self>
pub fn with_scale(mm_per_unit: f64) -> OgeomResult<Self>
Tolerances for a model whose unit is mm_per_unit millimetres.
Every linear tolerance derived from the scale, and its square, must be
a normal f64: comparisons are made both on distances and on squared
distances, and an infinite, zero or subnormal threshold would decide
them by overflow or underflow. That accepts scales from about 7.5e-161
to about 6.7e144 millimetres per unit.
§Errors
OgeomError::Construction if the scale is
not finite and positive, or is outside that range.
Sourcepub const fn angular(self) -> f64
pub const fn angular(self) -> f64
Angle below which two directions are parallel. Independent of scale.
Sourcepub fn intersection(self) -> f64
pub fn intersection(self) -> f64
Convergence target for intersection algorithms.
Sourcepub fn approximation(self) -> f64
pub fn approximation(self) -> f64
Accuracy target when fitting curves and surfaces.
Sourcepub const fn parametric(self) -> f64
pub const fn parametric(self) -> f64
Confusion in parametric space. Independent of scale.
Sourcepub fn degenerate(self) -> f64
pub fn degenerate(self) -> f64
Length below which an entity is degenerate.
Sourcepub fn same_length(self, a: f64, b: f64) -> bool
pub fn same_length(self, a: f64, b: f64) -> bool
Whether two lengths are indistinguishable.
Sourcepub fn same_parameter(self, a: f64, b: f64) -> bool
pub fn same_parameter(self, a: f64, b: f64) -> bool
Whether two parameters are indistinguishable.