pub struct Frame2 { /* private fields */ }Expand description
A local coordinate system in the plane.
Implementations§
Source§impl Frame2
impl Frame2
Sourcepub const fn new(origin: Point2, x: Direction2) -> Self
pub const fn new(origin: Point2, x: Direction2) -> Self
A right-handed frame from an origin and a first axis.
Sourcepub fn from_axes(
origin: Point2,
x: Direction2,
y: Direction2,
tol: Tolerances,
) -> OgeomResult<Self>
pub fn from_axes( origin: Point2, x: Direction2, y: Direction2, tol: Tolerances, ) -> OgeomResult<Self>
A frame with an explicit second axis, whose handedness is inferred.
§Errors
OgeomError::Construction if the two
axes are not perpendicular within tol.angular().
Sourcepub const fn x(&self) -> Direction2
pub const fn x(&self) -> Direction2
The first axis.
Sourcepub const fn y(&self) -> Direction2
pub const fn y(&self) -> Direction2
The second axis.
Sourcepub const fn handedness(&self) -> Handedness
pub const fn handedness(&self) -> Handedness
This frame’s handedness.
Sourcepub fn to_local(&self, p: Point2) -> Point2
pub fn to_local(&self, p: Point2) -> Point2
Local coordinates of a point given in world coordinates.
Sourcepub fn to_world(&self, p: Point2) -> Point2
pub fn to_world(&self, p: Point2) -> Point2
World coordinates of a point given in local coordinates.
Sourcepub fn vector_to_local(&self, v: Vector2) -> Vector2
pub fn vector_to_local(&self, v: Vector2) -> Vector2
Local components of a world-space vector.
Sourcepub fn vector_to_world(&self, v: Vector2) -> Vector2
pub fn vector_to_world(&self, v: Vector2) -> Vector2
World components of a vector given in local coordinates.
Trait Implementations§
impl Copy for Frame2
impl StructuralPartialEq for Frame2
Auto Trait Implementations§
impl Freeze for Frame2
impl RefUnwindSafe for Frame2
impl Send for Frame2
impl Sync for Frame2
impl Unpin for Frame2
impl UnsafeUnpin for Frame2
impl UnwindSafe for Frame2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.