pub struct Transform3D {
pub tx: f64,
pub ty: f64,
pub tz: f64,
pub rx: f64,
pub ry: f64,
pub rz: f64,
}Expand description
A 3D rigid transformation (rotation + translation).
Internally uses nalgebra Isometry3 with quaternion rotation
for gimbal-lock-free composition and inversion.
The representation stores translation (tx, ty, tz) and
Euler angles (roll, pitch, yaw) in radians for human readability.
§Euler Angle Convention
- Roll (rx): rotation about X axis
- Pitch (ry): rotation about Y axis
- Yaw (rz): rotation about Z axis
Composition order: Rz * Ry * Rx (extrinsic rotations)
§Reference
Diebel (2006), “Representing Attitude: Euler Angles, Unit Quaternions, and Rotation Vectors”
Fields§
§tx: f64Translation x.
ty: f64Translation y.
tz: f64Translation z.
rx: f64Roll (rotation about X axis) in radians.
ry: f64Pitch (rotation about Y axis) in radians.
rz: f64Yaw (rotation about Z axis) in radians.
Implementations§
Source§impl Transform3D
impl Transform3D
Sourcepub fn translation(tx: f64, ty: f64, tz: f64) -> Self
pub fn translation(tx: f64, ty: f64, tz: f64) -> Self
Creates a translation-only transform.
Sourcepub fn new(tx: f64, ty: f64, tz: f64, rx: f64, ry: f64, rz: f64) -> Self
pub fn new(tx: f64, ty: f64, tz: f64, rx: f64, ry: f64, rz: f64) -> Self
Creates a transform with translation and Euler angles.
Sourcepub fn to_isometry(&self) -> Isometry3<f64>
pub fn to_isometry(&self) -> Isometry3<f64>
Converts to a nalgebra Isometry3.
Uses the Euler angle convention: Rz * Ry * Rx.
Sourcepub fn from_isometry(iso: &Isometry3<f64>) -> Self
pub fn from_isometry(iso: &Isometry3<f64>) -> Self
Creates from a nalgebra Isometry3.
Sourcepub fn apply(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64)
pub fn apply(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64)
Applies this transform to coordinates.
Sourcepub fn apply_point(&self, p: &Point3) -> Point3
pub fn apply_point(&self, p: &Point3) -> Point3
Applies this transform to a Point3.
Sourcepub fn apply_points(&self, points: &[Point3]) -> Vec<Point3>
pub fn apply_points(&self, points: &[Point3]) -> Vec<Point3>
Transforms a slice of points.
Sourcepub fn then(&self, other: &Self) -> Self
pub fn then(&self, other: &Self) -> Self
Composes two transforms: applies self first, then other.
Sourcepub fn is_identity(&self, epsilon: f64) -> bool
pub fn is_identity(&self, epsilon: f64) -> bool
Whether this is approximately an identity transform.
Trait Implementations§
Source§impl Clone for Transform3D
impl Clone for Transform3D
Source§fn clone(&self) -> Transform3D
fn clone(&self) -> Transform3D
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Transform3D
impl Debug for Transform3D
Source§impl Default for Transform3D
impl Default for Transform3D
Source§impl PartialEq for Transform3D
impl PartialEq for Transform3D
impl Copy for Transform3D
impl StructuralPartialEq for Transform3D
Auto Trait Implementations§
impl Freeze for Transform3D
impl RefUnwindSafe for Transform3D
impl Send for Transform3D
impl Sync for Transform3D
impl Unpin for Transform3D
impl UnsafeUnpin for Transform3D
impl UnwindSafe for Transform3D
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.