Skip to main content

SectionFrame

Struct SectionFrame 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§point: DVec3

The curve point.

§tangent: DVec3

Unit tangent, in the direction of increasing distance.

§lateral: DVec3

Unit lateral axis, to the left of the tangent.

§up: DVec3

Unit section up, tangent x lateral.

Implementations§

Source§

impl SectionFrame

Source

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.

Source

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.

Source

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.

Source

pub fn frame(&self) -> Frame3

The frame in the curve-evaluation provider’s layout: x the tangent, y up, z = x x y, which is -lateral (to the right).

Trait Implementations§

Source§

impl Clone for SectionFrame

Source§

fn clone(&self) -> SectionFrame

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SectionFrame

Source§

impl Debug for SectionFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SectionFrame

Source§

fn eq(&self, other: &SectionFrame) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SectionFrame

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.