chiark / gitweb /
Account for multiple extruders in the new object size polygons.
authordaid <daid303@gmail.com>
Tue, 3 Dec 2013 14:14:52 +0000 (15:14 +0100)
committerdaid <daid303@gmail.com>
Tue, 3 Dec 2013 14:14:52 +0000 (15:14 +0100)
Cura/gui/sceneView.py
Cura/util/objectScene.py

index 83a1d76a22cd4480a7b087fe8fa1b800b3672143..c25cbc90acdc3e90aa8a1d71db3ed48c8285d757 100644 (file)
@@ -627,6 +627,7 @@ class SceneView(openglGui.glGuiPanel):
                if self._isSimpleMode != oldSimpleMode:
                        self._scene.arrangeAll()
                        self.sceneUpdated()
+               self._scene.updateSizeOffsets(True)
                self._machineSize = numpy.array([profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'), profile.getMachineSettingFloat('machine_height')])
                self._objColors[0] = profile.getPreferenceColour('model_colour')
                self._objColors[1] = profile.getPreferenceColour('model_colour2')
index 344e6fc5ac4758b83cc116f564c2c4219b9b90a3..63b1d0ede24f1e7661119b7246fb261089a298be 100644 (file)
@@ -111,9 +111,13 @@ class Scene(object):
                        return
                self._sizeOffsets = newOffsets
 
-               extends = numpy.array([[-newOffsets[0],-newOffsets[1]],[ newOffsets[0],-newOffsets[1]],[ newOffsets[0], newOffsets[1]],[-newOffsets[0], newOffsets[1]]], numpy.float32)
+               extends = [numpy.array([[-newOffsets[0],-newOffsets[1]],[ newOffsets[0],-newOffsets[1]],[ newOffsets[0], newOffsets[1]],[-newOffsets[0], newOffsets[1]]], numpy.float32)]
+               for n in xrange(1, 4):
+                       headOffset = numpy.array([[0, 0], [-profile.getMachineSettingFloat('extruder_offset_x%d' % (n)), -profile.getMachineSettingFloat('extruder_offset_y%d' % (n))]], numpy.float32)
+                       extends.append(polygon.minkowskiHull(extends[n-1], headOffset))
+
                for obj in self._objectList:
-                       obj.setPrintAreaExtends(extends)
+                       obj.setPrintAreaExtends(extends[len(obj._meshList) - 1])
 
        #size of the printing head.
        def setHeadSize(self, xMin, xMax, yMin, yMax, gantryHeight):
@@ -125,6 +129,7 @@ class Scene(object):
                self._oneAtATime = self._gantryHeight > 0
 
                headArea = numpy.array([[-xMin,-yMin],[ xMax,-yMin],[ xMax, yMax],[-xMin, yMax]], numpy.float32)
+
                for obj in self._objectList:
                        obj.setHeadArea(headArea, self._headSizeOffsets)