MotionScript

@motion-script/core


@motion-script/core / lerpPath

Function: lerpPath()

lerpPath(from, to, t): PathData

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

Smoothly interpolate between two path shapes — the PathData tween used by Path's animatable d property and usable directly as a LerpFunction.

from/to may be SVG d strings or PathCommand arrays and need not share structure, command count, subpath count, point order, or winding — the shapes are reconciled into a common cubic correspondence first (see the module overview). At t = 0 and t = 1 the endpoints are returned verbatim so the start and end frames are pixel-exact; in between, a morphed command list is produced.

Parameters

from

PathData

Source path (the shape at t = 0).

to

PathData

Target path (the shape at t = 1).

t

number

Progress in [0, 1].

Returns

PathData