diff --git a/js/cam/assemblers/AssemblerPost.js b/js/cam/assemblers/AssemblerPost.js index 62ed2f3234e7369c3a289c4b15b299c1dcfb1d64..55d183facd5bef6b8974542b9f03c8c68ceb871b 100644 --- a/js/cam/assemblers/AssemblerPost.js +++ b/js/cam/assemblers/AssemblerPost.js @@ -196,11 +196,13 @@ 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); + //offset for rotation + var offset = this.components.substrate.centerOfRotation.clone().multiplyScalar(settings.scale);//offset in mm + var dist = position.clone().sub(offset); + position = offset.add(new THREE.Vector3(dist.y, -dist.x, position.z)); } var stock = _.find(this.stock, function(thisStock){ diff --git a/js/cam/assemblers/Component.js b/js/cam/assemblers/Component.js index ceb9381d42b80350f045ffdb461a6e115b5572b8..919b346d3029cf2b93ffbb0cde9ced0e00005e16 100644 --- a/js/cam/assemblers/Component.js +++ b/js/cam/assemblers/Component.js @@ -209,7 +209,7 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){ if (callback) callback(); return; } - target = this.applyRotation(target);//absolute? + target = this.applyAbsoluteRotation(target);//absolute? var currentPosition = this.getPosition(); var increment = speed/1500.0*cam.get("simSpeed");