polymorph icon indicating copy to clipboard operation
polymorph copied to clipboard

For interpolate, is it possible to ignore svg small specks?

Open designlook opened this issue 1 year ago • 3 comments

Sometimes when morphing between 2 svgs, it creates specks of small paths and wondering if those could be ignored and not shown. Thanks for great library.

BTW, I tried the popmotion steps in the doc but seems no longer works. I tried Motion library and that worked.

https://motion.dev/

designlook avatar Apr 29 '24 05:04 designlook

I tried to do a version of it here...

https://codepen.io/scottyu2012/pen/dyLLZbz?editors=1111

designlook avatar Apr 29 '24 06:04 designlook

There isn't a way to ignore those currently, but I can think of a number of options that could improve the situation if added:

  1. Add an option to specify how many paths to interpolate (and then just remove the other curves). This would result in going straight from the cutouts to a fully black robot icon. I'm not sure if this is what you want though since it might be jarring to go from an outlined robot to a filled in one between frames
  2. Add another value to the "optimize" option that makes the unmatches curves interpolate to its center point and attempts to shrink them before the midpoint of the animation.
  3. Add an option to specify what offset to remove unmatched curves at. So basically you can choose when the unmatched curves are phased out. Or maybe provide a timing function to control them.

The fundamental issue here with that animation are that the cutouts are expressed as additional paths, so they can't just be ignored without a jump. Also, I can't change the default behavior without bumping the major version (and I would rather not), but I can certainly add more options.

Thoughts?

notoriousb1t avatar May 02 '24 22:05 notoriousb1t

Yeah I think #2 and #3 would be great. So #3 would be to check how much of an island the element is at from next nearest neighbor? These options would be great!

designlook avatar May 04 '24 20:05 designlook