pub struct Spline { /* private fields */ }Expand description
A cardinal Catmull-Rom interpolating spline with clamped endpoint neighbors.
Implementations§
Source§impl Spline
impl Spline
Sourcepub fn through(values: impl IntoIterator<Item = Point>) -> Self
pub fn through(values: impl IntoIterator<Item = Point>) -> Self
Captures a bounded point list, including empty/single-point degeneracies.
Sourcepub fn tension(self, tension: f64) -> Self
pub fn tension(self, tension: f64) -> Self
Sets tension in 0..=1; zero is Catmull-Rom, one has zero endpoint tangents.
Sourcepub fn try_path(&self) -> Result<Path2D, ValidationError>
pub fn try_path(&self) -> Result<Path2D, ValidationError>
Produces cubic spans passing through every supplied point.
Trait Implementations§
Source§impl Shape for Spline
impl Shape for Spline
Source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
Geometric bounds; defaults to the path’s cached curve bounds.
Source§fn validate(&self) -> Result<(), ValidationError>
fn validate(&self) -> Result<(), ValidationError>
Reports retained authoring errors before measuring or drawing.
Source§fn as_rect(&self) -> Option<Rect>
fn as_rect(&self) -> Option<Rect>
Exact rectangle equivalent, when available, for a rule-independent fast path.
Auto Trait Implementations§
impl Forget for Spline
impl Freeze for Spline
impl RefUnwindSafe for Spline
impl Send for Spline
impl Sync for Spline
impl Unpin for Spline
impl UnsafeUnpin for Spline
impl UnwindSafe for Spline
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