From 650b18d59888ed63dba9cf401ea96991b81a9700 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Tue, 30 Jun 2015 15:18:30 -0700 Subject: [PATCH] small changes --- js/cam/cam.js | 3 ++- js/lattice/Lattice.js | 2 +- js/three/FillGeometry.js | 6 ++---- todo | 17 +++++++++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/js/cam/cam.js b/js/cam/cam.js index 3cadcdea..cee5953a 100644 --- a/js/cam/cam.js +++ b/js/cam/cam.js @@ -77,6 +77,7 @@ define(['underscore', 'backbone', 'appState', 'latticeCAM', 'threeModel', 'plist this.listenTo(appState, "change:cellMode", this._updateCellMode); this.listenTo(this, "change:machineName", this.selectMachine); + this._navChanged(); // this._initOriginAndStock(); }, @@ -126,7 +127,7 @@ define(['underscore', 'backbone', 'appState', 'latticeCAM', 'threeModel', 'plist //call this each time we switch to assemble tab var availableMachines = _.keys(plist.allMachineTypes[lattice.get("cellType")][lattice.get("connectionType")]); if (availableMachines.indexOf(this.get("machineName")) < 0){ - this.set("machineName", availableMachines[0]); + this.set("machineName", availableMachines[0], {silent:true}); } }, diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index a9822cf2..06cd6f96 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -13,7 +13,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre units: "mm", cellType: "cube", - connectionType: "gik", + connectionType: "face", partType: null, nodes: [], diff --git a/js/three/FillGeometry.js b/js/three/FillGeometry.js index 6cab1f0a..0e5aacaa 100644 --- a/js/three/FillGeometry.js +++ b/js/three/FillGeometry.js @@ -47,12 +47,11 @@ define(['three', 'underscore', 'backbone', 'lattice', 'threeModel'], var scale = this.get("scale"); var offset = this.get("mesh").position.clone(); console.log(offset); - var scaledMin = boundingBox.min.clone().multiplyScalar(scale);//.add(offset) - var scaledMax = boundingBox.max.clone().multiplyScalar(scale); + var scaledMin = boundingBox.min.clone().multiplyScalar(scale).add(offset); + var scaledMax = boundingBox.max.clone().multiplyScalar(scale).add(offset); var minIndex = lattice.getIndexForPosition(scaledMin); var maxIndex = lattice.getIndexForPosition(scaledMax); - minIndex.z -= 1; console.log(minIndex); console.log(maxIndex); lattice.checkForMatrixExpansion(null, maxIndex, minIndex);//expand cells matrix before @@ -75,7 +74,6 @@ define(['three', 'underscore', 'backbone', 'lattice', 'threeModel'], for (var z=minIndex.z;z<=maxIndex.z;z++){ var index = new THREE.Vector3(x, y, z); var position = lattice.getPositionForIndex(index); - index.z -= 1; if (!inside){ if (position.z<nextIntersection) continue; else { diff --git a/todo b/todo index 91dea3c5..de049dbb 100644 --- a/todo +++ b/todo @@ -1,4 +1,13 @@ -fix parse int/float/lattice/appstate - put in menu wrapper -color swatch menu -gik position z scale -giz end positions \ No newline at end of file +import - offset, scale, rotation +fill geometry persists +parse sparseCells -> cells + +hierarchical + - gik dimensions + - origin + - rotation + - load composite materials + - change bounding box + - placement ui 3D + +rendering callbacks -- GitLab