A port of Clipper2(C#) to js/ts.
npm install clipper2-lib-js``javascript``
const subj = new PathsD();
const clip = new PathsD();
subj.push([
{x:100, y:50},
{x:10, y:79},
{x:65, y:2},
{x:65, y:98},
{x:10, y:21}
]);
clip.push(Clipper.makePathD([ 98, 63, 4, 68, 77, 8, 52, 100, 19, 12 ]));
const solution = Clipper.intersect(subj, clip, FillRule.NonZero);