The issue:
Subtracting a cube from a sphere provides a result where the z axis retains volume, but the y and x axis produce flat disks, as show in the image. I am not sure why the sphere is losing volume on those sides. I am using a typical subtract with threeCSG.
Code:
var geometry = new THREE.CubeGeometry( 100, 100, 100 );
var material = new THREE.MeshLambertMaterial( {color: 0xff0000, side: THREE.DoubleSide, transparent:true, opacity: .5} );
var cutter = new THREE.Mesh( geometry, material );
var geometry2 = new THREE.SphereGeometry(60,32, 32);
var material2 = new THREE.MeshLambertMaterial( {color: 0x00ff00, side: THREE.DoubleSide, transparent:true, opacity: .5} );
var massing = new THREE.Mesh( geometry2, material2 );
var cutter_bsp = new ThreeBSP(cutter);
var massing_bsp = new ThreeBSP(massing);
var new_bsp = massing_bsp.subtract(cutter_bsp);
var result = new_bsp.toMesh(material2);
result.geometry.computeVertexNormals();
result.position.y = 200;
I am using v 103, but the issue seems to be irrelevant to version as 77 shows the same issue.
Question: Why are the result's sides flat? Do I need to convert the geometry in some way before the subtract operation?