#[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.
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 more