diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-06-04 15:19:08 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-06-04 15:25:17 -0400 |
commit | 5d26c2a08ec0dafcacbf47de4d9ea619a324027a (patch) | |
tree | 881a50dafde5653d8b6c2bbd384688507e7e1b4c /klippy/extras | |
parent | 2a66286d1c2c01ddd9ce34ae6c8417cc02401c78 (diff) | |
download | kutter-5d26c2a08ec0dafcacbf47de4d9ea619a324027a.tar.gz kutter-5d26c2a08ec0dafcacbf47de4d9ea619a324027a.tar.xz kutter-5d26c2a08ec0dafcacbf47de4d9ea619a324027a.zip |
gcode_arcs: Add back in support for E moves in absolute extrude mode
This reverts commit 43fa41c1af648ea626040e17f0eebda39dcdb2cb.
The above commit disabled absolute extrude moves because it was
unclear if the code would work properly when an M221 extrude factor or
G92 offset was in use. However, since the calculation is done
relative to the raw E position and is sent as a raw E position to
gcode.cmd_G1() these modes should not matter.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/gcode_arcs.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/klippy/extras/gcode_arcs.py b/klippy/extras/gcode_arcs.py index 655b109c..a7546bda 100644 --- a/klippy/extras/gcode_arcs.py +++ b/klippy/extras/gcode_arcs.py @@ -38,20 +38,23 @@ class ArcSupport: if not asI and not asJ: raise gcmd.error("G2/G3 neither I nor J given") asE = gcmd.get_float("E", None) - if asE is not None and gcodestatus['absolute_extrude']: - raise gcmd.error("G2/G3 only supports relative extrude mode") asF = gcmd.get_float("F", None) clockwise = (gcmd.get_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 asE is not None: - g1_params['E'] = asE / len(coords) + if e_per_move: + g1_params['E'] = e_base + e_per_move if asF is not None: g1_params['F'] = asF g1_gcmd = self.gcode.create_gcode_command("G1", "G1", g1_params) |