chiark / gitweb /
Better show invalid placement when objects are not placed on the printer bed.
authordaid303 <daid303@gmail.com>
Tue, 8 Jan 2013 14:56:47 +0000 (15:56 +0100)
committerdaid303 <daid303@gmail.com>
Tue, 8 Jan 2013 14:56:47 +0000 (15:56 +0100)
Cura/gui/projectPlanner.py
Cura/slice/__main__.py

index 197e83dcf37d267ccd384a43b76f2a1b7ee256aa..30412b79b744bafca142e342e032dd0aa86d8eb9 100644 (file)
@@ -529,8 +529,9 @@ class projectPlanner(wx.Frame):
                                bestAllowedSize = i
                                bestArea = area
                self._doAutoPlace(bestAllowedSize)
-               for item in self.list:
-                       item.clampXY()
+               if not self.alwaysAutoPlace:
+                       for item in self.list:
+                               item.clampXY()
                self.preview.Refresh()
        
        def _doAutoPlace(self, allowedSizeY):
@@ -825,6 +826,10 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
                        item = self.parent.list[idx1]
                        iMin1 = (item.getMinimum() * item.scale) + numpy.array([item.centerX, item.centerY, 0]) - extraSizeMin - self.parent.extruderOffset[item.extruder]
                        iMax1 = (item.getMaximum() * item.scale) + numpy.array([item.centerX, item.centerY, 0]) + extraSizeMax - self.parent.extruderOffset[item.extruder]
+                       if iMin1[0] < -self.parent.headSizeMin[0] or iMin1[1] < -self.parent.headSizeMin[1]:
+                               item.validPlacement = False
+                       if iMax1[0] > machineSize[0] + self.parent.headSizeMax[0] or iMax1[1] > machineSize[1] + self.parent.headSizeMax[1]:
+                               item.validPlacement = False
                        for idx2 in xrange(0, idx1):
                                item2 = self.parent.list[idx2]
                                iMin2 = (item2.getMinimum() * item2.scale) + numpy.array([item2.centerX, item2.centerY, 0])
index fef7c8f82375837609572d3fbb04021c85110aad..6d51a286782530170c3401ef5451c8889031619e 100644 (file)
@@ -26,7 +26,6 @@ def main():
                profile.loadGlobalProfileFromString(options.profile)
        options.output = fixUTF8(options.output)
 
-       print args
        resultFile = open(options.output, "w")
        for idx in xrange(0, len(args), 2):
                position = map(float, args[0].split(','))