Struct Tolerance

Source
pub struct Tolerance {
    pub unit: String,
    absolute: Option<f64>,
    relative: Option<f64>,
    angular: Option<f64>,
    approximation: Option<f64>,
    precision: Option<i32>,
    lineardeflection: Option<f64>,
    angulardeflection: Option<f64>,
}
Expand description

Tolerance settings for geometric operations

Fields§

§unit: String§absolute: Option<f64>§relative: Option<f64>§angular: Option<f64>§approximation: Option<f64>§precision: Option<i32>§lineardeflection: Option<f64>§angulardeflection: Option<f64>

Implementations§

Source§

impl Tolerance

Source

pub const ABSOLUTE: f64 = 1.0000000000000001E-9f64

Default tolerance values

Source

pub const RELATIVE: f64 = 9.9999999999999995E-7f64

Source

pub const ANGULAR: f64 = 9.9999999999999995E-7f64

Source

pub const APPROXIMATION: f64 = 0.001f64

Source

pub const PRECISION: i32 = 3i32

Source

pub const LINEARDEFLECTION: f64 = 0.001f64

Source

pub const ANGULARDEFLECTION: f64 = 0.10000000000000001f64

Source

pub const ANGLE_TOLERANCE_DEGREES: f64 = 0.11f64

Angle tolerance in degrees

Source

pub const ZERO_TOLERANCE: f64 = 9.9999999999999998E-13f64

Zero tolerance for comparisons

Source

pub fn new(unit: &str) -> Self

Source

pub fn reset(&mut self)

Source

pub fn absolute(&self) -> f64

Source

pub fn set_absolute(&mut self, value: f64)

Source

pub fn relative(&self) -> f64

Source

pub fn set_relative(&mut self, value: f64)

Source

pub fn angular(&self) -> f64

Source

pub fn set_angular(&mut self, value: f64)

Source

pub fn approximation(&self) -> f64

Source

pub fn set_approximation(&mut self, value: f64)

Source

pub fn precision(&self) -> i32

Source

pub fn set_precision(&mut self, value: i32)

Source

pub fn lineardeflection(&self) -> f64

Source

pub fn set_lineardeflection(&mut self, value: f64)

Source

pub fn angulardeflection(&self) -> f64

Source

pub fn set_angulardeflection(&mut self, value: f64)

Source

pub fn tolerance(&self, truevalue: f64, rtol: f64, atol: f64) -> f64

Source

pub fn compare(&self, a: f64, b: f64, rtol: f64, atol: f64) -> bool

Source

pub fn is_zero(&self, a: f64, tol: Option<f64>) -> bool

Source

pub fn is_positive(&self, a: f64, tol: Option<f64>) -> bool

Source

pub fn is_negative(&self, a: f64, tol: Option<f64>) -> bool

Source

pub fn is_between( &self, value: f64, minval: f64, maxval: f64, atol: Option<f64>, ) -> bool

Source

pub fn is_close( &self, a: f64, b: f64, rtol: Option<f64>, atol: Option<f64>, ) -> bool

Source

pub fn is_allclose( &self, a: &[f64], b: &[f64], rtol: Option<f64>, atol: Option<f64>, ) -> bool

Source

pub fn is_angle_zero(&self, a: f64, tol: Option<f64>) -> bool

Source

pub fn is_angles_close(&self, a: f64, b: f64, tol: Option<f64>) -> bool

Source

pub fn geometric_key(&self, xyz: [f64; 3], precision: Option<i32>) -> String

Source

pub fn geometric_key_xy(&self, xy: [f64; 2], precision: Option<i32>) -> String

Source

pub fn format_number(&self, number: f64, precision: Option<i32>) -> String

Source

pub fn precision_from_tolerance(&self, tol: Option<f64>) -> i32

Trait Implementations§

Source§

impl Clone for Tolerance

Source§

fn clone(&self) -> Tolerance

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Tolerance

Source§

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

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

impl Default for Tolerance

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Tolerance

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Tolerance

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,