pub struct Frame3 {
pub origin: Point3,
pub x: Vec3,
pub y: Vec3,
pub z: Vec3,
}Expand description
An orthonormal reference frame: origin + three mutually perpendicular unit
axes (x, y, z).
The z axis is the primary direction (surface normal, curve axis, etc.).
x and y span the plane perpendicular to z.
Fields§
§origin: Point3Frame origin.
x: Vec3First axis in the perpendicular plane.
y: Vec3Second axis in the perpendicular plane.
z: Vec3Primary axis / normal.
Implementations§
Source§impl Frame3
impl Frame3
Sourcepub fn from_normal(origin: Point3, normal: Vec3) -> Result<Self, MathError>
pub fn from_normal(origin: Point3, normal: Vec3) -> Result<Self, MathError>
Build an orthonormal frame from an origin and a primary axis (normal).
x and y are chosen arbitrarily in the plane perpendicular to z.
The input normal is normalized internally.
§Errors
Returns MathError::ZeroVector if normal is zero-length.
Sourcepub fn from_normal_and_ref(
origin: Point3,
normal: Vec3,
ref_dir: Vec3,
) -> Result<Self, MathError>
pub fn from_normal_and_ref( origin: Point3, normal: Vec3, ref_dir: Vec3, ) -> Result<Self, MathError>
Build an orthonormal frame from an origin, a primary axis, and a
preferred reference direction for x.
ref_dir is projected onto the plane perpendicular to z to produce
x. If ref_dir is (nearly) parallel to z, the frame falls back to
an arbitrary perpendicular choice.
§Errors
Returns MathError::ZeroVector if normal is zero-length.
Trait Implementations§
impl Copy for Frame3
impl StructuralPartialEq for Frame3
Auto Trait Implementations§
impl Forget for Frame3
impl Freeze for Frame3
impl Move for Frame3
impl RefUnwindSafe for Frame3
impl Send for Frame3
impl Sync for Frame3
impl Unpin for Frame3
impl UnsafeUnpin for Frame3
impl UnwindSafe for Frame3
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more