diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index 28e2757cb4d3c7011384483333fe1bd6546d05c8..cdad1a395f9aa10ad888baa1615914dc88373505 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -339,6 +339,13 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals'], }; DMACell.prototype.destroyParts = function(){ + if (!this.parts && !this.cells) return; + if (this.cells){ + _.each(this.cells, function(cell){ + if (cell) cell.destroyParts(); + }); + return; + } if (!this.parts) return; _.each(this.parts, function(part){ if (part) part.destroy(); diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index d170a147f2efc218e47d198c0c1fce57ea3aac98..a5cdd3bc31674a72c3199c5af2cd49291e1041c2 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -329,7 +329,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre //events _updatePartType: function(){ - this._iterCells(this.cells, function(cell){ + this._iterCells(this.sparseCells, function(cell){ if (cell) cell.destroyParts(); }); this._updateForMode(); diff --git a/js/parts/OctaEdgeVoxPartLowPoly.js b/js/parts/OctaEdgeVoxPartLowPoly.js index 8f6d785a758b8070042dcab132bdfa96362ec732..90580fe3dc5d335a7af0d76936568c72f7df4de0 100644 --- a/js/parts/OctaEdgeVoxPartLowPoly.js +++ b/js/parts/OctaEdgeVoxPartLowPoly.js @@ -10,6 +10,7 @@ define(['underscore', 'three', 'part', 'bin!octaEdgeVoxPartLowPolySTL', 'stlLoad unitGeo.computeBoundingBox(); var unitScale = 0.706/unitGeo.boundingBox.max.y; unitGeo.applyMatrix(new THREE.Matrix4().makeScale(unitScale, unitScale, unitScale)); + unitGeo.applyMatrix(new THREE.Matrix4().makeRotationZ(Math.PI/4)); function OctaEdgeVoxPartLowPoly(type, parent){ DMAPart.call(this, type, parent);