From 4d39ce07df97f6e7bdc9a1299c28926974a35c8e Mon Sep 17 00:00:00 2001 From: daid Date: Wed, 16 May 2012 15:14:17 +0200 Subject: [PATCH] Fixed #102 - Jorised GCode preview was messed up. Caused by incorrect layerheight calculations, new code only updates the layer heigh if a move is done, not when an extrusion is done. --- Cura/util/gcodeInterpreter.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Cura/util/gcodeInterpreter.py b/Cura/util/gcodeInterpreter.py index 08586178..78e71acb 100644 --- a/Cura/util/gcodeInterpreter.py +++ b/Cura/util/gcodeInterpreter.py @@ -130,9 +130,6 @@ class gcode(object): pos.z = z * scale + posOffset.z else: pos.z += z * scale - #Check if we have a new layer. - if oldPos.z != pos.z: - layerThickness = abs(oldPos.z - pos.z) if f is not None: feedRate = f if x is not None or y is not None or z is not None: @@ -155,6 +152,8 @@ class gcode(object): currentE += e if totalExtrusion > maxExtrusion: maxExtrusion = totalExtrusion + if moveType == 'move' and oldPos.z != pos.z: + layerThickness = abs(oldPos.z - pos.z) if currentPath.type != moveType or currentPath.pathType != pathType: currentPath = gcodePath(moveType, pathType, layerThickness, currentPath.list[-1]) currentLayer.append(currentPath) -- 2.30.2