pub struct Precision {
pub default_tolerance: f64,
pub min_tolerance: f64,
pub max_tolerance: f64,
pub angular_tolerance: f64,
pub parametric_tolerance: f64,
pub check_samples: usize,
}Expand description
The tolerance configuration of one model, set when the model is created
(docs/DATA-MODEL.md §Tolerances).
Arris carries no unit; Precision is what makes a model’s numbers
meaningful. Every tolerance an algorithm uses is an entity’s own or a
field of this struct — never a literal. The defaults are for a model
whose features are of order 1–1000 units; a consumer in metres sets
default_tolerance at the micrometre scale.
The fields are public: a Precision is plain configuration data, and
the checker’s V1/F2 rows (docs/DATA-MODEL.md §Invariants) hold every
entity to the bounds it states.
use arris_math::Precision;
let p = Precision { default_tolerance: 1e-6, ..Precision::DEFAULT };
assert!(p.min_tolerance <= p.default_tolerance);
assert!(p.default_tolerance <= p.max_tolerance);Fields§
§default_tolerance: f64The tolerance a primitive’s entities are created with. Two points closer than this are the same point.
min_tolerance: f64The floor: no entity carries a tolerance below it. It bounds how far an operation may tighten a tolerance and is the smallest distance the model distinguishes.
max_tolerance: f64The ceiling: an operation whose result would need an entity tolerance above it returns an error instead of a sloppy body.
angular_tolerance: f64Angle in radians below which two directions are parallel and two surfaces are tangent.
parametric_tolerance: f64How far a pcurve may deviate in (u, v), at unit parametric speed —
on a surface where one unit of parameter is one unit of length. The
checker scales it by the surface’s parametric derivative, so on a
cylinder of radius r the bound in u is this divided by r.
check_samples: usizeHow many parameters the checker samples along an edge when it compares a pcurve’s image against the 3D curve (invariant E4), both ends included.
Implementations§
Source§impl Precision
impl Precision
Sourcepub const DEFAULT: Precision
pub const DEFAULT: Precision
The defaults, as a constant so they can be spread into a struct
literal. Values: default_tolerance 1e-7 (Open CASCADE’s
Precision::Confusion, so the oracle and Arris merge the same
points), min_tolerance 1e-12, max_tolerance 1e-2,
angular_tolerance 1e-12 (Open CASCADE’s Precision::Angular),
parametric_tolerance 1e-7, check_samples 23 (the sample count of
Open CASCADE’s edge check, so an edge the oracle accepts is sampled
at least as finely here).
Sourcepub fn is_consistent(&self) -> bool
pub fn is_consistent(&self) -> bool
true when the fields are finite, positive and ordered
(min_tolerance ≤ default_tolerance ≤ max_tolerance) and there is at
least one sample; a Precision that fails this is rejected when a
model is created.
Trait Implementations§
impl Copy for Precision
impl StructuralPartialEq for Precision
Auto Trait Implementations§
impl Freeze for Precision
impl RefUnwindSafe for Precision
impl Send for Precision
impl Sync for Precision
impl Unpin for Precision
impl UnsafeUnpin for Precision
impl UnwindSafe for Precision
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.