MotionScript

@motion-script/core


@motion-script/core / sampleMorph

Function: sampleMorph()

sampleMorph(plan, t): PathCommand[]

Defined in: attributes/shape/path/morph.ts:575

Sample a MorphPlan at progress t (0 → from, 1 → to), producing a fresh PathCommand list: one M, one C per cubic, and a trailing Z for closed subpaths.

Closed subpaths emit Z rather than a final line back to the start. The ring's last cubic already lands on its first anchor, so Z adds no length; what it does is tell the renderer the contour is closed, which is what makes the stroke join cleanly at the seam instead of drawing two unjoined end caps there.

Parameters

plan

MorphPlan

t

number

Returns

PathCommand[]