pub struct ShapeMorph { /* private fields */ }Expand description
A reusable morph between any two ShapePolygon contours.
Uses polymorpher’s feature-matched morph when both endpoints are RoundedPolygons
and falls back to perimeter-length cubic alignment when an endpoint is an arbitrary
cubic contour or triggers a feature-matching edge case.
Implementations§
Source§impl ShapeMorph
impl ShapeMorph
Sourcepub fn new(
start: impl Into<ShapePolygon>,
end: impl Into<ShapePolygon>,
) -> ShapeMorph
pub fn new( start: impl Into<ShapePolygon>, end: impl Into<ShapePolygon>, ) -> ShapeMorph
Creates a reusable morph between any two shapes (such as
MaterialShape, PolygonRole, or
ShapePolygon).
Sourcepub fn perimeter_aligned(
start: impl Into<ShapePolygon>,
end: impl Into<ShapePolygon>,
) -> ShapeMorph
pub fn perimeter_aligned( start: impl Into<ShapePolygon>, end: impl Into<ShapePolygon>, ) -> ShapeMorph
Creates a morph aligned strictly by normalized perimeter length, preserving exact endpoint curves with bounded cubic count even for arbitrary concave polygons.
Sourcepub fn sample_polygon(&self, progress: f32) -> ShapePolygon
pub fn sample_polygon(&self, progress: f32) -> ShapePolygon
Samples the interpolated normalized contour at progress (clamped to 0..=1).
Trait Implementations§
Source§impl Clone for ShapeMorph
impl Clone for ShapeMorph
Source§fn clone(&self) -> ShapeMorph
fn clone(&self) -> ShapeMorph
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 Forget for ShapeMorph
impl Freeze for ShapeMorph
impl Move for ShapeMorph
impl RefUnwindSafe for ShapeMorph
impl Send for ShapeMorph
impl Sync for ShapeMorph
impl Unpin for ShapeMorph
impl UnsafeUnpin for ShapeMorph
impl UnwindSafe for ShapeMorph
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more