chiark / gitweb /
Better display dual-extrusion paths.
authordaid303 <daid303@gmail.com>
Thu, 14 Mar 2013 10:55:53 +0000 (11:55 +0100)
committerdaid303 <daid303@gmail.com>
Thu, 14 Mar 2013 10:55:53 +0000 (11:55 +0100)
Cura/gui/util/opengl.py
Cura/util/gcodeInterpreter.py

index 8d3f727c61ae953e74ec08e37de4047748fb7b9e..dc7deb67c0bda796de31b7aa768a89a96e2e2d97 100644 (file)
@@ -430,7 +430,7 @@ def DrawGCodeLayer(layer, drawQuick = True):
        moveColor = [0, 0, 1, 0.5]
        retractColor = [1, 0, 0.5, 0.5]
        supportColor = [0, 1, 1, 1]
-       extrudeColor = [1, 0, 0, 1]
+       extrudeColor = [[1, 0, 0, 1], [0, 1, 1, 1], [1, 1, 0, 1], [1, 0, 1, 1]]
        innerWallColor = [0, 1, 0, 1]
        skirtColor = [0, 0.5, 0.5, 1]
        prevPathWasRetract = False
@@ -459,7 +459,7 @@ def DrawGCodeLayer(layer, drawQuick = True):
                        elif path.pathType == 'SKIRT':
                                c = skirtColor
                        else:
-                               c = extrudeColor
+                               c = extrudeColor[path.extruder]
                if path.type == 'retract':
                        c = retractColor
                if path.type == 'extrude' and not drawQuick:
index 633468675e7ae6ec39c6cd54aed2468137bc8e1b..19b68acec4d25b557c3e657eba4545c96cf029d7 100644 (file)
@@ -67,6 +67,7 @@ class gcode(object):
                pathType = 'CUSTOM';
                currentLayer = []
                currentPath = gcodePath('move', pathType, layerThickness, pos.copy())
+               currentPath.extruder = currentExtruder
                currentPath.list[0].e = totalExtrusion
                currentPath.list[0].extrudeAmountMultiply = extrudeAmountMultiply
                currentLayer.append(currentPath)
@@ -158,6 +159,7 @@ class gcode(object):
                                                layerThickness = abs(oldPos.z - pos.z)
                                        if currentPath.type != moveType or currentPath.pathType != pathType:
                                                currentPath = gcodePath(moveType, pathType, layerThickness, currentPath.list[-1])
+                                               currentPath.extruder = currentExtruder
                                                currentLayer.append(currentPath)
                                        newPos = pos.copy()
                                        newPos.e = totalExtrusion