csg.js
Constructive solid geometry on meshes using BSP trees in JavaScript
...The API allows you to create primitives (cubes, spheres, etc.) and then combine or transform them programmatically, producing new mesh geometry for rendering or export. Because it is dependency-light and pure JavaScript, csg.js can be integrated into custom modeling tools, CAD-like apps, games, or procedural modeling pipelines running in the browser or Node.