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
DMDesign
Commits
7d0b320f
Commit
7d0b320f
authored
Aug 23, 2015
by
Amanda Ghassaei
Browse files
fixed parsing bug
parent
cd290954
Changes
4
Hide whitespace changes
Inline
Side-by-side
js/cam/assemblers/AssemblerPost.js
View file @
7d0b320f
...
@@ -125,7 +125,7 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
...
@@ -125,7 +125,7 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
//offset for rotation
//offset for rotation
var
offset
=
self
.
components
.
substrate
.
centerOfRotation
.
clone
().
multiplyScalar
(
settings
.
scale
);
//offset in lattice pitch
var
offset
=
self
.
components
.
substrate
.
centerOfRotation
.
clone
().
multiplyScalar
(
settings
.
scale
);
//offset in lattice pitch
var
dist
=
position
.
clone
().
sub
(
offset
);
var
dist
=
position
.
clone
().
sub
(
offset
);
position
=
offset
.
add
(
new
THREE
.
Vector3
(
-
dist
.
y
-
3
*
settings
.
scale
,
dist
.
x
-
0.335
,
position
.
z
));
position
=
offset
.
add
(
new
THREE
.
Vector3
(
-
dist
.
y
,
dist
.
x
-
0.335
,
position
.
z
));
}
else
{
}
else
{
position
.
y
-=
1
;
position
.
y
-=
1
;
position
.
x
-=
settings
.
scale
;
position
.
x
-=
settings
.
scale
;
...
@@ -217,6 +217,7 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
...
@@ -217,6 +217,7 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
if
(
!
cell
)
return
;
if
(
!
cell
)
return
;
var
cellPosition
=
cell
.
getAbsolutePosition
().
multiplyScalar
(
settings
.
scale
);
var
cellPosition
=
cell
.
getAbsolutePosition
().
multiplyScalar
(
settings
.
scale
);
if
(
cell
.
getMinPosition
)
cellPosition
=
cell
.
getMinPosition
().
multiplyScalar
(
settings
.
scale
);
var
cellIndex
=
cell
.
getAbsoluteIndex
();
var
cellIndex
=
cell
.
getAbsoluteIndex
();
if
(
!
self
.
shouldPickUpStock
){
if
(
!
self
.
shouldPickUpStock
){
...
...
js/cam/assemblers/Component.js
View file @
7d0b320f
...
@@ -135,7 +135,7 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
...
@@ -135,7 +135,7 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){
};
};
Component
.
prototype
.
applyRotation
=
function
(
vector
){
//todo local rotation?
Component
.
prototype
.
applyRotation
=
function
(
vector
){
//todo local rotation?
vector
.
applyQuaternion
(
this
.
get
Absolute
Orientation
());
vector
.
applyQuaternion
(
this
.
getOrientation
());
return
vector
;
return
vector
;
};
};
...
...
js/cells/DMACell.js
View file @
7d0b320f
...
@@ -126,7 +126,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
...
@@ -126,7 +126,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
};
};
DMACell
.
prototype
.
applyRotation
=
function
(
vector
){
//todo local rotation?
DMACell
.
prototype
.
applyRotation
=
function
(
vector
){
//todo local rotation?
vector
.
applyQuaternion
(
this
.
get
Absolute
Orientation
());
vector
.
applyQuaternion
(
this
.
getOrientation
());
return
vector
;
return
vector
;
};
};
...
...
js/cells/supercells/GIKSuperCell.js
View file @
7d0b320f
...
@@ -49,6 +49,15 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
...
@@ -49,6 +49,15 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
return
unitGeos
[
key
];
return
unitGeos
[
key
];
};
};
GIKSuperCell
.
prototype
.
getMinPosition
=
function
(){
//for assembly
var
position
=
this
.
getAbsolutePosition
();
var
oppPosition
=
this
.
applyAbsoluteRotation
(
new
THREE
.
Vector3
(
3
,
0
,
0
));
oppPosition
.
add
(
position
);
position
.
x
=
Math
.
min
(
position
.
x
,
oppPosition
.
x
);
position
.
y
=
Math
.
max
(
position
.
y
,
oppPosition
.
y
);
return
position
;
};
GIKSuperCell
.
prototype
.
_buildWireframe
=
function
(
mesh
){
GIKSuperCell
.
prototype
.
_buildWireframe
=
function
(
mesh
){
var
wireframe
=
new
THREE
.
BoxHelper
(
mesh
);
var
wireframe
=
new
THREE
.
BoxHelper
(
mesh
);
wireframe
.
material
.
color
.
set
(
0x000000
);
wireframe
.
material
.
color
.
set
(
0x000000
);
...
...
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