Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
DMDesign
Commits
ca7c3de6
Commit
ca7c3de6
authored
Aug 19, 2015
by
Amanda Ghassaei
Browse files
eod
parent
f883a974
Changes
3
Hide whitespace changes
Inline
Side-by-side
js/cam/assemblers/Assembler.js
View file @
ca7c3de6
...
...
@@ -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
);
...
...
js/cam/assemblers/AssemblerPost.js
View file @
ca7c3de6
...
...
@@ -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)
...
...
js/cam/assemblers/Component.js
View file @
ca7c3de6
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment