pub struct Intrinsic3 {
pub start: Frame3,
pub curvature: CurvatureLaw,
pub torsion: CurvatureLaw,
pub length: Scalar,
}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: ScalarArc length the laws are defined over.
Implementations§
Source§impl Intrinsic3
impl Intrinsic3
Sourcepub const fn new(
start: Frame3,
curvature: CurvatureLaw,
torsion: CurvatureLaw,
length: Scalar,
) -> Self
pub const fn new( start: Frame3, curvature: CurvatureLaw, torsion: CurvatureLaw, length: Scalar, ) -> Self
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<Scalar>
pub fn total_turning(&self) -> Option<Scalar>
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<Scalar>
pub fn total_torsion(&self) -> Option<Scalar>
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 more