Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
designlook opened this issue Apr 29, 2024 · 3 comments
Open

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

designlook opened this issue Apr 29, 2024 · 3 comments

Comments

@designlook
Copy link

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
Copy link
Author

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

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

@notoriousb1t
Copy link
Owner

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?

@designlook
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants