chiark / gitweb /
Cut off (object_sink setting) support tall objects
authorpmsimard <pierrem.simard@gmail.com>
Mon, 5 Jan 2015 03:40:07 +0000 (22:40 -0500)
committerpmsimard <pierrem.simard@gmail.com>
Wed, 7 Jan 2015 04:03:20 +0000 (23:03 -0500)
Changes made to the Cut off value now trigger tests to check if Print one at a time mode can be reactivated.
Cut off is also used in z test to enable object within machine max height.

*I noticed that the slicer doesn't slice in print one at a time mode even if Cura enables it.*

Cura/gui/sceneView.py
Cura/util/objectScene.py

index bfa742779c0ca182499207c8d8eebe31b6dba0c9..d86fbdff395f61b031094e1299fdf30fdd9a133b 100644 (file)
@@ -51,6 +51,7 @@ class SceneView(openglGui.glGuiPanel):
                self._viewTarget = numpy.array([0,0,0], numpy.float32)
                self._animView = None
                self._animZoom = None
+               self._lastObjectSink = None
                self._platformMesh = {}
                self._platformTexture = None
                self._isSimpleMode = True
@@ -543,6 +544,12 @@ class SceneView(openglGui.glGuiPanel):
                self.sceneUpdated()
 
        def sceneUpdated(self):
+
+               objectSink = profile.getProfileSettingFloat("object_sink")
+               if self._lastObjectSink != objectSink:
+                       self._lastObjectSink = objectSink
+                       self._scene.updateHeadSize()
+
                wx.CallAfter(self._sceneUpdateTimer.Start, 500, True)
                self._engine.abortEngine()
                self._scene.updateSizeOffsets()
index dae3a6becee45c2f78aaf20032050797c5d2a576..29a52c051fa8a05ea103315a669a537e4dbb6d9f 100644 (file)
@@ -154,6 +154,7 @@ class Scene(object):
                yMin = profile.getMachineSettingFloat('extruder_head_size_min_y')
                yMax = profile.getMachineSettingFloat('extruder_head_size_max_y')
                gantryHeight = profile.getMachineSettingFloat('extruder_head_size_height')
+               objectSink = profile.getProfileSettingFloat("object_sink")
 
                self._leftToRight = xMin < xMax
                self._frontToBack = yMin < yMax
@@ -162,7 +163,7 @@ class Scene(object):
                self._gantryHeight = gantryHeight
                self._oneAtATime = self._gantryHeight > 0 and profile.getPreference('oneAtATime') == 'True'
                for obj in self._objectList:
-                       if obj.getSize()[2] > self._gantryHeight:
+                       if obj.getSize()[2] - objectSink > self._gantryHeight:
                                self._oneAtATime = False
 
                headArea = numpy.array([[-xMin,-yMin],[ xMax,-yMin],[ xMax, yMax],[-xMin, yMax]], numpy.float32)
@@ -267,8 +268,10 @@ class Scene(object):
                        return polygon.polygonCollision(a._boundaryHull + a.getPosition(), b._boundaryHull + b.getPosition())
 
        def checkPlatform(self, obj):
+               objectSink = profile.getProfileSettingFloat("object_sink")
+
                area = obj._printAreaHull + obj.getPosition()
-               if obj.getSize()[2] > self._machineSize[2]:
+               if obj.getSize()[2] - objectSink > self._machineSize[2]:
                        return False
                if not polygon.fullInside(area, self._machinePolygons[0]):
                        return False