Boolean Operations on SVG paths [closed]

醉酒当歌 提交于 2019-11-29 06:03:23

There's Javascript Clipper, which allows for all the sets of Boolean Operations on paths but under the condition that the input path is a polygon.

  • If we have any curves (Cubic/Quadratic Bezier Curves), they can be subdivided to polygons easily using the De Casteljau algorithm.

    • If the subdivision sample is high enough, the result would be a polygon that visually looks like a curve (at the cost of a large amount of data as the number of vertices increases linearly, depending on the fidelity of the subdivision).

Then we can feed the path in JavaScript Clipper for the Boolean Operations.


The caveat here is that we lose the inherent "curvy" nature of the path if it contains curves. Doing the "polygonization" mentioned above is, more or less, a one-way street.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!