pub struct HelixCurve { /* private fields */ }Expand description
A helix about its frame’s z, parameterized by turn angle.
The point at t sits at angle t around the axis, radius out along the
turned x, risen by pitch·t/2π along z, so one full turn advances
exactly one pitch, and a negative pitch winds the other hand. A non-zero
taper advances the radius the same way and winds a cone instead. A
helix is transcendental: no rational B-spline states it exactly, which
is why it is its own type rather than a conversion.
Implementations§
Source§impl HelixCurve
impl HelixCurve
Sourcepub fn new(
frame: Frame,
radius: f64,
pitch: f64,
turns: f64,
) -> OgeomResult<Self>
pub fn new( frame: Frame, radius: f64, pitch: f64, turns: f64, ) -> OgeomResult<Self>
A helix over turns full revolutions from angle zero.
§Errors
OgeomError::Construction if
the radius is not finite and positive, the pitch is not finite and
non-zero (a zero pitch is a circle, and there is a type for that),
or turns is not finite and positive.
Sourcepub fn over(
frame: Frame,
radius: f64,
pitch: f64,
start: f64,
end: f64,
) -> OgeomResult<Self>
pub fn over( frame: Frame, radius: f64, pitch: f64, start: f64, end: f64, ) -> OgeomResult<Self>
A helix over an arbitrary increasing angle interval.
§Errors
As HelixCurve::new, with the interval checked instead of the turn
count.
Sourcepub fn conical(
frame: Frame,
radius: f64,
pitch: f64,
taper: f64,
start: f64,
end: f64,
) -> OgeomResult<Self>
pub fn conical( frame: Frame, radius: f64, pitch: f64, taper: f64, start: f64, end: f64, ) -> OgeomResult<Self>
A conical helix: the radius advances by taper per full turn while
the point rises by pitch, winding the cone whose half-angle
satisfies tan(angle) = taper / pitch. radius is the radius at
angle zero, whether or not the interval holds it.
§Errors
As HelixCurve::over, and additionally if taper is not finite
or the radius runs non-positive anywhere on the interval; past the
apex there is no cone to wind.
Sourcepub const fn pitch(&self) -> f64
pub const fn pitch(&self) -> f64
The advance along the axis per full turn; negative winds left-handed.
Sourcepub const fn taper(&self) -> f64
pub const fn taper(&self) -> f64
The radial advance per full turn; zero is the cylindrical helix.
Sourcepub const fn is_reversed(&self) -> bool
pub const fn is_reversed(&self) -> bool
Whether evaluation runs the domain backwards.
Sourcepub fn arc_length(&self, from: f64, to: f64) -> f64
pub fn arc_length(&self, from: f64, to: f64) -> f64
The exact arc length between two parameters: constant speed times the swept angle.
Trait Implementations§
Source§impl Clone for HelixCurve
impl Clone for HelixCurve
Source§fn clone(&self) -> HelixCurve
fn clone(&self) -> HelixCurve
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HelixCurve
Source§impl Curve3d for HelixCurve
impl Curve3d for HelixCurve
Source§fn d1_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Vector>
fn d1_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Vector>
u. Read moreSource§fn continuity(&self) -> Continuity
fn continuity(&self) -> Continuity
Source§fn is_periodic(&self) -> bool
fn is_periodic(&self) -> bool
Source§fn tangent_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Direction>
fn tangent_at(&self, u: f64, tol: Tolerances) -> OgeomResult<Direction>
u. Read moreSource§impl Debug for HelixCurve
impl Debug for HelixCurve
Source§impl From<HelixCurve> for Curve
impl From<HelixCurve> for Curve
Source§fn from(c: HelixCurve) -> Self
fn from(c: HelixCurve) -> Self
Source§impl PartialEq for HelixCurve
impl PartialEq for HelixCurve
Source§fn eq(&self, other: &HelixCurve) -> bool
fn eq(&self, other: &HelixCurve) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HelixCurve
Auto Trait Implementations§
impl Freeze for HelixCurve
impl RefUnwindSafe for HelixCurve
impl Send for HelixCurve
impl Sync for HelixCurve
impl Unpin for HelixCurve
impl UnsafeUnpin for HelixCurve
impl UnwindSafe for HelixCurve
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,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.