diff --git a/js/cam/Cam.js b/js/cam/Cam.js index 8ee2ac19fc970feee0c2cdde8e825d544b0ebd1a..a4582a43109f1cda1d1b1e16f40b0e7835b39cad 100644 --- a/js/cam/Cam.js +++ b/js/cam/Cam.js @@ -259,7 +259,7 @@ define(['underscore', 'three', 'backbone', 'appState', 'latticeCAM', 'threeModel if (appState.get("stockSimulationPlaying")){ three.startAnimationLoop(); var currentLine = this.get("simLineNumber"); - if (currentLine == 0) lattice.hideCells(); + if (currentLine == 0) lattice.hideCells("cells"); var allLines = this.get("dataOut").split("\n"); if(currentLine<allLines.length){ var self = this; diff --git a/js/cells/supercells/DMASuperCell.js b/js/cells/supercells/DMASuperCell.js index 81881a8d03f204bd8625a1d4569ce873f2c48981..925316bcd81da1413e5b3eb706b6de71e16b8966 100644 --- a/js/cells/supercells/DMASuperCell.js +++ b/js/cells/supercells/DMASuperCell.js @@ -114,10 +114,11 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], //parse - DMASuperCell.prototype.addToDenseArray = function(cellsArray, min){ + DMASuperCell.prototype.addToDenseArray = function(cellsArray, min, forCAM){ + if (forCAM && this._isBottomLayer()) return DMACell.prototype.addToDenseArray.call(this, cellsArray, min);//this gives back the bottom layer cell for assembly, not necessarily the lattice pitch var overlap = false; this._loopCells(function(cell){ - if (cell) overlap |= cell.addToDenseArray(cellsArray, min); + if (cell) overlap |= cell.addToDenseArray(cellsArray, min, forCAM); }); return overlap; }; diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index 0cd49e79fa7472eddfcd8b0f20320f9ce1b19ed5..8afdd8fb40d5c1d4df5272d9936507c60d1e1f62 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -161,9 +161,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre var min = this.get("cellsMin").sub(bounds.min); var overlap = false; + var forCAM = appState.get("currentNav") == "navAssemble"; + console.log(forCAM); this._loopCells(this.sparseCells, function(cell){ if (!cell) return; - overlap |= cell.addToDenseArray(cells, min); + overlap |= cell.addToDenseArray(cells, min, forCAM); }); this.set("overlapDetected", overlap); diff --git a/js/lattice/LatticeBase.js b/js/lattice/LatticeBase.js index bc7993afd6ff8dcc6a050138a453244995c9dec9..ade2d7cc8a0e8f939c35684593662a2c63007fe3 100644 --- a/js/lattice/LatticeBase.js +++ b/js/lattice/LatticeBase.js @@ -456,8 +456,9 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre else this.hideCells(); }, - hideCells: function(){ - this._iterCells(this.sparseCells, function(cell){ + hideCells: function(whichArray){ + if (!whichArray) whichArray = "sparseCells"; + this._iterCells(this[whichArray], function(cell){ if (cell) cell.hide(); }); three.render(); diff --git a/js/lattice/LatticeCAM.js b/js/lattice/LatticeCAM.js index a367a0beef8cba91a238a884021b37b89a4c8b10..bc7a87f8d0d810714365e6aa49d5a2ed42aa9e0b 100644 --- a/js/lattice/LatticeCAM.js +++ b/js/lattice/LatticeCAM.js @@ -9,7 +9,7 @@ define(['lattice', 'three'], function(lattice, THREE){ showCellAtIndex: function(index){ var latticeIndex = (new THREE.Vector3()).subVectors(index, this.get("cellsMin"));//index is probably a json object from gcode comment - var cell = this.sparseCells[latticeIndex.x][latticeIndex.y][latticeIndex.z]; + var cell = this.cells[latticeIndex.x][latticeIndex.y][latticeIndex.z]; if (cell) cell.show(); else console.warn("placing a cell that does not exist"); }, @@ -24,7 +24,7 @@ define(['lattice', 'three'], function(lattice, THREE){ firstLetter = order.charAt(0); order = order.substr(1); } - if (!cells) cells = this.sparseCells;//grab cells once at beginning and hold onto it in case changes are made while looping + if (!cells) cells = this.cells;//grab cells once at beginning and hold onto it in case changes are made while looping var newVarOrder; var newVarDim; if (firstLetter == 'X'){ diff --git a/js/plists/CamPList.js b/js/plists/CamPList.js index eb1e62622dd1bd92d915070d5a2df1bf07ce7f66..68ec428e30a5fb58ffb1a7f01eb7bf8ef06c1649 100644 --- a/js/plists/CamPList.js +++ b/js/plists/CamPList.js @@ -138,7 +138,7 @@ define(['three'], function(THREE){ camStrategy: "raster", placementOrder: "XYZ",//used for raster strategy entry camProcess: "gcode", - rapidHeight:10, + rapidHeight:40, rapidHeightRelative: true, safeHeight: 0.5, originPosition: new THREE.Vector3(0,0,0),