pub struct Intrinsic3 {
pub start: Frame3,
pub curvature: CurvatureLaw,
pub torsion: CurvatureLaw,
pub length: f64,
}Expand description
A space curve given by its natural equations.
curvature is k(s) >= 0 by the Frenet convention; a signed law is
storable, because dirty imported data stays representable here as
everywhere else in this crate, and naming it is a validator’s job.
torsion is tau(s), signed: positive is a right-handed screw. Torsion
identically zero is a plane curve, and the plane is the one spanned by
the start frame’s x and y axes.
Both laws reuse CurvatureLaw, which is the general “scalar function of
arc length” in this crate: constant, polynomial, sinusoid, their sum, and
piecewise combinations. Nothing about it is curvature-specific, and a
second near-identical enum for torsion would be duplication with a
different name.
Fields§
§start: Frame3Start frame: origin at the curve start, x along the start tangent,
y along the start normal, z along the start binormal.
curvature: CurvatureLawCurvature as a function of arc length from start.
torsion: CurvatureLawTorsion as a function of arc length from start.
length: f64Arc length the laws are defined over.
Implementations§
Source§impl Intrinsic3
impl Intrinsic3
Sourcepub const fn new(
start: Frame3,
curvature: CurvatureLaw,
torsion: CurvatureLaw,
length: f64,
) -> Intrinsic3
pub const fn new( start: Frame3, curvature: CurvatureLaw, torsion: CurvatureLaw, length: f64, ) -> Intrinsic3
Anchor a curvature and a torsion law to a start frame over an arc length.
Sourcepub fn is_planar(&self) -> bool
pub fn is_planar(&self) -> bool
Whether the curve is planar: torsion identically zero.
A planar space curve is exactly a 2D curve embedded in the start frame’s plane, so this is the predicate that decides whether the cheaper 2D path applies.
Sourcepub fn is_helical(&self) -> bool
pub fn is_helical(&self) -> bool
Whether the curve is a helix: curvature and torsion both constant.
This is the case where the Frenet generators commute at every arc length, so the product integral collapses to a single matrix exponential and the curve has an elementary closed form. Worth naming because it is both the classical example and the exactly-solvable case.
Sourcepub fn total_turning(&self) -> Option<f64>
pub fn total_turning(&self) -> Option<f64>
Total tangent turning over the curve, in radians, in closed form.
The integral of k – exact, as in 2D. Note this is NOT enough to
recover the frame in space, only the amount the tangent has swung.
Sourcepub fn total_torsion(&self) -> Option<f64>
pub fn total_torsion(&self) -> Option<f64>
Total torsion over the curve, in radians, in closed form.
The integral of tau. For a helix this is the angle the binormal has
swung about the axis.
Trait Implementations§
Source§impl Clone for Intrinsic3
impl Clone for Intrinsic3
Source§fn clone(&self) -> Intrinsic3
fn clone(&self) -> Intrinsic3
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Intrinsic3
impl Debug for Intrinsic3
Source§impl PartialEq for Intrinsic3
impl PartialEq for Intrinsic3
impl StructuralPartialEq for Intrinsic3
Auto Trait Implementations§
impl Freeze for Intrinsic3
impl RefUnwindSafe for Intrinsic3
impl Send for Intrinsic3
impl Sync for Intrinsic3
impl Unpin for Intrinsic3
impl UnwindSafe for Intrinsic3
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
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