From 588d5b7578c69cc051959d306e2bb618787c2342 Mon Sep 17 00:00:00 2001 From: Lev Kozlov Date: Wed, 20 Nov 2024 18:05:31 +0900 Subject: [PATCH] fix: update parsing for smooth slicing (#166) * fix: update parsing for smooth slicing * fix: ruff --- src/gcode.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gcode.py b/src/gcode.py index 90303c6..75cb45c 100644 --- a/src/gcode.py +++ b/src/gcode.py @@ -282,14 +282,18 @@ def parseGCode(lines): line = line + ";" if len(line) == 0 or ";" not in line else line args, comment = line.split(";")[:2] args = args.split(" ") - if comment.lower() == "rotation": # we have either rotation or incline + if line.endswith("rotation"): # we have either rotation or incline + args, comment = line.split(";")[1:3] # we remove first colon + args = args.split(" ") printer.finishLayer() # if any(a.lower().startswith('u') for a in args): # rotation printer.rotations.append( Rotation(printer.rotations[-1].x_rot, parseRotation(args[1:])) ) printer.currPos.U = printer.rotations[-1].z_rot - elif comment.lower() == "incline": + elif line.endswith("incline"): + args, comment = line.split(";")[1:3] # we remove first colon + args = args.split(" ") printer.finishLayer() # if any(a.lower().startswith('v') for a in args): # incline printer.rotations.append(