chiark / gitweb /
Fixed #102 - Jorised GCode preview was messed up. Caused by incorrect layerheight...
authordaid <daid303@gmail.com>
Wed, 16 May 2012 13:14:17 +0000 (15:14 +0200)
committerdaid <daid303@gmail.com>
Wed, 16 May 2012 13:14:17 +0000 (15:14 +0200)
Cura/util/gcodeInterpreter.py

index 085861787974d9783d678cb6ec73918e4b56b1dc..78e71acb7fc13bf44dd862ff22161a78cca88f0a 100644 (file)
@@ -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)