diff options
author | maze <tehmaze@users.noreply.github.com> | 2022-12-14 18:06:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-14 12:06:11 -0500 |
commit | 347dfa58eab8286ad2e71efe9e11260ca35b61c6 (patch) | |
tree | 461f68028cbc90cb6a5796ac78a8c6b12e00f5e9 | |
parent | 69f76b3b66ba72d6a42f93a829304b1a802dbf02 (diff) | |
download | kutter-347dfa58eab8286ad2e71efe9e11260ca35b61c6.tar.gz kutter-347dfa58eab8286ad2e71efe9e11260ca35b61c6.tar.xz kutter-347dfa58eab8286ad2e71efe9e11260ca35b61c6.zip |
gcode_arcs: Allow either one of I, J, K to be default-zero on G2/G3 (#5939)
Signed-off-by: Wijnand Modderman-Lenstra <maze@pyth0n.org>
-rw-r--r-- | klippy/extras/gcode_arcs.py | 2 | ||||
-rw-r--r-- | test/klippy/gcode_arcs.test | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/klippy/extras/gcode_arcs.py b/klippy/extras/gcode_arcs.py index 7707cd66..76c165dd 100644 --- a/klippy/extras/gcode_arcs.py +++ b/klippy/extras/gcode_arcs.py @@ -84,7 +84,7 @@ class ArcSupport: asPlanar = [ gcmd.get_float(a, 0.) for i,a in enumerate('JK') ] axes = (Y_AXIS, Z_AXIS, X_AXIS) - if not asPlanar[0] or not asPlanar[1]: + if not (asPlanar[0] or asPlanar[1]): raise gcmd.error("G2/G3 requires IJ, IK or JK parameters") asE = gcmd.get_float("E", None) diff --git a/test/klippy/gcode_arcs.test b/test/klippy/gcode_arcs.test index 6f9a7e3a..658ccad0 100644 --- a/test/klippy/gcode_arcs.test +++ b/test/klippy/gcode_arcs.test @@ -11,6 +11,12 @@ G2 X125 Y32 Z20 E1 I10.5 J10.5 # XY+Z arc move G2 X20 Y20 Z10 E1 I10.5 J10.5 +# allowable commands +G2 X20 Y20 I0 J10 +G2 X20 Y20 J10 +G2 X20 Y20 I10 J0 +G2 X20 Y20 I10 + # Home and move in XZ arc G28 G90 @@ -21,6 +27,12 @@ G2 X125 Y20 Z32 E1 I10.5 K10.5 # XZ+Y arc move G2 X20 Y10 Z20 E1 I10.5 K10.5 +# allowable commands +G2 X20 Y20 I0 K10 +G2 X20 Y20 K10 +G2 X20 Y20 I10 K0 +G2 X20 Y20 I10 + # Home and move in YZ arc G28 G90 @@ -30,3 +42,9 @@ G2 X20 Y125 Z32 E1 J10.5 K10.5 # YZ+X arc move G2 X10 Y20 Z20 E1 J10.5 K10.5 + +# allowable commands +G2 X20 Y20 J0 K10 +G2 X20 Y20 K10 +G2 X20 Y20 J10 K0 +G2 X20 Y20 J10 |