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
9446e1f8
Commit
9446e1f8
authored
Nov 05, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle E offsets correctly in GCoder
parent
06e6e9fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
gcoder.py
printrun/gcoder.py
+11
-6
No files found.
printrun/gcoder.py
View file @
9446e1f8
...
...
@@ -119,6 +119,7 @@ class GCode(object):
offset_x
=
0
offset_y
=
0
offset_z
=
0
offset_e
=
0
# Expected behavior:
# - G28 X => X axis is homed, offset_x <- 0, current_x <- home_x
# - G92 Xk => X axis does not move, offset_x <- current_x - k,
...
...
@@ -265,7 +266,8 @@ class GCode(object):
if
not
lines
:
lines
=
self
.
lines
cur_e
=
self
.
current_e
current_e
=
self
.
current_e
offset_e
=
self
.
offset_e
total_e
=
0
max_e
=
0
...
...
@@ -276,15 +278,18 @@ class GCode(object):
if
line
.
relative_e
:
line
.
extruding
=
line
.
e
>
0
total_e
+=
line
.
e
current_e
+=
line
.
e
else
:
line
.
extruding
=
line
.
e
>
cur_e
total_e
+=
line
.
e
-
cur_e
cur_e
=
line
.
e
new_e
=
line
.
e
+
offset_e
line
.
extruding
=
new_e
>
current_e
total_e
+=
new_e
-
current_e
current_e
=
new_e
max_e
=
max
(
max_e
,
total_e
)
elif
line
.
command
==
"G92"
:
cur_e
=
line
.
e
offset_e
=
current_e
-
line
.
e
self
.
current_e
=
cur_e
self
.
current_e
=
current_e
self
.
offset_e
=
offset_e
return
max_e
# FIXME : looks like this needs to be tested with list Z on move
...
...
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