1

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?

shinzou
  • 5,850
  • 10
  • 60
  • 124
  • Take a look at the `invert()` method in the `Node` class in [ThreeCSG](https://github.com/chandlerprall/ThreeCSG/blob/master/threeCSG.es6#L538). But all it does is just flipping the polygons. – prisoner849 Jun 08 '17 at 09:21
  • Do you have an idea on how to properly use it? everything I try returns the same not inverted shape. @prisoner849 – shinzou Jun 11 '17 at 08:54

0 Answers0