Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
7662f6db
Commit
7662f6db
authored
Jun 30, 2016
by
amandaghassaei
Browse files
eod
parent
70b52e9e
Changes
5
Show whitespace changes
Inline
Side-by-side
js/lattice/LatticeBase.js
View file @
7662f6db
...
@@ -85,7 +85,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
...
@@ -85,7 +85,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
return
new
this
.
cellSubclass
(
json
);
return
new
this
.
cellSubclass
(
json
);
},
},
addCellsInRange
:
function
(
range
,
clone
){
//add a block of cells (extrude)
addCellsInRange
:
function
(
range
,
clone
,
params
){
//add a block of cells (extrude)
var
cellOutsideCurrentBounds
=
this
.
_checkForIndexOutsideBounds
(
range
.
min
)
||
this
.
_checkForIndexOutsideBounds
(
range
.
max
);
var
cellOutsideCurrentBounds
=
this
.
_checkForIndexOutsideBounds
(
range
.
min
)
||
this
.
_checkForIndexOutsideBounds
(
range
.
max
);
if
(
cellOutsideCurrentBounds
)
this
.
_expandCellsMatrix
(
range
.
max
,
range
.
min
);
if
(
cellOutsideCurrentBounds
)
this
.
_expandCellsMatrix
(
range
.
max
,
range
.
min
);
...
@@ -99,6 +99,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
...
@@ -99,6 +99,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var
quaternion
=
null
;
var
quaternion
=
null
;
if
(
clone
){
if
(
clone
){
var
relIndex
=
index
.
clone
().
sub
(
range
.
min
);
var
relIndex
=
index
.
clone
().
sub
(
range
.
min
);
if
(
params
.
mirrorX
)
relIndex
.
x
=
range
.
max
.
x
-
range
.
min
.
x
-
relIndex
.
x
;
if
(
params
.
mirrorY
)
relIndex
.
y
=
range
.
max
.
y
-
range
.
min
.
y
-
relIndex
.
y
;
if
(
params
.
mirrorZ
)
relIndex
.
z
=
range
.
max
.
z
-
range
.
min
.
z
-
relIndex
.
z
;
var
cloneSize
=
clone
.
get
(
"
size
"
);
var
cloneSize
=
clone
.
get
(
"
size
"
);
_
.
each
(
relIndex
,
function
(
val
,
key
){
_
.
each
(
relIndex
,
function
(
val
,
key
){
relIndex
[
key
]
=
val
%
cloneSize
[
key
];
relIndex
[
key
]
=
val
%
cloneSize
[
key
];
...
@@ -107,6 +112,16 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
...
@@ -107,6 +112,16 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
if
(
!
cell
)
continue
;
if
(
!
cell
)
continue
;
materialID
=
cell
.
getMaterialID
();
materialID
=
cell
.
getMaterialID
();
quaternion
=
cell
.
getOrientation
();
quaternion
=
cell
.
getOrientation
();
if
(
materialID
==
"
conductiveJunction2
"
||
materialID
==
"
flexureCondJunction2
"
){
//todo make this better
if
(
params
.
mirrorX
)
quaternion
=
new
THREE
.
Quaternion
(
0
,
0
,
0.7071067811865476
,
0.7071067811865476
).
multiply
(
quaternion
.
clone
());
if
(
params
.
mirrorY
)
quaternion
=
new
THREE
.
Quaternion
(
0
,
0
,
-
0.7071067811865476
,
0.7071067811865476
).
multiply
(
quaternion
.
clone
());
if
(
params
.
mirrorZ
)
quaternion
=
new
THREE
.
Quaternion
(
1
,
0
,
0
,
0
).
multiply
(
quaternion
.
clone
());
}
else
{
if
(
params
.
mirrorX
)
quaternion
=
new
THREE
.
Quaternion
(
0
,
0
,
1
,
0
).
multiply
(
new
THREE
.
Quaternion
(
1
,
0
,
0
,
0
)).
multiply
(
quaternion
.
clone
());
if
(
params
.
mirrorY
)
quaternion
=
new
THREE
.
Quaternion
(
0
,
0
,
1
,
0
).
multiply
(
new
THREE
.
Quaternion
(
0
,
1
,
0
,
0
)).
multiply
(
quaternion
.
clone
());
if
(
params
.
mirrorZ
)
quaternion
=
new
THREE
.
Quaternion
(
0
,
1
,
0
,
0
).
multiply
(
new
THREE
.
Quaternion
(
0
,
0
,
1
,
0
)).
multiply
(
quaternion
.
clone
());
}
}
}
this
.
_addCellAtIndex
(
index
,
{
materialID
:
materialID
,
quaternion
:
quaternion
},
true
);
this
.
_addCellAtIndex
(
index
,
{
materialID
:
materialID
,
quaternion
:
quaternion
},
true
);
}
}
...
...
js/menus/SelectMenuView.js
View file @
7662f6db
...
@@ -38,7 +38,8 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'text!menus/templates/Sel
...
@@ -38,7 +38,8 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'text!menus/templates/Sel
_finishSelection
:
function
(
e
){
_finishSelection
:
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
globals
.
get
(
"
selection3D
"
).
finish
();
var
params
=
{
mirrorX
:
$
(
"
#mirrorX
"
).
is
(
'
:checked
'
),
mirrorY
:
$
(
"
#mirrorY
"
).
is
(
'
:checked
'
),
mirrorZ
:
$
(
"
#mirrorZ
"
).
is
(
'
:checked
'
)};
globals
.
get
(
"
selection3D
"
).
finish
(
params
);
},
},
_exitSelection
:
function
(
e
){
_exitSelection
:
function
(
e
){
...
...
js/menus/templates/SelectMenuView.html
View file @
7662f6db
...
@@ -13,6 +13,18 @@
...
@@ -13,6 +13,18 @@
<input
data-property=
"max"
data-key=
"y"
data-incr=
"<%= selection3D.sizeIncrement.y %>"
data-min=
"<%= selection3D.min.y + selection3D.sizeIncrement.y - 1 %>"
value=
"<%= selection3D.max.y %>"
placeholder=
"Y"
class=
"form-control selection3D intInput"
type=
"text"
>
<input
data-property=
"max"
data-key=
"y"
data-incr=
"<%= selection3D.sizeIncrement.y %>"
data-min=
"<%= selection3D.min.y + selection3D.sizeIncrement.y - 1 %>"
value=
"<%= selection3D.max.y %>"
placeholder=
"Y"
class=
"form-control selection3D intInput"
type=
"text"
>
<input
data-property=
"max"
data-key=
"z"
data-incr=
"<%= selection3D.sizeIncrement.z %>"
data-min=
"<%= selection3D.min.z + selection3D.sizeIncrement.z - 1 %>"
value=
"<%= selection3D.max.z %>"
placeholder=
"Z"
class=
"form-control selection3D intInput"
type=
"text"
><br/><br/>
<input
data-property=
"max"
data-key=
"z"
data-incr=
"<%= selection3D.sizeIncrement.z %>"
data-min=
"<%= selection3D.min.z + selection3D.sizeIncrement.z - 1 %>"
value=
"<%= selection3D.max.z %>"
placeholder=
"Z"
class=
"form-control selection3D intInput"
type=
"text"
><br/><br/>
<a
href=
"#"
class=
"fillCutSelection btn btn-block btn-lg btn-success"
>
Fill with Clone Region
(ENTER)
</a>
<a
href=
"#"
class=
"fillCutSelection btn btn-block btn-lg btn-success"
>
Fill with Clone Region
(ENTER)
</a>
<label
class=
"checkbox"
for=
"mirrorX"
>
<input
id=
"mirrorX"
type=
"checkbox"
value=
""
data-toggle=
"checkbox"
class=
"custom-checkbox"
>
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
Mirror X
</label>
<label
class=
"checkbox"
for=
"mirrorY"
>
<input
id=
"mirrorY"
type=
"checkbox"
value=
""
data-toggle=
"checkbox"
class=
"custom-checkbox"
>
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
Mirror Y
</label>
<label
class=
"checkbox"
for=
"mirrorZ"
>
<input
id=
"mirrorZ"
type=
"checkbox"
value=
""
data-toggle=
"checkbox"
class=
"custom-checkbox"
>
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
Mirror Z
</label><br/>
<a
href=
"#"
id=
"exitSelection"
class=
"btn btn-block btn-lg btn-default"
>
Undo Selection
(ESC)
</a><br/>
<a
href=
"#"
id=
"exitSelection"
class=
"btn btn-block btn-lg btn-default"
>
Undo Selection
(ESC)
</a><br/>
<
%
}
else
{
%
>
<
%
}
else
{
%
>
Shift + Drag to select area to paste to
<br/>
Shift + Drag to select area to paste to
<br/>
...
...
js/plists/MaterialsPlist.js
View file @
7662f6db
...
@@ -212,7 +212,7 @@ define([], function(){
...
@@ -212,7 +212,7 @@ define([], function(){
}
}
},
},
flexureCondJunction2
:{
flexureCondJunction2
:{
name
:
"
Electronic Routing (Split Type
1
)
"
,
name
:
"
Electronic Routing (Split Type
2
)
"
,
color
:
"
#b4ac9c
"
,
color
:
"
#b4ac9c
"
,
altColor
:
"
#b4ac9c
"
,
altColor
:
"
#b4ac9c
"
,
texture
:
"
stripes
"
,
texture
:
"
stripes
"
,
...
@@ -315,7 +315,7 @@ define([], function(){
...
@@ -315,7 +315,7 @@ define([], function(){
brass
:
{
brass
:
{
name
:
"
Brass
"
,
name
:
"
Brass
"
,
color
:
"
#b5a642
"
,
color
:
"
#b5a642
"
,
altColor
:
"
#
857B64
"
,
altColor
:
"
#
ababcc
"
,
properties
:
{
properties
:
{
conductive
:
true
,
conductive
:
true
,
density
:
8500
,
//kg/m^3
density
:
8500
,
//kg/m^3
...
@@ -348,7 +348,7 @@ define([], function(){
...
@@ -348,7 +348,7 @@ define([], function(){
rubber
:
{
rubber
:
{
name
:
"
Rubber
"
,
name
:
"
Rubber
"
,
color
:
"
#cda4f3
"
,
color
:
"
#cda4f3
"
,
altColor
:
"
#
cda4f3
"
,
altColor
:
"
#
f5e8d0
"
,
texture
:
"
stripes
"
,
texture
:
"
stripes
"
,
properties
:
{
properties
:
{
conductive
:
false
,
conductive
:
false
,
...
...
js/three/Selection3D.js
View file @
7662f6db
...
@@ -210,14 +210,14 @@ define(['backbone', 'underscore', 'lattice', 'three', 'threeModel', 'globals', '
...
@@ -210,14 +210,14 @@ define(['backbone', 'underscore', 'lattice', 'three', 'threeModel', 'globals', '
return
lattice
.
getCellAtIndex
(
this
.
get
(
"
min
"
).
clone
().
add
(
relIndex
));
return
lattice
.
getCellAtIndex
(
this
.
get
(
"
min
"
).
clone
().
add
(
relIndex
));
},
},
finish
:
function
(){
finish
:
function
(
cloneParams
){
if
(
globals
.
get
(
"
selectedRegion
"
))
this
.
clone
();
if
(
globals
.
get
(
"
selectedRegion
"
))
this
.
clone
(
cloneParams
);
else
if
(
this
.
get
(
"
cutMode
"
))
this
.
cut
();
else
if
(
this
.
get
(
"
cutMode
"
))
this
.
cut
();
else
this
.
fill
();
else
this
.
fill
();
},
},
clone
:
function
(){
clone
:
function
(
params
){
lattice
.
addCellsInRange
({
min
:
this
.
get
(
"
min
"
).
clone
(),
max
:
this
.
get
(
"
max
"
).
clone
()},
globals
.
get
(
"
selectedRegion
"
));
lattice
.
addCellsInRange
({
min
:
this
.
get
(
"
min
"
).
clone
(),
max
:
this
.
get
(
"
max
"
).
clone
()},
globals
.
get
(
"
selectedRegion
"
)
,
params
);
appState
.
set
(
"
showOneLayer
"
,
false
);
appState
.
set
(
"
showOneLayer
"
,
false
);
globals
.
destroySelection3D
();
globals
.
destroySelection3D
();
},
},
...
...
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