Skip to main content

Tolerances

Struct Tolerances 

Source
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

Source

pub const fn millimetres() -> Self

Tolerances for a model whose unit is one millimetre.

Source

pub const fn metres() -> Self

Tolerances for a model whose unit is one metre.

Source

pub const fn inches() -> Self

Tolerances for a model whose unit is one inch.

Source

pub fn with_scale(mm_per_unit: f64) -> OgeomResult<Self>

Tolerances for a model whose unit is mm_per_unit millimetres.

§Errors

OgeomError::Construction if the scale is not finite and positive.

Source

pub const fn scale(self) -> f64

Millimetres per model unit.

Source

pub fn confusion(self) -> f64

Distance below which two points are the same point.

Source

pub const fn angular(self) -> f64

Angle below which two directions are parallel. Independent of scale.

Source

pub fn intersection(self) -> f64

Convergence target for intersection algorithms.

Source

pub fn approximation(self) -> f64

Accuracy target when fitting curves and surfaces.

Source

pub const fn parametric(self) -> f64

Confusion in parametric space. Independent of scale.

Source

pub fn degenerate(self) -> f64

Length below which an entity is degenerate.

Source

pub fn same_length(self, a: f64, b: f64) -> bool

Whether two lengths are indistinguishable.

Source

pub fn same_parameter(self, a: f64, b: f64) -> bool

Whether two parameters are indistinguishable.

Trait Implementations§

Source§

impl Clone for Tolerances

Source§

fn clone(&self) -> Tolerances

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Tolerances

Source§

impl Debug for Tolerances

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Tolerances

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Tolerances

Source§

fn eq(&self, other: &Tolerances) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Tolerances

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.