pub enum LawSegment {
Constant {
length: f64,
radius: f64,
},
Linear {
length: f64,
start_radius: f64,
end_radius: f64,
},
Interpolated {
points: Vec<(f64, f64)>,
},
}Expand description
One user segment of a composite radius law, spanning length of abscissa.
Variants§
Constant
Constant radius over length (OCCT Law_Constant).
Linear
Linear ramp from start_radius to end_radius over length
(OCCT Law_Linear).
Interpolated
Monotone C1 interpolation through (abscissa_offset, radius) points
(OCCT Law_Interpol). Offsets are measured from the segment start;
the first must be exactly 0.0, offsets strictly increase, and the
last offset is the segment length. Interpolation is shape-preserving
(Fritsch–Carlson PCHIP): the law never overshoots the point radii, so
positive inputs stay positive.
Trait Implementations§
Source§impl Clone for LawSegment
impl Clone for LawSegment
Source§fn clone(&self) -> LawSegment
fn clone(&self) -> LawSegment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LawSegment
impl RefUnwindSafe for LawSegment
impl Send for LawSegment
impl Sync for LawSegment
impl Unpin for LawSegment
impl UnsafeUnpin for LawSegment
impl UnwindSafe for LawSegment
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