chiark / gitweb /
If an object is too large, scale it down, but not so small that it fits on the platfo...
authordaid <daid303@gmail.com>
Fri, 14 Jun 2013 07:12:44 +0000 (09:12 +0200)
committerdaid <daid303@gmail.com>
Fri, 14 Jun 2013 07:12:44 +0000 (09:12 +0200)
Cura/gui/mainWindow.py
Cura/util/objectScene.py

index 47f94967d5cbcbbfb6156f6c425d3b024ddb269c..3f763fff9b87f6c3d1a98d18e07ee6db54c0a4bd 100644 (file)
@@ -24,7 +24,7 @@ from Cura.util import meshLoader
 
 class mainWindow(wx.Frame):
        def __init__(self):
-               super(mainWindow, self).__init__(None, title='Cura - ' + version.getVersion())
+               super(mainWindow, self).__init__(None, title='Cura - Revolution! - ' + version.getVersion())
 
                self.extruderCount = int(profile.getPreference('extruder_amount'))
 
index b06a721b732add01316772d6f72194cb4e4b1cd6..d91f910b24cbbd98886571779e76c3cb6bdaca4e 100644 (file)
@@ -125,6 +125,11 @@ class Scene(object):
                self._findFreePositionFor(obj)
                self._objectList.append(obj)
                self.pushFree()
+               if numpy.max(obj.getSize()[0:2]) > numpy.max(self._machineSize[0:2]) * 1.5:
+                       scale = numpy.max(self._machineSize[0:2]) * 1.5 / numpy.max(obj.getSize()[0:2])
+                       matrix = [[scale,0,0], [0, scale, 0], [0, 0, scale]]
+                       obj.applyMatrix(numpy.matrix(matrix, numpy.float64))
+
 
        def remove(self, obj):
                self._objectList.remove(obj)