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
impl Tolerance
pub const RELATIVE: f64 = 9.9999999999999995E-7f64
pub const ANGULAR: f64 = 9.9999999999999995E-7f64
pub const APPROXIMATION: f64 = 0.001f64
pub const PRECISION: i32 = 3i32
pub const LINEARDEFLECTION: f64 = 0.001f64
pub const ANGULARDEFLECTION: f64 = 0.10000000000000001f64
Sourcepub const ANGLE_TOLERANCE_DEGREES: f64 = 0.11f64
pub const ANGLE_TOLERANCE_DEGREES: f64 = 0.11f64
Angle tolerance in degrees
Sourcepub const ZERO_TOLERANCE: f64 = 9.9999999999999998E-13f64
pub const ZERO_TOLERANCE: f64 = 9.9999999999999998E-13f64
Zero tolerance for comparisons
pub fn new(unit: &str) -> Self
pub fn reset(&mut self)
pub fn absolute(&self) -> f64
pub fn set_absolute(&mut self, value: f64)
pub fn relative(&self) -> f64
pub fn set_relative(&mut self, value: f64)
pub fn angular(&self) -> f64
pub fn set_angular(&mut self, value: f64)
pub fn approximation(&self) -> f64
pub fn set_approximation(&mut self, value: f64)
pub fn precision(&self) -> i32
pub fn set_precision(&mut self, value: i32)
pub fn lineardeflection(&self) -> f64
pub fn set_lineardeflection(&mut self, value: f64)
pub fn angulardeflection(&self) -> f64
pub fn set_angulardeflection(&mut self, value: f64)
pub fn tolerance(&self, truevalue: f64, rtol: f64, atol: f64) -> f64
pub fn compare(&self, a: f64, b: f64, rtol: f64, atol: f64) -> bool
pub fn is_zero(&self, a: f64, tol: Option<f64>) -> bool
pub fn is_positive(&self, a: f64, tol: Option<f64>) -> bool
pub fn is_negative(&self, a: f64, tol: Option<f64>) -> bool
pub fn is_between( &self, value: f64, minval: f64, maxval: f64, atol: Option<f64>, ) -> bool
pub fn is_close( &self, a: f64, b: f64, rtol: Option<f64>, atol: Option<f64>, ) -> bool
pub fn is_allclose( &self, a: &[f64], b: &[f64], rtol: Option<f64>, atol: Option<f64>, ) -> bool
pub fn is_angle_zero(&self, a: f64, tol: Option<f64>) -> bool
pub fn is_angles_close(&self, a: f64, b: f64, tol: Option<f64>) -> bool
pub fn geometric_key(&self, xyz: [f64; 3], precision: Option<i32>) -> String
pub fn geometric_key_xy(&self, xy: [f64; 2], precision: Option<i32>) -> String
pub fn format_number(&self, number: f64, precision: Option<i32>) -> String
pub fn precision_from_tolerance(&self, tol: Option<f64>) -> i32
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tolerance
impl<'de> Deserialize<'de> for Tolerance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Tolerance
impl RefUnwindSafe for Tolerance
impl Send for Tolerance
impl Sync for Tolerance
impl Unpin for Tolerance
impl UnwindSafe for Tolerance
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
Mutably borrows from an owned value. Read more