Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
03c532cd
Commit
03c532cd
authored
Nov 07, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store & restore relative positionning status for each object
parent
c2853286
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
gcodeplater.py
gcodeplater.py
+7
-1
No files found.
gcodeplater.py
View file @
03c532cd
...
...
@@ -80,6 +80,7 @@ class GcodePlater(Plater):
# 6) handling of current tool
# 7) handling of Z moves for sequential printing (don't lower Z before
# reaching the next object print area)
# 8) handling of absolute/relative status
# Initial implementation should just print the objects sequentially,
# but the end goal is to have a clean per-layer merge
def
export_to
(
self
,
name
):
...
...
@@ -97,6 +98,7 @@ class GcodePlater(Plater):
for
(
layer_i
,
layer
)
in
enumerate
(
model
.
gcode
.
all_layers
)
if
layer
]
alllayers
.
sort
()
laste
=
[
0
]
*
len
(
models
)
lastrelative
=
[
False
]
*
len
(
models
)
with
open
(
name
,
"w"
)
as
f
:
analyzer
=
gcoder
.
GCode
(
None
,
get_home_pos
(
self
.
build_dimensions
))
analyzer
.
write
=
types
.
MethodType
(
lambda
self
,
line
:
gcoder_write
(
self
,
f
,
line
),
analyzer
)
...
...
@@ -118,7 +120,10 @@ class GcodePlater(Plater):
offset_pos
[
1
]
+
trans
[
1
],
offset_pos
[
2
]
+
trans
[
2
])
analyzer
.
write
(
"; GCodePlater: Model
%
d Layer
%
d at Z =
%
s
\n
"
%
(
model_i
,
layer_i
,
layer_z
))
analyzer
.
write
(
"G90
\n
"
)
if
lastrelative
[
model_i
]:
analyzer
.
write
(
"G91
\n
"
)
else
:
analyzer
.
write
(
"G90
\n
"
)
analyzer
.
write
(
"G92 X
%.5
f Y
%.5
f Z
%.5
f
\n
"
%
trans_wpos
)
analyzer
.
write
(
"G92 E
%.5
f
\n
"
%
laste
[
model_i
])
for
l
in
layer
:
...
...
@@ -127,6 +132,7 @@ class GcodePlater(Plater):
# Find the current real position & E
last_real_position
=
analyzer
.
current_pos
laste
[
model_i
]
=
analyzer
.
current_e
lastrelative
[
model_i
]
=
analyzer
.
relative
print
_
(
"Exported merged G-Codes to
%
s"
)
%
name
def
export_sequential
(
self
,
name
):
...
...
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