Skip to content

Commit

Permalink
Fix a bug causing the cutting plane on the scaffoldmaker from expandi…
Browse files Browse the repository at this point in the history
…ng beyond unreasonable size.
  • Loading branch information
alan-wu committed Mar 29, 2019
1 parent 2ae1272 commit e6d1536
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utilities/csg.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ exports.csg = function(sceneIn, zincRendererIn) {
boxGeometry.morph.visible = false;
if (plane === undefined) {
plane = new THREE.Plane(new THREE.Vector3(0, 0, -1), 0);
}
if (planeHelper === undefined) {
planeHelper = new THREE.PlaneHelper(plane, 1, 0xff0000);
scene.addObject(planeHelper);
}
Expand Down Expand Up @@ -392,6 +394,9 @@ exports.csg = function(sceneIn, zincRendererIn) {
zincCSG = undefined;
boxGeometry = undefined;
currentGeometry = undefined;
if (scene)
scene.removeObject(planeHelper);
planeHelper = undefined;
createCube(1, 1, 0.0005);
}

Expand Down

0 comments on commit e6d1536

Please sign in to comment.