Skip to content
Snippets Groups Projects
Commit 7b4f0a6a authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

debugging

parent 20466cd0
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ Machine.prototype.setVisibility = function(visible){ ...@@ -27,7 +27,7 @@ Machine.prototype.setVisibility = function(visible){
}; };
Machine.prototype._setMeshesVisiblity = function(visible){ Machine.prototype._setMeshesVisiblity = function(visible){
_.each(this.meshes, function(mesh){ _.each(_.values(this.meshes), function(mesh){
mesh.visible = visible; mesh.visible = visible;
}); });
}; };
...@@ -206,16 +206,16 @@ OneBitBot.prototype._buildMeshes = function(callback){ ...@@ -206,16 +206,16 @@ OneBitBot.prototype._buildMeshes = function(callback){
} }
var loader = new THREE.STLLoader(); var loader = new THREE.STLLoader();
loader.load("assets/stls/oneBitBot/zAxis.STL", function(geometry){ loader.load("assets/stls/oneBitBot/zAxis.STL", function(geometry){
geometryPrep(geometry); geometryPrep(geometry, "zAxis");
}); });
loader.load("assets/stls/oneBitBot/zDrive.STL", function(geometry){ loader.load("assets/stls/oneBitBot/zDrive.STL", function(geometry){
geometryPrep(geometry); geometryPrep(geometry, "zDrive");
}); });
loader.load("assets/stls/oneBitBot/yAxisMount.STL", function(geometry){ loader.load("assets/stls/oneBitBot/yAxisMount.STL", function(geometry){
geometryPrep(geometry); geometryPrep(geometry, "yAxisMount");
}); });
loader.load("assets/stls/oneBitBot/basePlate.STL", function(geometry){ loader.load("assets/stls/oneBitBot/basePlate.STL", function(geometry){
geometryPrep(geometry); geometryPrep(geometry, "basePlate");
}); });
}; };
...@@ -226,16 +226,17 @@ OneBitBot.prototype._moveTo = function(x, y, z, speed, wcs, callback){ ...@@ -226,16 +226,17 @@ OneBitBot.prototype._moveTo = function(x, y, z, speed, wcs, callback){
if (totalThreads > 0) return; if (totalThreads > 0) return;
callback(); callback();
} }
speed = this._normalizeSpeed(this.meshes[0].position, x, y, this._reorganizeSpeed(speed)); var startingPos = this.meshes["basePlate"].position.clone();
this._moveAxis(x, "x", speed.x, sketchyCallback); speed = this._normalizeSpeed(startingPos, x, y, this._reorganizeSpeed(speed));
this._moveAxis(y, "y", speed.y, sketchyCallback); this._moveAxis(startingPos.x, x, "x", speed.x, sketchyCallback);
this._moveAxis(z, "z", speed.z, sketchyCallback); this._moveAxis(startingPos.y, y, "y", speed.y, sketchyCallback);
this._moveAxis(startingPos.z, z, "z", speed.z, sketchyCallback);
}; };
OneBitBot.prototype._moveAxis = function(target, axis, speed, callback){ OneBitBot.prototype._moveAxis = function(startingPos, target, axis, speed, callback){
if (target == null || target === undefined) { if (target == null || target === undefined) {
callback(); callback();
return; return;
} }
this._animateObjects(_.values(this.meshes).concat(this.cell), axis, speed, this.meshes[0].position[axis], target, callback); this._animateObjects(_.values(this.meshes).concat(this.cell), axis, speed, startingPos, target, callback);
}; };
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment