From 10c0ffb2b134623ddb97e9943a6383fa87c2cd53 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Mon, 1 Jun 2015 20:05:13 -0700
Subject: [PATCH] debugging

---
 js/cells/supercells/DMASuperCell.js | 7 ++++---
 js/cells/supercells/GIKSuperCell.js | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/js/cells/supercells/DMASuperCell.js b/js/cells/supercells/DMASuperCell.js
index b2feb87b..9e72734f 100644
--- a/js/cells/supercells/DMASuperCell.js
+++ b/js/cells/supercells/DMASuperCell.js
@@ -21,9 +21,9 @@ DMASuperCell.prototype = Object.create(DMACell.prototype);
 
 DMASuperCell.prototype._makeChildCells = function(index, range){
     var cells = [];//todo make cells a 3d array?
-    for (var x=0;i<range.x;x++){
+    for (var x=0;x<range.x;x++){
         for (var y=0;y<range.y;y++){
-            for (var z=0;i<range.z;z++){
+            for (var z=0;z<range.z;z++){
                 cells.push(this._makeSubCellForIndex({x:x, y:y, z:z}));
             }
         }
@@ -60,7 +60,8 @@ DMASuperCell.prototype.setMode = function(mode){
 };
 
 DMASuperCell.prototype.getLength = function(){
-    return this.cells.length-1;
+    if (this.cells) return this.cells.length-1;
+    return globals.lattice.get("superCellRange").x;
 };
 
 DMASuperCell.prototype.destroy = function(){
diff --git a/js/cells/supercells/GIKSuperCell.js b/js/cells/supercells/GIKSuperCell.js
index be95d73f..12e975ca 100644
--- a/js/cells/supercells/GIKSuperCell.js
+++ b/js/cells/supercells/GIKSuperCell.js
@@ -47,7 +47,7 @@ GIKSuperCell.prototype._rotateCell = function(object3D){
 };
 
 GIKSuperCell.prototype._buildMesh = function(){
-    var length = globals.lattice.get("gikLength");
+    var length = globals.lattice.get("superCellRange").x;
     var meshes = [];
     var superCellGeo = new THREE.BoxGeometry(1,1,1.28);
     superCellGeo.applyMatrix(new THREE.Matrix4().makeScale(length, 1, 1));
-- 
GitLab