Source code: http://github.com/code4fukui/CSG.js/
Documentation: http://code4fukui.github.io/CSG.js/tests/
forked from: evanw/csg.js
These tests cover all the cases of a pair of overlapping coplanar polygons in both solids. To avoid duplicate polygons, the overlapping polygons are kept in the first solid and removed from the second solid.
a |
b |
a.inverse() |
b.inverse() |
a.union(b) |
b.union(a) |
a.subtract(b) |
b.subtract(a) |
a.intersect(b) |
b.intersect(a) |
c |
d |
c.inverse() |
d.inverse() |
c.union(d) |
d.union(c) |
c.subtract(d) |
d.subtract(c) |
c.intersect(d) |
d.intersect(c) |