Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including js-clipper with all npm packages installed. Try it out:

var jsClipper = require("js-clipper")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

js-clipper v1.0.1

common.js compatible version of JSClipper


A JavaScript library to perform boolean operations (union, difference etc...) between two SVG paths.

Online demo :

Original : - 12 January 2013

  • Update: Clipper library updated to version 5.0.2. The Area algorithm has been updated and is faster. 'CheckInputs' parameter of the OffsetPolygons function has been renamed 'AutoFix'.
  • Added: ClipperLib.Clean(), which removes too near vertices to avoid micro-self-intersection-artifacts when offsetting.
  • Added: ClipperLib.Lighten(), which reduces count of vertices using perpendicular distance reduction algorithm.
  • Added: ClipperLib.Clone(), which make true clone of polygons. Several updates to the Main Demo:
  • Added: Clean, Simplify, Lighten buttons
  • Change: Custom Polygons: input boxes to textareas to allow more data
  • Added: Polygon Output Formats (Clipper, Plain, SVG)
  • Update: Polygon Explorer: Also multipolygon is clickable (on Points column)
  • Added: Polygon Explorer: When numbers on Points or Points in subpolygons are clicked, the area of multipolygon or subpolygon is shown
  • Update: Several updates to wiki in - 1 January 2013

  • Update: Browser specific speedup for ClipperLib.Clipper.Round(), ClipperLib.Cast_Int32() and ClipperLib.Cast_Int64().
  • Update: Major enhancements for Main Demo. Including benchmark, custom polygons and polygon importer.
  • Update: Documentation is updated with new screenshots of Main Demo. Browser speedtest is published in Wiki. - 12 December 2012

  • Initial release
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free