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 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).

Source

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.

Source

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.

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.