From 7f3baa3b1eaa8871000221aef79be0652afbb14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 25 Jan 2021 14:17:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20analysis:=20fix=20G20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We continously scaled all coordinates, quickly blowing up the values in minMax. Fix this to only scale as needed when converting the input coordinates into a vector. See #3930 --- src/octoprint/util/gcodeInterpreter.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py index ca00b27ef..2f076f23a 100644 --- a/src/octoprint/util/gcodeInterpreter.py +++ b/src/octoprint/util/gcodeInterpreter.py @@ -377,17 +377,17 @@ class gcode(object): # Use new coordinates if provided. If not provided, use prior coordinates (minus tool offset) # in absolute and 0.0 in relative mode. newPos = Vector3D( - x if x is not None else (0.0 if relativeMode else pos.x), - y if y is not None else (0.0 if relativeMode else pos.y), - z if z is not None else (0.0 if relativeMode else pos.z), + x * scale if x is not None else (0.0 if relativeMode else pos.x), + y * scale if y is not None else (0.0 if relativeMode else pos.y), + z * scale if z is not None else (0.0 if relativeMode else pos.z), ) if relativeMode: - # Relative mode: scale and add to current position - pos += newPos * scale + # Relative mode: add to current position + pos += newPos else: - # Absolute mode: scale coordinates and apply tool offsets - pos = newPos * scale + # Absolute mode: apply tool offsets + pos = newPos if f is not None and f != 0: feedrate = f