Skip to main content

MeshPrecision

Trait MeshPrecision 

Source
pub trait MeshPrecision: Copy + Default {
    const IS_SINGLE: bool;

    // Required methods
    fn to_f64(self) -> f64;
    fn from_f64(v: f64) -> Self;
}
Expand description

Precision parameter of a MeshGLP (f32 or f64). Mirrors the Precision template parameter of the C++ MeshGLP: conversions to and from the kernel’s internal f64 happen through this trait, so the f32 instantiation narrows exactly where the C++ float instantiation does and the f64 instantiation is lossless end to end.

Required Associated Constants§

Source

const IS_SINGLE: bool

True for f32. The exported tolerance is floored at f32::EPSILON * bbox.scale() only for single precision, matching the std::is_same<Precision, float> checks in the C++ template.

Required Methods§

Source

fn to_f64(self) -> f64

Source

fn from_f64(v: f64) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MeshPrecision for f32

Source§

const IS_SINGLE: bool = true

Source§

fn to_f64(self) -> f64

Source§

fn from_f64(v: f64) -> Self

Source§

impl MeshPrecision for f64

Source§

const IS_SINGLE: bool = false

Source§

fn to_f64(self) -> f64

Source§

fn from_f64(v: f64) -> Self

Implementors§