pub struct Axis {
pub location: Point,
pub direction: Direction,
}Expand description
A point and a direction: an oriented line through space.
Fields§
§location: PointA point on the axis.
direction: DirectionThe axis direction.
Implementations§
Source§impl Axis
impl Axis
Sourcepub const fn new(location: Point, direction: Direction) -> Self
pub const fn new(location: Point, direction: Direction) -> Self
An axis from a point and a direction.
Sourcepub fn through(from: Point, to: Point, tol: Tolerances) -> OgeomResult<Self>
pub fn through(from: Point, to: Point, tol: Tolerances) -> OgeomResult<Self>
The axis through two distinct points, directed from from to to.
§Errors
OgeomError::Construction if the points
coincide.
Sourcepub fn point_at(self, t: f64) -> Point
pub fn point_at(self, t: f64) -> Point
The point at parameter t, measured from Axis::location in units of
length along the direction.
Sourcepub fn parameter_of(self, p: Point) -> f64
pub fn parameter_of(self, p: Point) -> f64
The parameter of the projection of p onto this axis.
Sourcepub fn distance_to(self, p: Point) -> f64
pub fn distance_to(self, p: Point) -> f64
The perpendicular distance from p to this axis.
Sourcepub fn contains(self, p: Point, tol: Tolerances) -> bool
pub fn contains(self, p: Point, tol: Tolerances) -> bool
Whether p lies on this axis within tol.confusion().
Sourcepub fn is_coaxial(self, other: Self, tol: Tolerances) -> bool
pub fn is_coaxial(self, other: Self, tol: Tolerances) -> bool
Whether two axes are the same line with the same sense.
Sourcepub fn is_collinear(self, other: Self, tol: Tolerances) -> bool
pub fn is_collinear(self, other: Self, tol: Tolerances) -> bool
Whether two axes lie on the same line, ignoring sense.
Trait Implementations§
impl Copy for Axis
impl StructuralPartialEq for Axis
Auto Trait Implementations§
impl Freeze for Axis
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnsafeUnpin for Axis
impl UnwindSafe for Axis
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.