You might be interested in JSClipper [1]: &quot;Clipper is a robust library for polygon boolean operations and offsetting&quot;. See the demo here [2].<p>[1] <a href="http:&#x2F;&#x2F;jsclipper.sourceforge.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jsclipper.sourceforge.net&#x2F;</a><p>[2] <a href="http:&#x2F;&#x2F;jsclipper.sourceforge.net&#x2F;6.1.1.1&#x2F;main_demo.html" rel="nofollow">http:&#x2F;&#x2F;jsclipper.sourceforge.net&#x2F;6.1.1.1&#x2F;main_demo.html</a>