Constructive solid geometry on meshes using BSP trees in JavaScript