Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AMOEBA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
975f47f5
Commit
975f47f5
authored
Jun 24, 2016
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isotropic shear behavior
parent
11068092
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
36 deletions
+61
-36
js/menus/templates/MaterialEditorMenuView.html
js/menus/templates/MaterialEditorMenuView.html
+13
-10
js/plists/MaterialsPlist.js
js/plists/MaterialsPlist.js
+16
-16
js/simulation/function/EM/emSimLattice.js
js/simulation/function/EM/emSimLattice.js
+32
-10
No files found.
js/menus/templates/MaterialEditorMenuView.html
View file @
975f47f5
...
...
@@ -11,19 +11,22 @@ Material Properties:<br/><br/>
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
Conductive
</label>
Density (kg/m^3):
<input
data-property=
"density"
value=
"<%= properties.density %>"
placeholder=
"Density"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Material Stiffness (XYZ):
<br/><br/>
Material Stiffness (XYZ
unless noted
):
<br/><br/>
Axial K:
<input
data-property=
"longitudalK"
data-key=
"x"
value=
"<%= properties.longitudalK.x %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"longitudalK"
data-key=
"y"
value=
"<%= properties.longitudalK.y %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"longitudalK"
data-key=
"z"
value=
"<%= properties.longitudalK.z %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Shear K:
<input
data-property=
"shearK"
data-key=
"x"
value=
"<%= properties.shearK.x %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"shearK"
data-key=
"y"
value=
"<%= properties.shearK.y %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"shearK"
data-key=
"z"
value=
"<%= properties.shearK.z %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
<input
data-property=
"longitudalK"
data-key=
"y"
value=
"<%= properties.longitudalK.y %>"
placeholder=
"Y"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"longitudalK"
data-key=
"z"
value=
"<%= properties.longitudalK.z %>"
placeholder=
"Z"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Shear K (XY XZ):
<input
data-property=
"shearK"
data-key=
"xy"
value=
"<%= properties.shearK.xy %>"
placeholder=
"XY"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"shearK"
data-key=
"xz"
value=
"<%= properties.shearK.xz %>"
placeholder=
"XZ"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Shear K (YX YZ):
<input
data-property=
"shearK"
data-key=
"yx"
value=
"<%= properties.shearK.yx %>"
placeholder=
"YX"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"shearK"
data-key=
"yz"
value=
"<%= properties.shearK.yz %>"
placeholder=
"YZ"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Shear K (ZX ZY):
<input
data-property=
"shearK"
data-key=
"zx"
value=
"<%= properties.shearK.zx %>"
placeholder=
"ZX"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"shearK"
data-key=
"zy"
value=
"<%= properties.shearK.zy %>"
placeholder=
"ZY"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Bending K:
<input
data-property=
"bendingK"
data-key=
"x"
value=
"<%= properties.bendingK.x %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"bendingK"
data-key=
"y"
value=
"<%= properties.bendingK.y %>"
placeholder=
"
X
"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"bendingK"
data-key=
"z"
value=
"<%= properties.bendingK.z %>"
placeholder=
"
X
"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
<input
data-property=
"bendingK"
data-key=
"y"
value=
"<%= properties.bendingK.y %>"
placeholder=
"
Y
"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"bendingK"
data-key=
"z"
value=
"<%= properties.bendingK.z %>"
placeholder=
"
Z
"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
Torsional K:
<input
data-property=
"torsionK"
data-key=
"x"
value=
"<%= properties.torsionK.x %>"
placeholder=
"X"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"torsionK"
data-key=
"y"
value=
"<%= properties.torsionK.y %>"
placeholder=
"
X
"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"torsionK"
data-key=
"z"
value=
"<%= properties.torsionK.z %>"
placeholder=
"
X
"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
<input
data-property=
"torsionK"
data-key=
"y"
value=
"<%= properties.torsionK.y %>"
placeholder=
"
Y
"
class=
"form-control floatInput materialProperties"
type=
"text"
>
<input
data-property=
"torsionK"
data-key=
"z"
value=
"<%= properties.torsionK.z %>"
placeholder=
"
Z
"
class=
"form-control floatInput materialProperties"
type=
"text"
><br/><br/>
</div>
<br/>
<a
id=
"saveExitMenu"
href=
"#"
class=
"btn btn-block btn-lg btn-success"
>
Save Material
</a><br/>
...
...
js/plists/MaterialsPlist.js
View file @
975f47f5
...
...
@@ -32,7 +32,7 @@ define([], function(){
conductive
:
false
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -47,7 +47,7 @@ define([], function(){
conductive
:
false
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
30
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -62,7 +62,7 @@ define([], function(){
conductive
:
false
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
30
,
z
:
30
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -77,7 +77,7 @@ define([], function(){
conductive
:
false
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
30
}
}
...
...
@@ -91,7 +91,7 @@ define([], function(){
conductive
:
false
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
30
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
10
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -105,7 +105,7 @@ define([], function(){
conductive
:
false
,
density
:
8500
,
//kg/m^3
longitudalK
:{
x
:
10
,
y
:
10
,
z
:
10
},
shearK
:{
x
:
10
,
y
:
10
,
z
:
10
},
shearK
:{
x
y
:
10
,
xz
:
10
,
yx
:
10
,
yz
:
10
,
zx
:
10
,
zy
:
10
},
bendingK
:{
x
:
10
,
y
:
10
,
z
:
10
},
torsionK
:{
x
:
10
,
y
:
10
,
z
:
10
}
}
...
...
@@ -119,7 +119,7 @@ define([], function(){
conductive
:
true
,
density
:
8500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -133,7 +133,7 @@ define([], function(){
conductive
:
true
,
density
:
8500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -148,7 +148,7 @@ define([], function(){
conductive
:
true
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
30
,
y
:
30
,
z
:
30
},
shearK
:{
x
:
30
,
y
:
30
,
z
:
30
},
shearK
:{
x
y
:
30
,
xz
:
30
,
yx
:
30
,
yz
:
30
,
zx
:
30
,
zy
:
30
},
bendingK
:{
x
:
30
,
y
:
30
,
z
:
30
},
torsionK
:{
x
:
30
,
y
:
30
,
z
:
30
}
}
...
...
@@ -163,7 +163,7 @@ define([], function(){
conductive
:
true
,
density
:
3500
,
//kg/m^3
longitudalK
:{
x
:
30
,
y
:
30
,
z
:
30
},
shearK
:{
x
:
30
,
y
:
30
,
z
:
30
},
shearK
:{
x
y
:
30
,
xz
:
30
,
yx
:
30
,
yz
:
30
,
zx
:
30
,
zy
:
30
},
bendingK
:{
x
:
30
,
y
:
30
,
z
:
30
},
torsionK
:{
x
:
30
,
y
:
30
,
z
:
30
}
}
...
...
@@ -177,7 +177,7 @@ define([], function(){
conductive
:
false
,
density
:
6500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -191,7 +191,7 @@ define([], function(){
conductive
:
false
,
density
:
6500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -205,7 +205,7 @@ define([], function(){
conductive
:
false
,
density
:
6500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -218,7 +218,7 @@ define([], function(){
conductive
:
false
,
density
:
6500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -232,7 +232,7 @@ define([], function(){
conductive
:
true
,
density
:
6500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
@@ -246,7 +246,7 @@ define([], function(){
conductive
:
true
,
density
:
6500
,
//kg/m^3
longitudalK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
:
500
,
y
:
500
,
z
:
500
},
shearK
:{
x
y
:
500
,
xz
:
500
,
yx
:
500
,
yz
:
500
,
zx
:
500
,
zy
:
500
},
bendingK
:{
x
:
500
,
y
:
500
,
z
:
500
},
torsionK
:{
x
:
500
,
y
:
500
,
z
:
500
}
}
...
...
js/simulation/function/EM/emSimLattice.js
View file @
975f47f5
...
...
@@ -63,8 +63,8 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
this
.
neighborsXMapping
=
new
Float32Array
(
textureSize
*
8
);
//-1 equals no neighb
this
.
neighborsYMapping
=
new
Float32Array
(
textureSize
*
8
);
//would have done int16, but no int types have > 8 bits
this
.
compositeKs
=
new
Float32Array
(
textureSize
*
8
*
1
2
);
this
.
compositeDs
=
new
Float32Array
(
textureSize
*
8
*
1
2
);
this
.
compositeKs
=
new
Float32Array
(
textureSize
*
8
*
1
5
);
this
.
compositeDs
=
new
Float32Array
(
textureSize
*
8
*
1
5
);
//todo int array
this
.
wires
=
new
Float32Array
(
textureSize
*
4
);
//also stores actuator mask as -1
...
...
@@ -133,14 +133,24 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
self
.
neighborsYMapping
[
compositeIndex
+
neighborIndex
%
3
]
=
parseInt
(
neighborMappingIndex1D
/
textureDim
);
//todo apply rotation here
_
.
each
([
"
longitudal
"
,
"
shear
"
,
"
bending
"
,
"
torsion
"
],
function
(
dof
,
dofIndex
){
_
.
each
([
"
longitudal
"
,
"
bending
"
,
"
torsion
"
],
function
(
dof
,
dofIndex
){
var
cellK
=
self
.
_getCellK
(
cell
,
dof
);
var
neighborK
=
self
.
_getCellK
(
neighbor
,
dof
);
_
.
each
([
"
x
"
,
"
y
"
,
"
z
"
],
function
(
axis
,
axisIndex
){
var
compositeK
=
self
.
_calcCompositeParam
(
self
.
_getCellK
(
cell
,
dof
)[
axis
],
self
.
_getCellK
(
neighbor
,
dof
)
[
axis
]);
var
compositeK
=
self
.
_calcCompositeParam
(
cellK
[
axis
],
neighborK
[
axis
]);
var
offset
=
(
dofIndex
*
3
+
axisIndex
)
*
textureSize
*
8
;
self
.
compositeKs
[
compositeIndex
+
neighborIndex
%
3
+
offset
]
=
compositeK
;
self
.
compositeDs
[
compositeIndex
+
neighborIndex
%
3
+
offset
]
=
compositeK
/
1000
;
//this is arbitrary for now
});
});
var
cellK
=
self
.
_getCellK
(
cell
,
"
shear
"
);
//shear last bc it has six elements instead of 3
var
neighborK
=
self
.
_getCellK
(
neighbor
,
"
shear
"
);
_
.
each
([
"
xy
"
,
"
xz
"
,
"
yx
"
,
"
yz
"
,
"
zx
"
,
"
zy
"
],
function
(
axis
,
axisIndex
){
var
compositeK
=
self
.
_calcCompositeParam
(
cellK
[
axis
],
neighborK
[
axis
]);
var
offset
=
(
3
*
3
+
axisIndex
)
*
textureSize
*
8
;
self
.
compositeKs
[
compositeIndex
+
neighborIndex
%
3
+
offset
]
=
compositeK
;
self
.
compositeDs
[
compositeIndex
+
neighborIndex
%
3
+
offset
]
=
compositeK
/
1000
;
//this is arbitrary for now
});
...
...
@@ -618,13 +628,15 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
var
d
=
10
/
1000
;
//todo don't need all these at once
var
longitudalK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
2
*
textureSize
*
8
]];
var
shearK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
3
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
4
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
5
*
textureSize
*
8
]];
var
bendingK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
6
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
7
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
8
*
textureSize
*
8
]];
var
torsionK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
9
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
10
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
11
*
textureSize
*
8
]];
var
bendingK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
3
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
4
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
5
*
textureSize
*
8
]];
var
torsionK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
6
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
7
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
8
*
textureSize
*
8
]];
var
shearK
=
[
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
9
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
10
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
11
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
12
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
13
*
textureSize
*
8
],
this
.
compositeKs
[
neighborsIndex
+
j
%
3
+
14
*
textureSize
*
8
]];
var
longitudalD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
2
*
textureSize
*
8
]];
var
shearD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
3
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
4
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
5
*
textureSize
*
8
]];
var
bendingD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
6
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
7
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
8
*
textureSize
*
8
]];
var
torsionD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
9
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
10
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
11
*
textureSize
*
8
]];
var
bendingD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
3
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
4
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
5
*
textureSize
*
8
]];
var
torsionD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
6
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
7
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
8
*
textureSize
*
8
]];
var
shearD
=
[
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
9
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
10
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
11
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
12
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
13
*
textureSize
*
8
],
this
.
compositeDs
[
neighborsIndex
+
j
%
3
+
14
*
textureSize
*
8
]];
var
D
=
[
neighborTranslation
[
0
]
-
translation
[
0
]
+
nominalD
[
0
],
neighborTranslation
[
1
]
-
translation
[
1
]
+
nominalD
[
1
],
...
...
@@ -637,6 +649,10 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
if
(
axis
==
neighborAxis
){
_k
=
longitudalK
[
axis
];
_d
=
longitudalD
[
axis
];
}
else
{
var
shearIndex
=
this
.
_shearIndex
(
neighborAxis
,
axis
);
_k
=
shearK
[
shearIndex
];
_d
=
shearD
[
shearIndex
];
}
force
[
axis
]
+=
_k
*
(
D
[
axis
]
-
rotatedNominalD
[
axis
])
+
_d
*
(
neighborVelocity
[
axis
]
-
velocity
[
axis
]);
}
...
...
@@ -748,6 +764,12 @@ define(['underscore', 'backbone', 'threeModel', 'lattice', 'plist', 'emWire', 'G
this
.
_swapArrays
(
"
rotation
"
,
"
lastRotation
"
);
},
_shearIndex
:
function
(
neighborAxis
,
axis
){
var
index
=
neighborAxis
*
3
+
axis
-
1
;
if
(
index
<
3
)
return
index
;
return
index
-
1
;
},
_torqueAxis
:
function
(
neighbAxis
,
axis
){
if
(
0
!=
neighbAxis
&&
0
!=
axis
)
return
0
;
if
(
1
!=
neighbAxis
&&
1
!=
axis
)
return
1
;
...
...
Write
Preview
Markdown
is supported
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