✨ Support two-digit flavors for G00 G01 G02 G03 (#4437)

* Support two-digit flavors for G00 G01 G02 G03

Many CAM processors generate two-digit movement commands.  These are legal movement commands but the viewer is currently blind to them.  (Evidently slicers never generate these, or this would have already been an issue.)

This does not fully solve rendering of non-extruding toolpaths, but it enables a workaround in combination with M101 added to the preamble.

* 🥅 Support G00, G01, G02, G03 in backend as well

Co-authored-by: Gina Häußge <gina@octoprint.org>
This commit is contained in:
JamieandGina Häußge authored and GitHub committed 2022-02-24 13:31:08 +01:00
1 parent 35bf9ed350
commit 3395e19416
2 files changed
+3 -3

No files matched your search

@@ -380,7 +380,7 @@ var doParse = function () {
var log = false;
if (/^(?:G0|G1|G2|G3)(\.\d+)?\s/i.test(line)) {
if (/^(?:G0|G1|G2|G3|G00|G01|G02|G03)(\.\d+)?\s/i.test(line)) {
args = line.split(/\s/);
for (j = 0; j < args.length; j++) {
+2 -2
View File
@@ -422,7 +422,7 @@ class gcode:
tool = int(values["tool"])
# G codes
if gcode in ("G0", "G1"): # Move
if gcode in ("G0", "G1", "G00", "G01"): # Move
x = getCodeFloat(line, "X")
y = getCodeFloat(line, "Y")
z = getCodeFloat(line, "Z")
@@ -497,7 +497,7 @@ class gcode:
if e:
self._track_layer(pos)
if gcode in ("G2", "G3"): # Arc Move
if gcode in ("G2", "G3", "G02", "G03"): # Arc Move
x = getCodeFloat(line, "X")
y = getCodeFloat(line, "Y")
z = getCodeFloat(line, "Z")