diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index 59d365a3abe34a8a14d53683df8478688e4ed973..923e05a0aa36ff651809a3fb761753a183b98244 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -273,7 +273,8 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals'], } function setVisiblity(){ - var visible = !(self.superCell && self.cells);//middle layers are always hidden + var visible = true; + if (mode == "supercell") visible = !(self.superCell && self.cells);//middle layers are always hidden in supercell mode _.each(self.object3D.children, function(child){ if (child.name == "object3D") return; diff --git a/js/cells/supercells/DMASuperCell.js b/js/cells/supercells/DMASuperCell.js index c75708fa0f106870457093e5800f213cb6ac12e7..d5ec79d50cc6806f9c3cca3abdd72e7c24d8d7bf 100644 --- a/js/cells/supercells/DMASuperCell.js +++ b/js/cells/supercells/DMASuperCell.js @@ -47,7 +47,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], } else console.warn("no material for composite cell definition subcell"); }//else no cell in this spot } else {//if not from composite definition, add subcell at all possible indices in supercell range - this._makeSubCellForIndex({index: new THREE.Vector3(x,y,z), material:cellMaterial}, function(cell){ + this._makeSubCellForIndex({index: new THREE.Vector3(x,y,z), material:this.material}, function(cell){ cells[x][y][z] = cell; }); } diff --git a/js/cells/supercells/GIKSuperCell.js b/js/cells/supercells/GIKSuperCell.js index 1f4cad71aa01e579bb82f2d39081c1931286dc2b..2c2d517f0abaeee3ed31762657f0d9c6813fccc4 100644 --- a/js/cells/supercells/GIKSuperCell.js +++ b/js/cells/supercells/GIKSuperCell.js @@ -8,6 +8,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', function(_, THREE, three, lattice, appState, DMASuperCell, GIKCell){ var unitGeos = {}; + var materials = {}; function makePartWithLength(length){ var geo = new THREE.BoxGeometry(lattice.xScale(0),lattice.yScale(0),lattice.zScale(0)); @@ -38,6 +39,22 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', return unitGeos[key]; }; + GIKSuperCell.prototype.getMaterial = function(returnTHREEObject){ + if (returnTHREEObject){ + return DMASuperCell.prototype.getMaterial.call(this, returnTHREEObject); + } + return { +// name: name, + material: this.material, +// color: this.get("color"), +// altColor: this.get("color"), +// numCells: this.get("numCells"), + cellsMin: new THREE.Vector3(0,0,0), + cellsMax: new THREE.Vector3(this.getLength(), 0, 0), + dimensions: new THREE.Vector3(this.getLength()+1, 1, 1) + }; + }; + GIKSuperCell.prototype._buildWireframe = function(mesh){ var wireframe = new THREE.BoxHelper(mesh); wireframe.material.color.set(0x000000);