aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/gcode_arcs.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-04-23 10:05:05 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-04-23 10:05:05 -0400
commit43fa41c1af648ea626040e17f0eebda39dcdb2cb (patch)
tree05c1de4fdea0725f1c9e273297e3a88b5c933123 /klippy/extras/gcode_arcs.py
parentfc627ec47090673ff76377d411cba182fc4dedf8 (diff)
downloadkutter-43fa41c1af648ea626040e17f0eebda39dcdb2cb.tar.gz
kutter-43fa41c1af648ea626040e17f0eebda39dcdb2cb.tar.xz
kutter-43fa41c1af648ea626040e17f0eebda39dcdb2cb.zip
gcode_arcs: Disable E moves in absolute extrude mode
Commit 402110f6 didn't actually fix absolute extrude mode. For now, report an error if an extrude move is requested in absolute extrude mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/gcode_arcs.py')
-rw-r--r--klippy/extras/gcode_arcs.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/klippy/extras/gcode_arcs.py b/klippy/extras/gcode_arcs.py
index 3b0876ab..61b1a0fc 100644
--- a/klippy/extras/gcode_arcs.py
+++ b/klippy/extras/gcode_arcs.py
@@ -38,23 +38,20 @@ class ArcSupport:
if not asI and not asJ:
raise self.gcode.error("G2/G3 neither I nor J given")
asE = self.gcode.get_float("E", params, None)
+ if asE is not None and gcodestatus['absolute_extrude']:
+ raise self.gcode.error("G2/G3 only supports relative extrude mode")
asF = self.gcode.get_float("F", params, None)
clockwise = (params['#command'] == 'G2')
# Build list of linear coordinates to move to
coords = self.planArc(currentPos, [asX, asY, asZ], [asI, asJ],
clockwise)
- e_per_move = e_base = 0.
- if asE is not None:
- if gcodestatus['absolute_extrude']:
- e_base = currentPos[3]
- e_per_move = (asE - e_base) / len(coords)
# Convert coords into G1 commands
for coord in coords:
g1_params = {'X': coord[0], 'Y': coord[1], 'Z': coord[2]}
- if e_per_move:
- g1_params['E'] = e_base + e_per_move
+ if asE is not None:
+ g1_params['E'] = asE / len(coords)
if asF is not None:
g1_params['F'] = asF
self.gcode.cmd_G1(g1_params)