Boolean path operations #785
Replies: 7 comments
-
As of 2016, Paper.js has the most advanced implementation of boolean operations. Raphael does not support all the edge cases, while Clipper can output only polygons. |
Beta Was this translation helpful? Give feedback.
-
I'm not 100% certain but I seem to remember that its license was not On Tue, Jun 28, 2016, 10:01 AM Jarek Foksa [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
@codedread Paper.js is released under MIT license. |
Beta Was this translation helpful? Give feedback.
-
FWIW Paper.js boolean operations are intrinsically connected with it's own As for the second library, raphael-boolean, it is really not a reliable solution. I don't have any test cases that fail at the moment but I've gave that lib a test run back in 2014 and it failed in any non-trivial shape combination. Hasn't been updated since An alternative could be Javascript Clipper which handles nearly all shape configurations with the sole problem that it deals with Polygons instead of Bezier curves. It's fairly straightforward to "polygonise" a curve before performing BoolOps on it - the result would be a polygon nonetheless - it can be turned back to curves by doing some kind of curve fitting over the result - but that would distort the original curve handle positions etc and it sounds like really dirty business. IMO, best bet would be to port Paper's BoolOps code |
Beta Was this translation helpful? Give feedback.
-
@nicholaswmin Paper's |
Beta Was this translation helpful? Give feedback.
-
That's definitely one way to do it
We could defer/async Paper.js lib so it doesn't impact the load time Do this as a "stopgap" perhaps? |
Beta Was this translation helpful? Give feedback.
-
Is there any progress? |
Beta Was this translation helpful? Give feedback.
-
Is it possible to add boolean operations like Union, Xor, Difference for path?
Here is a link to the JS library that supports this operations:
http://jsclipper.sourceforge.net/6.1.3.2/main_demo.html
Second library:
https://github.com/poilu/raphael-boolean
Beta Was this translation helpful? Give feedback.
All reactions