Graphite
Graphite copied to clipboard
Boolean operations node
The legacy boolean operations were unstable, and are no longer compatible with the migration of vector data to nodes (#1065) so they had to be removed. But they're very important in the artist's workflow, so re-adding them as a node is high priority.
In order of importance, this should:
- [ ] Either use web-sys to call Paper.js, or finish the attempted Paper.js Rust port in this branch
- [ ] Introduce a vector operations node operating on vector data in the graph
- [ ] Hook up the boolean buttons in the Select tool's options bar so they take the selected vector layers and combine them into one graph set up so they feed into the boolean operations node
Each of these would be suitable for a single or separate PRs depending on the author's approach.
I know an old thread in Paper.js which is all about the robustness of their Booleans. They eventually implemented it pretty good. Thread: https://github.com/paperjs/paper.js/issues/761 Tests (A LOT!): https://github.com/paperjs/paper.js/blob/master/test/tests/Path_Boolean.js
Thanks for the links @be5invis! I did actually attempt a (partially-complete) port of the paper.js logic: https://github.com/GraphiteEditor/Graphite/tree/paperjs-boolean-ops However I got stuck once it started depending on other files within their library. Any help porting this by a community member would be amazing and very helpful to us. Thanks!
One more idea: instead of porting paper.js, we could do a Rust -> JS -> Rust call to use it as an actual JS library (just doing data type conversion before and after).
Throwing in PathKit (Skia's WASM interface) for reference: https://skia.org/docs/user/modules/pathkit/#makefromoppathone-pathtwo-op
I see you went with calls to Paper.js... https://github.com/GraphiteEditor/Graphite/pull/1759/files#diff-be0d7c77db82f95796c8fe3ccc8e86a6c0ac1a1b15f12767a279d74ca45ff643 👍