#[non_exhaustive]pub struct SectionFrame {
pub point: Point3,
pub tangent: Vec3,
pub lateral: Vec3,
pub up: Vec3,
}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: Point3The curve point.
tangent: Vec3Unit tangent, in the direction of increasing distance.
lateral: Vec3Unit lateral axis, to the left of the tangent.
up: Vec3Unit section up, tangent x lateral.
Implementations§
Source§impl SectionFrame
impl SectionFrame
Sourcepub fn place(
&self,
lateral: Scalar,
vertical: Scalar,
longitudinal: Scalar,
) -> Point3
pub fn place( &self, lateral: Scalar, vertical: Scalar, longitudinal: Scalar, ) -> Point3
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) -> GeomResult<Self>
pub fn plan(&self) -> GeomResult<Self>
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<Vec3>,
ref_direction: Option<Vec3>,
) -> GeomResult<Self>
pub fn oriented( &self, axis: Option<Vec3>, ref_direction: Option<Vec3>, ) -> GeomResult<Self>
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) -> Transform3
pub fn placement(&self) -> Transform3
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: Transform3) -> Self
pub fn moved(&self, rigid: Transform3) -> Self
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.