From ec6fb3f346b24a55c1a99dcde0132e76e1cf4b1c Mon Sep 17 00:00:00 2001 From: daid Date: Tue, 3 Dec 2013 15:14:52 +0100 Subject: [PATCH] Account for multiple extruders in the new object size polygons. --- Cura/gui/sceneView.py | 1 + Cura/util/objectScene.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 83a1d76a..c25cbc90 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -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') diff --git a/Cura/util/objectScene.py b/Cura/util/objectScene.py index 344e6fc5..63b1d0ed 100644 --- a/Cura/util/objectScene.py +++ b/Cura/util/objectScene.py @@ -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) -- 2.30.2