Skip to main content

Plane

Enum Plane 

Source
pub enum Plane {
    XY,
    XZ,
    YZ,
}
Expand description

Axis aligned planes, used to describe how imported ‘flat’ data is arranged in space

Variants§

§

XY

§

XZ

§

YZ

Implementations§

Source§

impl Plane

Source

pub fn point_to_3d<T: GenericVector3>(&self, point: T::Vector2) -> T

Copy this Point2 into a Point3, populating the axes defined by ‘plane’ Plane::XY: Point2(AB) -> Point3(AB0) Plane::XZ: Point2(AB) -> Point3(A0B) Plane::YZ: Point2(AB) -> Point3(0BA)

Source

pub fn point_to_2d<T: GenericVector3>(&self, point: T) -> T::Vector2

Copy this Point3 into a Point2, populating the axes defined by ‘plane’ Plane::XY: Point3(ABC) -> Point2(AB) Plane::XZ: Point3(ABC) -> Point2(AC) Plane::YZ: Point3(ABC) -> Point2(CB)

Source

pub fn points_to_3d<'a, T: GenericVector3 + 'a, I>( &self, iter: I, ) -> impl Iterator<Item = T> + 'a
where I: IntoIterator + 'a, I::Item: Borrow<T::Vector2>, <T as GenericVector3>::Vector2: 'a + ToOwned<Owned = T::Vector2>,

Convert an iterator of 2D points into 3D points based on the plane. This works like .map(), but optimized for the plane. Plane::XY: Point2(AB) -> Point3(AB0) Plane::XZ: Point2(AB) -> Point3(A0B) Plane::YZ: Point2(AB) -> Point3(0BA)

Source

pub fn points_to_2d<'a, T: GenericVector2 + 'a, I>( &self, iter: I, ) -> impl Iterator<Item = T> + 'a
where I: IntoIterator + 'a, I::Item: Borrow<T::Vector3>, <T as GenericVector2>::Vector3: 'a + ToOwned<Owned = T::Vector3>,

Convert an iterator of 3D points into 2D points based on the plane. This works like .map(), but optimized for the plane. Plane::XY: Point3(ABC) -> Point2(AB) Plane::XZ: Point3(ABC) -> Point2(AC) Plane::YZ: Point3(ABC) -> Point2(CB)

Trait Implementations§

Source§

impl Clone for Plane

Source§

fn clone(&self) -> Plane

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 Plane

Source§

impl Debug for Plane

Source§

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

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

impl Eq for Plane

Source§

impl PartialEq for Plane

Source§

fn eq(&self, other: &Plane) -> 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 Plane

Auto Trait Implementations§

§

impl Freeze for Plane

§

impl RefUnwindSafe for Plane

§

impl Send for Plane

§

impl Sync for Plane

§

impl Unpin for Plane

§

impl UnsafeUnpin for Plane

§

impl UnwindSafe for Plane

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.