The Clipper2 library performs intersection, union, difference and XOR boolean operations on both simple and complex polygons. It also performs polygon offsetting and constrained Delaunay triangulation.
For Clipper2 documentation please see the Extensive HTML documentation
ES6: https://github.com/ErikSom/Clipper2-WASM/tree/main/CPP/clipper2-wasm/dist/es/
UMD: https://github.com/ErikSom/Clipper2-WASM/tree/main/CPP/clipper2-wasm/dist/umd/
For ES6 see the examples here: https://github.com/ErikSom/Clipper2-WASM/tree/main/CPP/clipper2-wasm/examples/es
For UMD see the examples here: https://github.com/ErikSom/Clipper2-WASM/tree/main/CPP/clipper2-wasm/examples/umd
import { Clipper2ZFactoryFunction, MainModule } from 'clipper2-wasm/dist/clipper2z';
import * as _Clipper2ZFactory from 'clipper2-wasm/dist/umd/clipper2z';
const Clipper2ZFactory: Clipper2ZFactoryFunction = _Clipper2ZFactory;
Clipper2ZFactory({
locateFile: () => {
return 'path/to/your/clipper2z.wasm'
},
}).then((Clipper2Z: MainModule) => {
console.log('Clipper2Z', Clipper2Z);
})Clipper1 WASM repository: https://github.com/xaviergonz/js-angusj-clipper

See implementation: https://github.com/ErikSom/Clipper2-WASM/tree/main/clipper2-wasm/examples/benchmark
Made possible by: https://github.com/AngusJohnson/Clipper2
Huge thanks to @Birch-san with an outstanding wasm port example: https://github.com/Birch-san/box2d-wasm/