I'm trying to invert a 3D shape using ThreeCSG (get the empty spaces of the original shape) but it looks like they didn't include the inverse function from the original CSG:
inverse: function() {
var csg = this.clone();
csg.polygons.map(function(p) { p.flip(); });
return csg;
}
I tried to implement it on my own like the other functions here:
inverse() {
var csg = this.tree.clone();
csg.polygons.map(function (p) { p.flip(); });
return csg;
}
But it doesn't work. I also tried to make a large THREE.BoxGeometry
and subtract (subtract is implemented) my shape from it, but I'm only getting back the large box without any holes or shapes inside.
Any ideas on how to implement the invert?