#[non_exhaustive]pub struct SectionFrame {
pub point: DVec3,
pub tangent: DVec3,
pub lateral: DVec3,
pub up: DVec3,
}Expand description
A point on a curve and the section axes there: tangent, left lateral
and up, unit and right-handed (up = tangent x lateral).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.point: DVec3The curve point.
tangent: DVec3Unit tangent, in the direction of increasing distance.
lateral: DVec3Unit lateral axis, to the left of the tangent.
up: DVec3Unit section up, tangent x lateral.
Implementations§
Source§impl SectionFrame
impl SectionFrame
Sourcepub fn place(&self, lateral: f64, vertical: f64, longitudinal: f64) -> DVec3
pub fn place(&self, lateral: f64, vertical: f64, longitudinal: f64) -> DVec3
The point offset from this frame’s point: lateral along the
lateral axis (positive to the left), vertical along up and
longitudinal along the tangent.
Sourcepub fn plan(&self) -> Result<SectionFrame, GeomError>
pub fn plan(&self) -> Result<SectionFrame, GeomError>
The same point framed vertically: the tangent’s horizontal
projection, the horizontal left normal and +Z. Grade and bank are
dropped.
§Errors
A vertical tangent, which has no horizontal projection.
Sourcepub fn oriented(
&self,
axis: Option<DVec3>,
ref_direction: Option<DVec3>,
) -> Result<SectionFrame, GeomError>
pub fn oriented( &self, axis: Option<DVec3>, ref_direction: Option<DVec3>, ) -> Result<SectionFrame, GeomError>
The same point with its axes turned by an explicit orientation
(#246): axis and ref_direction are components in THIS frame,
(tangent, lateral, up), defaulting to (0, 0, 1) and (1, 0, 0).
Gram-Schmidt with the axis primary: up' = axis / |axis|,
tangent' = normalise(r - (r . up') up') for the unit reference
direction r, lateral' = up' x tangent'. This is the reading of a
linear placement’s Axis and RefDirection relative to the curve
(see the module documentation).
§Errors
A zero or non-finite vector, or an axis and reference direction
parallel or anti-parallel within ORIENTATION_TOLERANCE, by name.
Sourcepub fn placement(&self) -> DAffine3
pub fn placement(&self) -> DAffine3
The rigid placement this frame stands for (#264): local x onto the
tangent, y onto the lateral (to the left), z onto up, the local
origin onto the point.
This is how a linear placement maps its local axes (buildingSMART
IFC 4.3, IfcAxis2PlacementLinear: X the tangent, Y the left
lateral, Z up), and how a node placed at a station is moved. It is
not Self::frame’s provider layout (y up, z right).
Sourcepub fn moved(&self, rigid: DAffine3) -> SectionFrame
pub fn moved(&self, rigid: DAffine3) -> SectionFrame
This frame carried by a rigid motion: the point by rigid, the
axes by its linear part.
A section frame on a curve moved rigidly is the moved curve’s own
only where its convention does not depend on the world: always for
its tangent, and for the reference-up and plan frames only when
rigid keeps +Z; checking that is the caller’s.
Sourcepub fn carried(
&self,
rigid: DAffine3,
measure: DistanceConvention,
) -> Result<SectionFrame, GeomError>
pub fn carried( &self, rigid: DAffine3, measure: DistanceConvention, ) -> Result<SectionFrame, GeomError>
This frame, read on a curve, as the section frame of that curve
carried by the rigid motion rigid (#264, #285): the frame a
station on the placed curve has, measure the convention the
source curve is measured in.
Where rigid keeps +Z (within KEEPS_UP_TOLERANCE) this is
Self::moved: the moved reference-up, planar or banked frame is
the placed curve’s own, and plan distance is kept. Where it tilts
+Z, an arc-length-measured curve (arc length is kept by any rigid
motion) gets the reference-up frame against +Z of its moved point
and tangent, which is the placed 3D curve’s own section frame; the
moved frame would not be.
§Errors
A plan-measured curve (elevated or banked) under a motion that
tilts +Z, whose plan distance and section frame are not the placed
curve’s, by a typed GeomError::UnsupportedInput; and a moved
tangent with no reference-up frame (vertical), by name.
Trait Implementations§
Source§impl Clone for SectionFrame
impl Clone for SectionFrame
Source§fn clone(&self) -> SectionFrame
fn clone(&self) -> SectionFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SectionFrame
Source§impl Debug for SectionFrame
impl Debug for SectionFrame
Source§impl PartialEq for SectionFrame
impl PartialEq for SectionFrame
impl StructuralPartialEq for SectionFrame
Auto Trait Implementations§
impl Freeze for SectionFrame
impl RefUnwindSafe for SectionFrame
impl Send for SectionFrame
impl Sync for SectionFrame
impl Unpin for SectionFrame
impl UnsafeUnpin for SectionFrame
impl UnwindSafe for SectionFrame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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