From: daid Date: Fri, 14 Jun 2013 07:12:44 +0000 (+0200) Subject: If an object is too large, scale it down, but not so small that it fits on the platfo... X-Git-Tag: 13.06.2~13 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1ad8ad905f63d07626b222460b5e1a5d2976e961;p=cura.git If an object is too large, scale it down, but not so small that it fits on the platform. We want to user to select the final scale. But we also do not want to object to be too larger to be viewed properly. --- diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 47f94967..3f763fff 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -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')) diff --git a/Cura/util/objectScene.py b/Cura/util/objectScene.py index b06a721b..d91f910b 100644 --- a/Cura/util/objectScene.py +++ b/Cura/util/objectScene.py @@ -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)