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
D
DMDesign
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
DMDesign
Commits
dcea419d
Commit
dcea419d
authored
Sep 12, 2015
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lattice aspect ratio moving to plist
parent
42a715a0
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
57 additions
and
219 deletions
+57
-219
js/cells/DMACell.js
js/cells/DMACell.js
+3
-3
js/cells/supercells/GIKSuperCell.js
js/cells/supercells/GIKSuperCell.js
+1
-1
js/lattice/Lattice.js
js/lattice/Lattice.js
+16
-16
js/lattice/latticeSubclasses/CubeLattice.js
js/lattice/latticeSubclasses/CubeLattice.js
+0
-14
js/lattice/latticeSubclasses/GIKLattice.js
js/lattice/latticeSubclasses/GIKLattice.js
+0
-14
js/lattice/latticeSubclasses/HexagonalLattice.js
js/lattice/latticeSubclasses/HexagonalLattice.js
+0
-15
js/lattice/latticeSubclasses/HexagonalRotLattice.js
js/lattice/latticeSubclasses/HexagonalRotLattice.js
+0
-15
js/lattice/latticeSubclasses/KelvinLattice.js
js/lattice/latticeSubclasses/KelvinLattice.js
+0
-14
js/lattice/latticeSubclasses/OctaEdgeLattice.js
js/lattice/latticeSubclasses/OctaEdgeLattice.js
+0
-14
js/lattice/latticeSubclasses/OctaFaceLattice.js
js/lattice/latticeSubclasses/OctaFaceLattice.js
+0
-14
js/lattice/latticeSubclasses/OctaRotEdgeLattice.js
js/lattice/latticeSubclasses/OctaRotEdgeLattice.js
+0
-14
js/lattice/latticeSubclasses/OctaVertexLattice.js
js/lattice/latticeSubclasses/OctaVertexLattice.js
+0
-14
js/lattice/latticeSubclasses/TetraStackedLattice.js
js/lattice/latticeSubclasses/TetraStackedLattice.js
+0
-14
js/lattice/latticeSubclasses/TetraVertexLattice.js
js/lattice/latticeSubclasses/TetraVertexLattice.js
+0
-14
js/lattice/latticeSubclasses/TruncatedCubeLattice.js
js/lattice/latticeSubclasses/TruncatedCubeLattice.js
+0
-14
js/menus/LatticeMenuView.js
js/menus/LatticeMenuView.js
+1
-6
js/menus/templates/LatticeMenuView.html
js/menus/templates/LatticeMenuView.html
+1
-5
js/menus/templates/PartMenuView.html
js/menus/templates/PartMenuView.html
+1
-4
js/plists/PList.js
js/plists/PList.js
+33
-13
js/simulation/electronics/LatticeEsim.js
js/simulation/electronics/LatticeEsim.js
+1
-1
No files found.
js/cells/DMACell.js
View file @
dcea419d
...
...
@@ -399,15 +399,15 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
};
DMACell
.
prototype
.
xScale
=
function
(){
return
lattice
.
xScale
(
0
);
return
lattice
.
xScale
();
};
DMACell
.
prototype
.
yScale
=
function
(){
return
lattice
.
yScale
(
0
);
return
lattice
.
yScale
();
};
DMACell
.
prototype
.
zScale
=
function
(){
return
lattice
.
zScale
(
0
);
return
lattice
.
zScale
();
};
...
...
js/cells/supercells/GIKSuperCell.js
View file @
dcea419d
...
...
@@ -10,7 +10,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
var
unitGeos
=
{};
function
makePartWithLength
(
length
){
var
geo
=
new
THREE
.
BoxGeometry
(
lattice
.
xScale
(
0
),
lattice
.
yScale
(
0
),
lattice
.
zScale
(
0
));
var
geo
=
new
THREE
.
BoxGeometry
(
lattice
.
xScale
(
),
lattice
.
yScale
(),
lattice
.
zScale
(
));
geo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeScale
(
length
,
1
,
1
));
geo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
length
/
2
-
0.5
,
0
,
0
));
return
geo
;
...
...
js/lattice/Lattice.js
View file @
dcea419d
...
...
@@ -23,21 +23,17 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
denseCellsMin
:
null
,
overlapDetected
:
false
,
nodes
:
[],
cellSeparation
:
{
xy
:
0
,
z
:
0
}
//spacing for connectors/joints
nodes
:
[]
}),
__initialize
:
function
(){
//todo change latticeType
this
.
listenTo
(
this
,
"
change:partType change:latticeType
"
,
this
.
_updatePartType
);
this
.
listenTo
(
this
,
"
change:cellType change:connectionType
"
,
function
(){
this
.
_updateLatticeConfig
();
//pass no params
});
this
.
listenTo
(
this
,
"
change:latticeType
"
,
this
.
_updateLatticeType
);
this
.
listenTo
(
this
,
"
change:cellSeparation
"
,
this
.
_updateCellSeparation
);
this
.
listenTo
(
appState
,
"
change:currentNav
"
,
this
.
_navChanged
);
this
.
listenTo
(
this
,
"
change:cellsMin change:cellsMax
"
,
function
(){
...
...
@@ -85,6 +81,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var
newMaterialClass
=
(
latticeData
.
materialClasses
||
_
.
keys
(
plist
.
allMaterialClasses
))[
0
];
appState
.
set
(
"
materialClass
"
,
newMaterialClass
);
if
(
latticeData
.
options
){
if
(
latticeData
.
options
.
gikLength
)
appState
.
set
(
"
gikLength
"
,
latticeData
.
options
.
gikLength
);
}
},
_setDefaultCellMode
:
function
(){
//if no part associated with this lattice type
...
...
@@ -107,25 +107,25 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
subclass
;
},
xScale
:
function
(){
return
this
.
get
(
"
aspectRatio
"
).
x
;
},
yScale
:
function
(){
return
this
.
get
(
"
aspectRatio
"
).
y
;
},
zScale
:
function
(){
return
this
.
get
(
"
aspectRatio
"
).
z
;
},
//events
_updateCellSeparation
:
function
(){
var
cellSep
=
this
.
get
(
"
cellSeparation
"
);
globals
.
basePlane
.
updateXYSeparation
(
cellSep
.
xy
);
var
cellMode
=
appState
.
get
(
"
cellMode
"
);
var
partType
=
this
.
get
(
"
partType
"
);
// this._iterCells(this.cells, function(cell){
// if (cell) cell.updateForScale(cellMode, partType);
// });
three
.
render
();
},
//events
__clearCells
:
function
(
silent
){
three
.
removeAllCells
();
//todo add flag in cell destroy to avoid redundancy here
...
...
js/lattice/latticeSubclasses/CubeLattice.js
View file @
dcea419d
...
...
@@ -28,20 +28,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
this
.
_positionForIndex
(
index
);
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
1
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
cubeCell
"
;
},
...
...
js/lattice/latticeSubclasses/GIKLattice.js
View file @
dcea419d
...
...
@@ -29,20 +29,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
this
.
_positionForIndex
(
index
);
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
1.28
*
(
1
+
2
*
cellSeparation
);
},
_zIndexRotation
:
function
(
index
){
if
(
index
.
z
%
2
==
0
)
return
Math
.
PI
/
2
;
return
0
;
...
...
js/lattice/latticeSubclasses/HexagonalLattice.js
View file @
dcea419d
...
...
@@ -36,21 +36,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
position
;
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
Math
.
sqrt
(
3
)
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1.5
+
2
*
cellSeparation
;
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
1
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
hexCell
"
;
},
...
...
js/lattice/latticeSubclasses/HexagonalRotLattice.js
View file @
dcea419d
...
...
@@ -42,21 +42,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
position
;
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
3
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
Math
.
sqrt
(
3
)
/
2
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
hexRotCell
"
;
},
...
...
js/lattice/latticeSubclasses/KelvinLattice.js
View file @
dcea419d
...
...
@@ -29,20 +29,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
this
.
_positionForIndex
(
index
);
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
2
*
Math
.
sqrt
(
2
)
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
2
*
Math
.
sqrt
(
2
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
kelvinCell
"
;
},
...
...
js/lattice/latticeSubclasses/OctaEdgeLattice.js
View file @
dcea419d
...
...
@@ -66,20 +66,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
// return position;
// },
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
)
/
2
*
Math
.
sqrt
(
3
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
2
/
Math
.
sqrt
(
6
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
octaEdgeCell
"
;
},
...
...
js/lattice/latticeSubclasses/OctaFaceLattice.js
View file @
dcea419d
...
...
@@ -35,20 +35,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
position
;
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
)
/
2
*
Math
.
sqrt
(
3
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
2
/
Math
.
sqrt
(
6
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
octaFaceCell
"
;
},
...
...
js/lattice/latticeSubclasses/OctaRotEdgeLattice.js
View file @
dcea419d
...
...
@@ -39,20 +39,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
position
;
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
Math
.
sqrt
(
2
)
/
2
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
octaRotEdgeCell
"
;
},
...
...
js/lattice/latticeSubclasses/OctaVertexLattice.js
View file @
dcea419d
...
...
@@ -28,20 +28,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
this
.
_positionForIndex
(
index
);
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
Math
.
sqrt
(
2
)
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
Math
.
sqrt
(
2
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
octaVertexCell
"
;
},
...
...
js/lattice/latticeSubclasses/TetraStackedLattice.js
View file @
dcea419d
...
...
@@ -35,20 +35,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
position
;
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
)
/
2
*
Math
.
sqrt
(
3
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
2
/
Math
.
sqrt
(
6
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
tetraStackedCell
"
;
},
...
...
js/lattice/latticeSubclasses/TetraVertexLattice.js
View file @
dcea419d
...
...
@@ -37,20 +37,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
position
;
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
1
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
)
/
2
*
Math
.
sqrt
(
3
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
2
/
Math
.
sqrt
(
6
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
tetraVertexCell
"
;
},
...
...
js/lattice/latticeSubclasses/TruncatedCubeLattice.js
View file @
dcea419d
...
...
@@ -29,20 +29,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
this
.
_positionForIndex
(
index
);
},
xScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
xy
;
return
Math
.
sqrt
(
2
)
+
2
*
cellSeparation
;
},
yScale
:
function
(
cellSeparation
){
return
this
.
xScale
(
cellSeparation
);
},
zScale
:
function
(
cellSeparation
){
if
(
cellSeparation
===
undefined
)
cellSeparation
=
this
.
get
(
"
cellSeparation
"
).
z
;
return
Math
.
sqrt
(
2
)
+
2
*
cellSeparation
;
},
getCellSubclassFile
:
function
(){
return
"
truncatedCubeCell
"
;
},
...
...
js/menus/LatticeMenuView.js
View file @
dcea419d
...
...
@@ -21,9 +21,4 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'text!latticeM
template
:
_
.
template
(
template
)
});
});
//Cell Separation <% if (connectionType != "freeformFace"){ %>(xy, z): <input data-type="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control numberInput cellSeparation" type="text">\
// <input data-type="z" value="<%= cellSeparation.z %>" placeholder="Z" class="form-control numberInput cellSeparation" type="text">\
//<% } else { %>( radial ): <input data-type="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control numberInput cellSeparation" type="text"><% } %>\
//<br/><br/>\
\ No newline at end of file
});
\ No newline at end of file
js/menus/templates/LatticeMenuView.html
View file @
dcea419d
...
...
@@ -33,8 +33,4 @@ Aspect Ratio:
Part Length:
<input
data-property=
"gikLength"
value=
"<%= gikLength %>"
placeholder=
"Length"
class=
"form-control intInput appState"
type=
"text"
><br/><br/>
<
%
}
%
>
<a
href=
"#"
class=
"clearCells btn btn-block btn-lg btn-danger"
>
Clear All Cells
</a><br/>
Num Cells:
<
%=
numCells
%
><br/>
<!--//Cell Separation <% if (connectionType != "freeformFace"){ %>(xy, z): <input data-type="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control numberInput cellSeparation" type="text">-->
<!--// <input data-type="z" value="<%= cellSeparation.z %>" placeholder="Z" class="form-control numberInput cellSeparation" type="text">-->
<!--//<% } else { %>( radial ): <input data-type="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control numberInput cellSeparation" type="text"><% } %>-->
<!--//<br/><br/>-->
\ No newline at end of file
Num Cells:
<
%=
numCells
%
><br/>
\ No newline at end of file
js/menus/templates/PartMenuView.html
View file @
dcea419d
...
...
@@ -7,7 +7,4 @@ Part Type:
<li><a
class=
"lattice dropdownSelector"
data-property=
"partType"
data-value=
"<%= key %>"
href=
"#"
><
%=
val.name
%
></a></li>
<
%
});
%
>
</ul>
</div><br/><br/>
<!--Cell Separation (xy, z): <input data-property="cellSeparation" data-key="xy" value="<%= cellSeparation.xy %>" placeholder="XY" class="form-control floatInput lattice" type="text">
<input data-property="cellSeparation" data-key="z" value="<%= cellSeparation.z %>" placeholder="Z" class="form-control floatInput lattice" type="text">
<br/><br/>-->
<br/>
\ No newline at end of file
</div><br/><br/>
\ No newline at end of file
js/plists/PList.js
View file @
dcea419d
...
...
@@ -103,13 +103,13 @@ define(['three'], function(THREE){
name
:
"
Triangle
"
}
},
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
),
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
/
2
*
Math
.
sqrt
(
3
),
2
/
Math
.
sqrt
(
6
)
),
materialClasses
:
[
'
mechanical
'
]
},
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
/
2
*
Math
.
sqrt
(
3
),
2
/
Math
.
sqrt
(
6
)
)
}
}
},
...
...
@@ -131,13 +131,13 @@ define(['three'], function(THREE){
name
:
"
Snap Voxel (low res)
"
}
},
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
),
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
Math
.
sqrt
(
2
)
/
2
),
materialClasses
:
[
'
mechanical
'
]
},
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
Math
.
sqrt
(
2
)
/
2
)
}
}
},
...
...
@@ -159,13 +159,13 @@ define(['three'], function(THREE){
}
// xShape:"X"
},
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
),
aspectRatio
:
new
THREE
.
Vector3
(
Math
.
sqrt
(
2
),
Math
.
sqrt
(
2
),
Math
.
sqrt
(
2
)
),
materialClasses
:
[
'
mechanical
'
]
},
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
Math
.
sqrt
(
2
),
Math
.
sqrt
(
2
),
Math
.
sqrt
(
2
)
)
}
}
}
...
...
@@ -181,11 +181,12 @@ define(['three'], function(THREE){
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
/
2
*
Math
.
sqrt
(
3
),
2
/
Math
.
sqrt
(
6
)
)
}
}
}
}
//vetex (1, 1//2*Math.sqrt(3), 2/Math.sqrt(6))
},
cube
:
{
name
:
"
Cube
"
,
...
...
@@ -215,8 +216,27 @@ define(['three'], function(THREE){
name
:
"
Micro LEGO (low res)
"
}
},
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1.28
),
materialClasses
:
[
'
electronic
'
]
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
5
),
//1.28
materialClasses
:
[
'
electronic
'
],
options
:
{
gikLength
:
4
}
},
dnaBricks
:
{
name
:
"
DNA Bricks
"
,
parts
:
{
dnaLego
:
{
name
:
"
Lego Blocks
"
},
dnaStraight
:
{
name
:
"
DNA (straight chains)
"
}
},
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
),
materialClasses
:
[
'
mechanical
'
],
options
:
{
gikLength
:
2
}
},
default
:
{
name
:
"
Default
"
,
...
...
@@ -237,7 +257,7 @@ define(['three'], function(THREE){
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
Math
.
sqrt
(
2
),
Math
.
sqrt
(
2
),
Math
.
sqrt
(
2
)
)
}
}
}
...
...
@@ -253,7 +273,7 @@ define(['three'], function(THREE){
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
2
*
Math
.
sqrt
(
2
),
2
*
Math
.
sqrt
(
2
),
2
*
Math
.
sqrt
(
2
)
)
}
}
}
...
...
@@ -269,7 +289,7 @@ define(['three'], function(THREE){
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
Math
.
sqrt
(
3
),
1.5
,
1
)
}
}
},
...
...
@@ -280,7 +300,7 @@ define(['three'], function(THREE){
default
:
{
name
:
"
Default
"
,
parts
:
null
,
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
aspectRatio
:
new
THREE
.
Vector3
(
3
,
1
,
Math
.
sqrt
(
3
)
/
2
)
}
}
}
...
...
js/simulation/electronics/LatticeEsim.js
View file @
dcea419d
...
...
@@ -104,7 +104,7 @@ define(['lattice', 'appState', 'three', 'threeModel', 'numeric', 'eSim', 'eSimFi
}
});
var
offset
=
this
.
get
(
"
cellsMin
"
).
clone
().
sub
(
new
THREE
.
Vector3
(
1
/
(
2
*
resolution
)
+
this
.
xScale
(
0
)
/
2
,
1
/
(
2
*
resolution
)
+
this
.
yScale
(
0
)
/
2
,
1
/
(
2
*
resolution
)
+
this
.
zScale
(
0
)
/
2
));
var
offset
=
this
.
get
(
"
cellsMin
"
).
clone
().
sub
(
new
THREE
.
Vector3
(
1
/
(
2
*
resolution
)
+
this
.
xScale
(
)
/
2
,
1
/
(
2
*
resolution
)
+
this
.
yScale
()
/
2
,
1
/
(
2
*
resolution
)
+
this
.
zScale
(
)
/
2
));
var
dataRange
=
[];
_
.
each
(
conductorGroups
,
function
(
group
){
dataRange
.
push
(
group
.
voltage
);
...
...
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