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
9cea6ac1
Commit
9cea6ac1
authored
Aug 20, 2015
by
Amanda Ghassaei
Browse files
all post processing in script
parent
e00219d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
css/main.css
View file @
9cea6ac1
...
...
@@ -408,6 +408,7 @@ label {
.CodeMirror
{
opacity
:
0.6
;
margin
:
0
20px
0
-10px
;
font-size
:
10pt
;
}
.editComposite
,
.editMaterial
{
...
...
js/cam/assemblers/AssemblerPost.js
View file @
9cea6ac1
...
...
@@ -101,6 +101,33 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
data
+=
exporter
.
rapidZ
(
position
.
z
+
context
.
zClearHeight
,
settings
);
return
data
;
};
this
.
customCalcPositionOffsets
=
function
(
index
,
position
,
material
,
settings
,
context
){
//this feeds into moveXY and placePart's position parameter
if
(
index
.
z
%
2
!=
0
){
//offset for rotation
var
offset
=
this
.
components
.
substrate
.
centerOfRotation
.
clone
().
multiplyScalar
(
settings
.
scale
);
//offset in mm
var
dist
=
position
.
clone
().
sub
(
offset
);
position
=
offset
.
add
(
new
THREE
.
Vector3
(
dist
.
y
,
-
dist
.
x
,
position
.
z
));
}
var
stock
=
_
.
find
(
this
.
stock
,
function
(
thisStock
){
return
thisStock
.
getMaterial
()
==
material
});
if
(
stock
===
undefined
)
{
console
.
warn
(
"
no stock defined of type
"
+
material
+
"
for this assembler
"
);
return
null
;
}
position
.
sub
(
stock
.
getPosition
().
multiplyScalar
(
settings
.
scale
));
position
.
sub
(
settings
.
originPosition
);
return
position
;
}
}
...
...
@@ -199,23 +226,8 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
// position.add(new THREE.Vector3(18.23*((index.z)%2), 0.3*((index.z)%2), 0));
if
(
index
.
z
%
2
!=
0
){
//offset for rotation
var
offset
=
this
.
components
.
substrate
.
centerOfRotation
.
clone
().
multiplyScalar
(
settings
.
scale
);
//offset in mm
var
dist
=
position
.
clone
().
sub
(
offset
);
position
=
offset
.
add
(
new
THREE
.
Vector3
(
dist
.
y
,
-
dist
.
x
,
position
.
z
));
}
var
stock
=
_
.
find
(
this
.
stock
,
function
(
thisStock
){
return
thisStock
.
getMaterial
()
==
material
});
if
(
stock
===
undefined
)
{
console
.
warn
(
"
no stock defined of type
"
+
material
+
"
for this assembler
"
);
return
data
;
}
position
.
sub
(
stock
.
getPosition
().
multiplyScalar
(
settings
.
scale
));
position
.
sub
(
settings
.
originPosition
);
var
position
=
this
.
customCalcPositionOffsets
(
index
,
position
,
material
,
settings
,
context
);
if
(
position
===
null
)
return
data
;
// (5.08mm, 5.715mm)
...
...
js/menus/templates/AssemblerSetupMenuView.html
View file @
9cea6ac1
...
...
@@ -19,6 +19,7 @@ Rotation (xyz):
Scale:
<input
data-property=
"scale"
value=
"<%= scale %>"
placeholder=
"Scale"
class=
"form-control floatInput assembler"
type=
"text"
><br/><br/>
Edit Code:
<br/><br/>
Context Variables
<a
class=
"editMachineCode"
data-name=
"customFunctionsContext"
href=
"#"
>
Edit
</a><br/>
Position Offsets
<a
class=
"editMachineCode"
data-name=
"customCalcPositionOffsets"
href=
"#"
>
Edit
</a><br/>
Header
<a
class=
"editMachineCode"
data-name=
"customHeader"
href=
"#"
>
Edit
</a><br/>
Go Home
<a
class=
"editMachineCode"
data-name=
"customHome"
href=
"#"
>
Edit
</a><br/>
<!--Pick up stock <a class="editMachineCode" data-name="customHeader" href="#">Edit</a><br/>-->
...
...
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