pub struct R3 {
pub x: Rational,
pub y: Rational,
pub z: Rational,
}Expand description
Exact 3D point (or vector). Derived Ord is lexicographic (x, y, z) for
exact vertex welding in output assembly.
Fields§
§x: Rational§y: Rational§z: RationalImplementations§
Source§impl R3
impl R3
pub fn new(x: Rational, y: Rational, z: Rational) -> Self
pub fn from_vec3(v: Vec3) -> Self
pub fn to_vec3_rounded(&self) -> Vec3
pub fn sub(&self, o: &R3) -> R3
pub fn add(&self, o: &R3) -> R3
pub fn scale(&self, s: &Rational) -> R3
pub fn dot(&self, o: &R3) -> Rational
pub fn cross(&self, o: &R3) -> R3
pub fn is_zero(&self) -> bool
Sourcepub fn project_drop(&self, axis: usize) -> R2
pub fn project_drop(&self, axis: usize) -> R2
Drop the coordinate at axis (0=x, 1=y, 2=z), keeping the other two
in cyclic order — the paper’s bijective dominant-axis projection used
to embed per-triangle 2D arrangements.
Trait Implementations§
impl Eq for R3
Source§impl Ord for R3
impl Ord for R3
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for R3
impl PartialOrd for R3
impl StructuralPartialEq for R3
Auto Trait Implementations§
impl Freeze for R3
impl RefUnwindSafe for R3
impl Send for R3
impl Sync for R3
impl Unpin for R3
impl UnsafeUnpin for R3
impl UnwindSafe for R3
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