veltman / flubber

Tools for smoother shape animations.
MIT License
6.61k stars 167 forks source link

Add flubber.align()? #94

Open veltman opened 6 years ago

veltman commented 6 years ago

By default, flubber.interpolate() will return the original start and end shapes at t=0 and t=1. It might be worth having a method that returns two corresponding path strings / coordinate rings, in case someone wants to use them to smoothly animate in some other context (like a CSS animation).

// fromStr and toStr are mismatched paths
let [from, to] = flubber.align(fromStr, toStr);

// from and to are now path strings with a matching number of points with good rotation for animating

Also not sure whether align() is the best method name for this.