This example shows the results (orange) of performing four different boolean operations (union, difference, xor and intersection) on two 2D shapes (blue). Thanks to the powerful clipper.js library, the computation is performed in client-side Javascript.
The example is almost entirely taken from this clipper.js demo.
Modified http://d3js.org/d3.v3.min.js to a secure url
Modified http://jsclipper.sourceforge.net/6.1.3.1/clipper.js to a secure url
https://d3js.org/d3.v3.min.js
https://jsclipper.sourceforge.net/6.1.3.1/clipper.js