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
942cac95
Commit
942cac95
authored
Aug 18, 2015
by
Amanda Ghassaei
Browse files
gik cell orientation worked out
parent
320f600a
Changes
5
Hide whitespace changes
Inline
Side-by-side
js/cam/assemblers/Assembler.js
View file @
942cac95
...
...
@@ -339,10 +339,10 @@ define(['underscore', 'appState', 'lattice', 'stlLoader', 'threeModel', 'cam', '
if
(
totalThreads
>
0
)
return
;
callback
();
}
var
startingPos
=
{
x
:
this
.
components
.
x
Axis
.
getPosition
().
x
,
y
:
this
.
components
.
y
Axis
.
getPosition
().
y
,
z
:
this
.
components
.
zAxis
.
getPosition
().
z
};
var
startingPos
=
{
x
:
this
.
components
.
y
Axis
.
getPosition
().
x
,
y
:
this
.
components
.
x
Axis
.
getPosition
().
y
,
z
:
this
.
components
.
zAxis
.
getPosition
().
z
};
speed
=
this
.
_normalizeSpeed
(
startingPos
,
position
,
new
THREE
.
Vector3
(
speed
,
speed
,
speed
));
this
.
components
.
x
Axis
.
moveTo
(
this
.
_makeAxisVector
(
position
,
"
x
"
),
speed
.
x
,
sketchyCallback
);
this
.
components
.
y
Axis
.
moveTo
(
this
.
_makeAxisVector
(
position
,
"
y
"
),
speed
.
y
,
sketchyCallback
);
this
.
components
.
y
Axis
.
moveTo
(
this
.
_makeAxisVector
(
position
,
"
x
"
),
speed
.
x
,
sketchyCallback
);
this
.
components
.
x
Axis
.
moveTo
(
this
.
_makeAxisVector
(
position
,
"
y
"
),
speed
.
y
,
sketchyCallback
);
this
.
components
.
zAxis
.
moveTo
(
this
.
_makeAxisVector
(
position
,
"
z
"
),
speed
.
z
,
sketchyCallback
);
};
...
...
js/highlighter/SuperCellHighlighter.js
View file @
942cac95
...
...
@@ -43,7 +43,6 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', '
if
(
!
this
.
highlightedObject
)
return
;
var
index
=
this
.
highlightedObject
.
getAbsoluteIndex
();
if
(
Math
.
abs
(
direction
.
z
)
>
0.9
)
index
.
z
+=
1
;
else
if
(
Math
.
abs
(
direction
.
z
)
<
0.1
)
index
.
z
-=
1
;
if
(
appState
.
_drawingWithCompositeMaterialType
())
this
.
mesh
.
rotation
.
set
(
0
,
0
,
lattice
.
_zIndexRotationSuperCell
(
index
));
else
this
.
mesh
.
rotation
.
set
(
0
,
0
,
lattice
.
_zIndexRotation
(
index
));
}
...
...
@@ -69,7 +68,6 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', '
var
offset
=
appState
.
get
(
"
superCellIndex
"
).
clone
();
offset
.
applyQuaternion
(
this
.
mesh
.
quaternion
).
round
();
newIndex
.
sub
(
offset
);
console
.
log
(
newIndex
.
clone
());
return
newIndex
;
}
});
...
...
js/lattice/Lattice.js
View file @
942cac95
...
...
@@ -143,7 +143,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var
min
=
this
.
get
(
"
cellsMin
"
).
sub
(
bounds
.
min
);
var
overlap
=
false
;
var
forCAM
=
appState
.
get
(
"
currentNav
"
)
==
"
navAssemble
"
;
console
.
log
(
forCAM
);
this
.
_loopCells
(
this
.
sparseCells
,
function
(
cell
){
if
(
!
cell
)
return
;
overlap
|=
cell
.
addToDenseArray
(
cells
,
min
,
forCAM
);
...
...
js/lattice/LatticeBase.js
View file @
942cac95
...
...
@@ -205,7 +205,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
if
(
cell
){
var
material
=
cell
.
getMaterial
();
var
dimensions
=
material
.
dimensions
;
if
(
dimensions
)
dimensions
.
clone
();
if
(
dimensions
)
dimensions
=
dimensions
.
clone
();
else
dimensions
=
new
THREE
.
Vector3
(
cell
.
length
,
1
,
1
);
dimensions
.
sub
(
new
THREE
.
Vector3
(
1
,
1
,
1
));
var
subCellRange
=
(
new
THREE
.
Vector3
(
x
,
y
,
z
)).
add
(
cell
.
applyRotation
(
dimensions
).
round
().
add
(
new
THREE
.
Vector3
(
1
,
1
,
1
)));
...
...
js/lattice/latticeSubclasses/GIKLattice.js
View file @
942cac95
...
...
@@ -49,7 +49,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
},
_zIndexRotationSuperCell
:
function
(
index
){
if
(
index
.
z
%
2
!=
0
)
return
Math
.
PI
/
2
;
//this never changes
if
(
index
.
z
%
2
!=
0
)
return
-
Math
.
PI
/
2
;
//this never changes
return
0
;
},
...
...
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