diff --git a/js/cam/cam.js b/js/cam/cam.js index 3cadcdea5f1dcf002f5c66c6dc949da2d10f2d30..cee5953ac479f7acc66d1ef4196bc87fb3daec56 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 a9822cf2d8e7c3a33579ebc98fadda7738a7ebc3..06cd6f9612dedf31255c9efb45b41bf3d6d788b5 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 6cab1f0a3fe529e91b54e19b31dd0c2e5d317c46..0e5aacaa321fe8752fc8f0423d7959627c75ffef 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 91dea3c526434c31102c9aaf1e9f6929adb4b2ef..de049dbba222813108327b7e183293bff823746c 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