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
AMOEBA
Commits
42b70174
Commit
42b70174
authored
Jul 11, 2016
by
amandaghassaei
Browse files
fixed shear actuation
parent
37e761e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/simulation/function/EM/emSimLattice.js
View file @
42b70174
...
...
@@ -198,8 +198,13 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
if
(
cell
.
getMaterialID
()
==
"
actuatorLinear1DOF
"
)
self
.
wires
[
rgbaIndex
]
=
-
1
;
else
if
(
cell
.
getMaterialID
()
==
"
actuatorBending1DOF
"
)
self
.
wires
[
rgbaIndex
]
=
-
2
;
else
if
(
cell
.
getMaterialID
()
==
"
actuatorTorsion1DOF
"
)
self
.
wires
[
rgbaIndex
]
=
-
3
;
else
if
(
cell
.
getMaterialID
()
==
"
actuatorShear
"
)
self
.
wires
[
rgbaIndex
]
=
-
4
;
else
if
(
cell
.
getMaterialID
()
==
"
actuatorShear
"
)
self
.
wires
[
rgbaIndex
]
=
-
5
;
//todo fix this
else
if
(
cell
.
getMaterialID
()
==
"
actuatorShear
"
)
{
var
vector
=
new
THREE
.
Vector3
(
1
,
0
,
0
);
vector
.
applyQuaternion
(
cell
.
getOrientation
());
if
(
Math
.
abs
(
vector
.
x
)
>
0.9
)
self
.
wires
[
rgbaIndex
]
=
-
4
;
else
if
(
Math
.
abs
(
vector
.
y
)
>
0.9
)
self
.
wires
[
rgbaIndex
]
=
-
5
;
else
if
(
Math
.
abs
(
vector
.
z
)
>
0.9
)
self
.
wires
[
rgbaIndex
]
=
-
6
;
}
//use remaining three spots to indicate axial direction and wire group num
self
.
wires
[
rgbaIndex
+
1
]
=
wireIndices
[
0
];
...
...
@@ -739,7 +744,9 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
}
var
actuatedD
=
[
nominalD
[
0
],
nominalD
[
1
],
nominalD
[
2
]];
if
(
_actuatorType
==
-
1
)
actuatedD
[
neighborAxis
]
*=
1
+
actuation
;
//linear actuator
else
if
(
_actuatorType
==
-
4
)
{
actuatedD
[
1
]
+=
actuatedD
[
neighborAxis
]
*
actuation
;
//shear
else
if
(
_actuatorType
==
-
4
)
actuatedD
[
0
]
+=
actuatedD
[
neighborAxis
]
*
actuation
;
//shear x
else
if
(
_actuatorType
==
-
5
)
actuatedD
[
1
]
+=
actuatedD
[
neighborAxis
]
*
actuation
;
//shear y
else
if
(
_actuatorType
==
-
6
)
actuatedD
[
2
]
+=
actuatedD
[
neighborAxis
]
*
actuation
;
//shear z
//convert translational offsets to correct reference frame
var
halfNominalD
=
this
.
_multiplyVectorScalar
(
actuatedD
,
0.5
);
...
...
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