Commit ca7c3de6 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

eod

parent f883a974
......@@ -237,7 +237,11 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
}
var startingPos = this.components.xAxis.getPosition().add(this.components.frame.getPosition().add(this.components.zAxis.getPosition()));//this.components.zAxis.getAbsolutePosition();//get position of end effector
console.log("here");
console.log(startingPos);//this.components.zAxis.applyAbsoluteRotation(
console.log(position);
speed = this._normalizeSpeed(startingPos, position, new THREE.Vector3(speed, speed, speed));//todo fix this
this.components.xAxis.moveTo(position, speed.x, sketchyCallback);
this.components.frame.moveTo(position, speed.y, sketchyCallback);
this.components.zAxis.moveTo(position, speed.z, sketchyCallback);
......@@ -247,6 +251,7 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
if (position.x === null && position.y === null) return speed;
var deltaX = position.x-startingPos.x;
var deltaY = position.y-startingPos.y;
console.log(deltaX + " " + deltaY);
var totalDistance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
if (totalDistance == 0) return speed;
speed.x = Math.abs(deltaX/totalDistance*speed.x);
......
......@@ -195,6 +195,14 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
AssemblerPost.prototype._postReleaseStock = function(index, position, material, settings, exporter, context){
var data = "";
//offset for rotation
var offset = this.components.substrate.centerOfRotation.clone().multiplyScalar(settings.scale);
// position.add(new THREE.Vector3(18.23*((index.z)%2), 0.3*((index.z)%2), 0));
if (index.z%2 != 0){
position = new THREE.Vector3(-position.y, position.x, position.z);
}
var stock = _.find(this.stock, function(thisStock){
return thisStock.getMaterial() == material
});
......@@ -205,7 +213,7 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
position.sub(stock.getPosition().multiplyScalar(settings.scale));
position.sub(settings.originPosition);
// position.add(new THREE.Vector3(18.23*((index.z+1)%2), 0.3*((index.z+1)%2), 0));
// (5.08mm, 5.715mm)
// x = part_pos[0]*1.27 + 18.23*((layer+1)%2)
......
......@@ -209,8 +209,9 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
if (callback) callback();
return;
}
target = this.applyRotation(target);//absolute?
var currentPosition = this.getPosition();//local position
var currentPosition = this.getPosition();
var increment = speed/1500.0*cam.get("simSpeed");
var incrVector = target.clone().sub(currentPosition);
......@@ -232,9 +233,9 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
return target.multiply(motion);
};
Component.prototype.getThisDistanceToTarget = function(target){
return target.clone().multiply(this.getAbsoluteMotionVector());
};
// Component.prototype.getThisDistanceToTarget = function(target){
// return target.clone().multiply(this.getAbsoluteMotionVector());
// };
Component.prototype._incrementalMove = function(increment, target, callback){
var self = this;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment