SVG / vector graphical objects boolean operations (union, intersection, subtraction)

≯℡__Kan透↙ 提交于 2019-11-30 02:14:33

Perhaps I'm missing something, but wouldn't the classes in the java.awt.geom package suit your needs? They deal with two-dimensional shapes; the Area class deals specifically with boolean operations:

An Area object stores and manipulates a resolution-independent description of an enclosed area of 2-dimensional space. Area objects can be transformed and can perform various Constructive Area Geometry (CAG) operations when combined with other Area objects. The CAG operations include area addition, subtraction, intersection, and exclusive or.

You can JavaScript Clipper ,a port of Angus Johnson's Clipper (written in Delphi, C++, C# and Python), which in turn is based on Bala R. Vatti's clipping algorithm. It is able to handle all polygon cases, including the self-intersecting ones.

Keep in mind that the lib takes only polygons so any curves need to be polygonized first

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