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
72c9b3ff
Commit
72c9b3ff
authored
May 26, 2016
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
special meshes
parent
07efe70d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
171 additions
and
11 deletions
+171
-11
js/cells/CubeCell.js
js/cells/CubeCell.js
+40
-2
js/cells/DMACell.js
js/cells/DMACell.js
+11
-1
js/materials/DMAMaterial.js
js/materials/DMAMaterial.js
+109
-1
js/plists/MaterialsPlist.js
js/plists/MaterialsPlist.js
+11
-7
No files found.
js/cells/CubeCell.js
View file @
72c9b3ff
...
...
@@ -6,7 +6,39 @@
define
([
'
three
'
,
'
cell
'
],
function
(
THREE
,
DMACell
){
var
unitCellGeo
=
new
THREE
.
BoxGeometry
(
1
,
1
,
1
);
//var unitCellGeo = new THREE.BoxGeometry(1,1,1);
var
unitCellGeo
=
new
THREE
.
Geometry
();
//box vertices
unitCellGeo
.
vertices
=
[
new
THREE
.
Vector3
(
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
-
0.5
)
];
//box
unitCellGeo
.
faces
=
[
new
THREE
.
Face3
(
1
,
0
,
2
),
new
THREE
.
Face3
(
1
,
2
,
3
),
new
THREE
.
Face3
(
4
,
5
,
6
),
new
THREE
.
Face3
(
6
,
5
,
7
),
new
THREE
.
Face3
(
3
,
2
,
6
),
new
THREE
.
Face3
(
3
,
6
,
7
),
new
THREE
.
Face3
(
0
,
1
,
4
),
new
THREE
.
Face3
(
4
,
1
,
5
),
new
THREE
.
Face3
(
2
,
0
,
4
),
new
THREE
.
Face3
(
2
,
4
,
6
),
new
THREE
.
Face3
(
1
,
3
,
5
),
new
THREE
.
Face3
(
5
,
3
,
7
)
];
unitCellGeo
.
computeFaceNormals
();
function
CubeCell
(
json
,
superCell
){
DMACell
.
call
(
this
,
json
,
superCell
);
...
...
@@ -17,8 +49,14 @@ define(['three', 'cell'],
return
unitCellGeo
;
};
CubeCell
.
prototype
.
_getPartGeo
=
function
(){
var
mesh
=
this
.
getMaterial
().
getMesh
();
if
(
mesh
)
return
mesh
;
return
null
;
};
CubeCell
.
prototype
.
_buildWireframe
=
function
(
mesh
){
//abstract mesh representation of cell
var
wireframe
=
new
THREE
.
Box
Helper
(
mesh
);
var
wireframe
=
new
THREE
.
Edges
Helper
(
mesh
);
wireframe
.
material
.
color
.
set
(
0x000000
);
wireframe
.
matrixWorld
=
mesh
.
matrixWorld
;
wireframe
.
matrixAutoUpdate
=
true
;
...
...
js/cells/DMACell.js
View file @
72c9b3ff
...
...
@@ -59,9 +59,19 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
var
meshes
=
[];
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
this
.
getMaterial
(
true
));
mesh
.
name
=
this
.
_getMeshName
();
meshes
.
push
(
mesh
);
var
wireframe
=
this
.
_buildWireframe
(
mesh
,
geometry
);
var
wireframeMesh
=
mesh
;
var
partGeo
=
this
.
_getPartGeo
();
if
(
partGeo
){
var
partMesh
=
new
THREE
.
Mesh
(
partGeo
,
this
.
getMaterial
(
true
));
meshes
.
push
(
partMesh
);
wireframeMesh
=
partMesh
;
mesh
.
visible
=
false
;
}
var
wireframe
=
this
.
_buildWireframe
(
wireframeMesh
,
geometry
);
if
(
!
wireframe
)
return
meshes
;
wireframe
.
name
=
this
.
_getMeshName
();
meshes
.
push
(
wireframe
);
...
...
js/materials/DMAMaterial.js
View file @
72c9b3ff
...
...
@@ -7,6 +7,103 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
var
materialNum
=
1
;
//outward facing name
var
torsion1dof
=
new
THREE
.
Geometry
();
//torsion
torsion1dof
.
vertices
=
[
new
THREE
.
Vector3
(
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
-
0.5
)
];
torsion1dof
.
faces
=
[
new
THREE
.
Face3
(
5
,
0
,
2
),
new
THREE
.
Face3
(
5
,
2
,
1
),
new
THREE
.
Face3
(
4
,
3
,
6
),
new
THREE
.
Face3
(
3
,
4
,
7
),
new
THREE
.
Face3
(
1
,
2
,
6
),
new
THREE
.
Face3
(
1
,
6
,
3
),
new
THREE
.
Face3
(
0
,
7
,
4
),
new
THREE
.
Face3
(
0
,
5
,
7
),
new
THREE
.
Face3
(
2
,
0
,
4
),
new
THREE
.
Face3
(
2
,
4
,
6
),
new
THREE
.
Face3
(
1
,
3
,
5
),
new
THREE
.
Face3
(
5
,
3
,
7
)
];
var
bending1dof
=
new
THREE
.
Geometry
();
//1dof hinge vertices and faces
bending1dof
.
vertices
=
[
new
THREE
.
Vector3
(
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
0
,
0
,
0.5
),
new
THREE
.
Vector3
(
0
,
0
,
-
0.5
)
];
bending1dof
.
faces
=
[
new
THREE
.
Face3
(
1
,
0
,
2
),
new
THREE
.
Face3
(
1
,
2
,
3
),
new
THREE
.
Face3
(
4
,
5
,
6
),
new
THREE
.
Face3
(
6
,
5
,
7
),
new
THREE
.
Face3
(
3
,
2
,
8
),
new
THREE
.
Face3
(
3
,
8
,
9
),
new
THREE
.
Face3
(
9
,
6
,
7
),
new
THREE
.
Face3
(
9
,
8
,
6
),
new
THREE
.
Face3
(
0
,
1
,
8
),
new
THREE
.
Face3
(
1
,
9
,
8
),
new
THREE
.
Face3
(
4
,
9
,
5
),
new
THREE
.
Face3
(
8
,
9
,
4
),
new
THREE
.
Face3
(
2
,
0
,
8
),
new
THREE
.
Face3
(
8
,
4
,
6
),
new
THREE
.
Face3
(
1
,
3
,
9
),
new
THREE
.
Face3
(
5
,
9
,
7
)
];
var
bending2dof
=
new
THREE
.
Geometry
();
//2dof hinge vertices and faces
bending2dof
.
vertices
=
[
new
THREE
.
Vector3
(
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
0.5
,
-
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
0.5
),
new
THREE
.
Vector3
(
-
0.5
,
-
0.5
,
-
0.5
),
new
THREE
.
Vector3
(
0
,
0
,
0
)
];
bending2dof
.
faces
=
[
new
THREE
.
Face3
(
1
,
0
,
2
),
new
THREE
.
Face3
(
1
,
2
,
3
),
new
THREE
.
Face3
(
4
,
5
,
6
),
new
THREE
.
Face3
(
6
,
5
,
7
),
new
THREE
.
Face3
(
3
,
2
,
8
),
new
THREE
.
Face3
(
8
,
6
,
7
),
new
THREE
.
Face3
(
8
,
8
,
6
),
new
THREE
.
Face3
(
0
,
1
,
8
),
new
THREE
.
Face3
(
4
,
8
,
5
),
new
THREE
.
Face3
(
8
,
8
,
4
),
new
THREE
.
Face3
(
2
,
0
,
8
),
new
THREE
.
Face3
(
8
,
4
,
6
),
new
THREE
.
Face3
(
1
,
3
,
8
),
new
THREE
.
Face3
(
5
,
8
,
7
)
];
torsion1dof
.
computeFaceNormals
();
bending1dof
.
computeFaceNormals
();
bending2dof
.
computeFaceNormals
();
function
DMAMaterial
(
json
,
id
){
this
.
id
=
id
;
...
...
@@ -22,6 +119,12 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
json
=
_
.
extend
(
defaults
,
json
);
this
.
set
(
json
,
true
);
if
(
json
.
texture
)
this
.
texture
=
json
.
texture
;
if
(
json
.
mesh
)
{
if
(
json
.
mesh
==
"
torsion1dof
"
)
this
.
mesh
=
torsion1dof
;
else
if
(
json
.
mesh
==
"
bending1dof
"
)
this
.
mesh
=
bending1dof
;
else
if
(
json
.
mesh
==
"
bending2dof
"
)
this
.
mesh
=
bending2dof
;
else
console
.
warn
(
"
no mesh for type
"
+
json
.
mesh
);
}
}
DMAMaterial
.
prototype
.
getID
=
function
(){
...
...
@@ -193,6 +296,10 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
return
this
.
properties
.
k
;
};
DMAMaterial
.
prototype
.
getMesh
=
function
(){
return
this
.
mesh
;
};
DMAMaterial
.
prototype
.
canDelete
=
function
(){
return
!
this
.
noDelete
;
};
...
...
@@ -205,7 +312,8 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
altColor
:
this
.
altColor
,
noDelete
:
this
.
noDelete
,
properties
:
this
.
getProperties
(),
texture
:
this
.
texture
texture
:
this
.
texture
,
mesh
:
this
.
mesh
}
};
...
...
js/plists/MaterialsPlist.js
View file @
72c9b3ff
...
...
@@ -35,11 +35,12 @@ define([], function(){
k
:
500
}
},
hinge
1DOF
:
{
bending
1DOF
:
{
name
:
"
1 DOF Hinge
"
,
color
:
"
#cda4f3
"
,
altColor
:
"
#cda4f3
"
,
texture
:
"
stripes
"
,
mesh
:
"
bending1dof
"
,
properties
:{
conductive
:
false
,
density
:
3500
,
//kg/m^3
...
...
@@ -47,11 +48,12 @@ define([], function(){
k
:
30
}
},
hinge
2DOF
:
{
bending
2DOF
:
{
name
:
"
2 DOF Hinge
"
,
color
:
"
#cda4f3
"
,
altColor
:
"
#cda4f3
"
,
texture
:
"
stripes
"
,
mesh
:
"
bending2dof
"
,
properties
:{
conductive
:
false
,
density
:
3500
,
//kg/m^3
...
...
@@ -59,11 +61,12 @@ define([], function(){
k
:
30
}
},
flexureTorsion
:
{
torsion1DOF
:
{
name
:
"
Torsion Flexure
"
,
color
:
"
#cda4f3
"
,
altColor
:
"
#cda4f3
"
,
texture
:
"
stripes
"
,
mesh
:
"
torsion1dof
"
,
properties
:{
conductive
:
false
,
density
:
3500
,
//kg/m^3
...
...
@@ -106,7 +109,7 @@ define([], function(){
k
:
30
}
},
actuatorLinear
:
{
actuatorLinear
1DOF
:
{
name
:
"
Linear Actuator
"
,
color
:
"
#FFCC00
"
,
altColor
:
"
#FFCC00
"
,
...
...
@@ -117,10 +120,11 @@ define([], function(){
k
:
200
}
},
actuatorBend
:
{
actuatorBend
ing1DOF
:
{
name
:
"
Bending Actuator
"
,
color
:
"
#FFCC00
"
,
altColor
:
"
#FFCC00
"
,
mesh
:
"
bending1dof
"
,
properties
:{
conductive
:
false
,
density
:
6500
,
//kg/m^3
...
...
@@ -128,10 +132,11 @@ define([], function(){
k
:
200
}
},
actuatorTorsion
:
{
actuatorTorsion
1DOF
:
{
name
:
"
Torsional Actuator
"
,
color
:
"
#FFCC00
"
,
altColor
:
"
#FFCC00
"
,
mesh
:
"
torsion1dof
"
,
properties
:{
conductive
:
false
,
density
:
6500
,
//kg/m^3
...
...
@@ -229,7 +234,6 @@ define([], function(){
// elasMod: 17.2
// }
//},
piezo
:
{
name
:
"
Piezo
"
,
color
:
"
#FFCC00
"
,
...
...
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