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 non-degenerate
RoundedPolygons and falls back to perimeter-length cubic alignment for arbitrary
cubic contours or degenerate geometry.
Implementations§
Source§impl ShapeMorph
impl ShapeMorph
Sourcepub fn new(start: impl Into<ShapePolygon>, end: impl Into<ShapePolygon>) -> Self
pub fn new(start: impl Into<ShapePolygon>, end: impl Into<ShapePolygon>) -> Self
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>,
) -> Self
pub fn perimeter_aligned( start: impl Into<ShapePolygon>, end: impl Into<ShapePolygon>, ) -> Self
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§
Auto Trait Implementations§
impl Forget for ShapeMorph
impl Freeze for ShapeMorphwhere
*const u8 is !null: Freeze,
PhantomData<Feature>: Freeze,
PhantomData<UnknownUnit>: Freeze,
PhantomData<Cubic>: Freeze,
PhantomData<(Cubic, Cubic)>: Freeze,
impl Move for ShapeMorph
impl RefUnwindSafe for ShapeMorph
impl Send for ShapeMorphwhere
RawVecInner: Send,
impl Sync for ShapeMorphwhere
RawVecInner: Sync,
impl Unpin for ShapeMorph
impl UnsafeUnpin for ShapeMorphwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Feature>: UnsafeUnpin,
PhantomData<UnknownUnit>: UnsafeUnpin,
PhantomData<Cubic>: UnsafeUnpin,
PhantomData<(Cubic, Cubic)>: UnsafeUnpin,
impl UnwindSafe for ShapeMorphwhere
RawVecInner: UnwindSafe,
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