-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(optimizePathOrder): new plugin #1848
base: main
Are you sure you want to change the base?
Conversation
@@ -17,7 +17,7 @@ exports.description = 'merges multiple paths in one if possible'; | |||
exports.fn = (root, params) => { | |||
const { | |||
force = false, | |||
floatPrecision, | |||
floatPrecision = 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I don't do this, whenever I set an exact value for an argument it leaks out, despite my plugin having a default set. (js2path stores the value exactly, and if it gets called later with a different precision it overrides.)
I just thought I'd chime in. This is the first plugin thing I've seen in years that could improve the compression of a few of my hand-optimized ultra small files. I had previously thought there was little more optimization potential in them. Great idea |
9ca4e56
to
e62675a
Compare
21168fa
to
e62675a
Compare
Paths can often be optimized by changing their direction.
Base path:
M16 14v-2H8v2Z
(14b)Optimized by changing the start:
M8 14h8v-2H8Z
(13b)Optimized by reversing direction and changing the start:
M8 12h8v2H8z
(12b)This plugin automatically does that!
Flow of the plugin:
coords
. Any args that have special meaning go into a special property.z
Closes #1847
Closes #78 (damn thats old)
This is an optional plugin. Recent changes have made it fast enough to run on very large files in 100ms though.
Results
* Those results are outdated, after merging the latest changes I think something elsewhere changed making it less efficient