clipper2-ts icon indicating copy to clipboard operation
clipper2-ts copied to clipboard

A native Typescript/Javascript port of Clipper2

clipper2-ts

Example of using clipper2-js Union, Intersection and Difference clipping operations.
Shapes are rendered and animated using threejs

NPM Package

Codesandbox demo

image

Documentation

Clipper2 HTML documentation

Example

const subj = new Paths64();
const clip = new Paths64();
subj.push(Clipper.makePath([ 100, 50, 10, 79, 65, 2, 65, 98, 10, 21 ]));
clip.push(Clipper.makePath([98, 63, 4, 68, 77, 8, 52, 100, 19, 12]));
const solution = Clipper.Intersect(subj, clip, FillRule.NonZero);