ThreeCSG
                                
                                
                                
                                    ThreeCSG copied to clipboard
                            
                            
                            
                        How to cut object at a particular position?
Below is my code
var bBox = new THREE.Box3().setFromObject(doorMesh),
    cubeGeom = new THREE.BoxGeometry(bBox.size().x,bBox.size().y,bBox.size().z),
    cubeMesh = new THREE.Mesh(cubeGeometry,new THREE.MeshNormalMaterial),
    geom = new THREE.Geometry();
    cubeMesh.position.set(doorMesh.position.x,doorMesh.position.y,doorMesh.position.z);
    cubeMesh.updateMatrix();
    geom.merge(cubeMesh.geometry, cubeMesh.matrix);
    var cubeBsp = new ThreeBSP(geom),
          wallBsp = new ThreeBSP(wallMesh.geometry);
        var sub = wallBsp.subtract(cubeBsp);
I am doing the above steps but it's not working. However when I convert cubeGeometry to BSP instead of geom then it works but the cut is at the center of the object.