pub enum CurveType {
Bezier {
degree: u32,
},
Lissajous {
a: f32,
b: f32,
delta: f32,
},
Parametric {
x_fn: MathFunction,
y_fn: MathFunction,
},
Circle {
radius: f32,
distortion: Option<MathFunction>,
},
Spiral {
rate: f32,
decay: f32,
},
Rose {
k: f32,
amplitude: f32,
},
Hypotrochoid {
big_r: f32,
small_r: f32,
d: f32,
},
Superellipse {
a: f32,
b: f32,
n: f32,
},
Catenary {
a: f32,
span: f32,
},
}Expand description
The mathematical definition of a curve.
Variants§
Bezier
Bezier curve of arbitrary degree (control points define shape).
Lissajous
Lissajous figure: x = Asin(at + delta), y = Bsin(bt).
Parametric
Parametric curve defined by two MathFunctions: x(t), y(t).
Circle
Circle with optional distortion function applied to radius.
Spiral
Spiral: r = rate * theta, with optional decay.
Rose
Rose curve: r = amplitude * cos(k * theta).
Hypotrochoid
Hypotrochoid: the curve traced by a point on a circle rolling inside another.
Superellipse
Superellipse (Lame curve): |x/a|^n + |y/b|^n = 1.
Catenary
Catenary: y = a * cosh(x/a).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CurveType
impl RefUnwindSafe for CurveType
impl Send for CurveType
impl Sync for CurveType
impl Unpin for CurveType
impl UnsafeUnpin for CurveType
impl UnwindSafe for CurveType
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.