chiark / gitweb /
Merge branch 'SteamEngine' of github.com:daid/Cura into SteamEngine
authordaid <daid303@gmail.com>
Mon, 23 Sep 2013 14:44:27 +0000 (16:44 +0200)
committerdaid <daid303@gmail.com>
Mon, 23 Sep 2013 14:44:27 +0000 (16:44 +0200)
Cura/gui/sceneView.py
Cura/gui/simpleMode.py
Cura/resources/images/Ultimaker2backplate.png [new file with mode: 0644]
Cura/resources/meshes/ultimaker2_platform.stl
Cura/util/profile.py
Cura/util/sliceEngine.py

index 25dcffe9e8fb91598104b3a7d8b27a7eb17af029..5380bb9f937b64f1446bbd8a285d7ea4ebf8e689 100644 (file)
@@ -1170,7 +1170,7 @@ void main(void)
                                        self._platformMesh[machine] = meshes[0]
                                else:
                                        self._platformMesh[machine] = None
-                               if profile.getMachineSetting('machine_type') == 'ultimaker2':
+                               if machine == 'ultimaker2':
                                        self._platformMesh[machine]._drawOffset = numpy.array([0,-37,145], numpy.float32)
                                else:
                                        self._platformMesh[machine]._drawOffset = numpy.array([0,0,2.5], numpy.float32)
@@ -1178,6 +1178,44 @@ void main(void)
                        self._objectShader.bind()
                        self._renderObject(self._platformMesh[machine], False, False)
                        self._objectShader.unbind()
+
+                       #For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text.
+                       if machine == 'ultimaker2':
+                               if not hasattr(self._platformMesh[machine], 'texture'):
+                                       self._platformMesh[machine].texture = opengl.loadGLTexture('Ultimaker2backplate.png')
+                               glBindTexture(GL_TEXTURE_2D, self._platformMesh[machine].texture)
+                               glEnable(GL_TEXTURE_2D)
+                               glPushMatrix()
+                               glColor4f(1,1,1,1)
+
+                               glTranslate(0,150,-5)
+                               h = 50
+                               d = 8
+                               w = 100
+                               glEnable(GL_BLEND)
+                               glBlendFunc(GL_DST_COLOR, GL_ZERO)
+                               glBegin(GL_QUADS)
+                               glTexCoord2f(1, 0)
+                               glVertex3f( w, 0, h)
+                               glTexCoord2f(0, 0)
+                               glVertex3f(-w, 0, h)
+                               glTexCoord2f(0, 1)
+                               glVertex3f(-w, 0, 0)
+                               glTexCoord2f(1, 1)
+                               glVertex3f( w, 0, 0)
+
+                               glTexCoord2f(1, 0)
+                               glVertex3f(-w, d, h)
+                               glTexCoord2f(0, 0)
+                               glVertex3f( w, d, h)
+                               glTexCoord2f(0, 1)
+                               glVertex3f( w, d, 0)
+                               glTexCoord2f(1, 1)
+                               glVertex3f(-w, d, 0)
+                               glEnd()
+                               glDisable(GL_TEXTURE_2D)
+                               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
+                               glPopMatrix()
                else:
                        glColor4f(0,0,0,1)
                        glLineWidth(3)
index 5171dde1a23fc0a4b99f7dc8329eb72e917e9a8e..f34bf3bb928a09662f5e710803b1a559fd9113c1 100644 (file)
@@ -159,7 +159,7 @@ class simpleModePanel(wx.Panel):
                        put('skirt_line_count', '0')
                        put('fan_layer', '1')
                        put('bottom_thickness', '0.0')
-                       put('print_temperature', '260')
+                       put('print_temperature', '245')
                put('plugin_config', '')
 
        def updateProfileToControls(self):
diff --git a/Cura/resources/images/Ultimaker2backplate.png b/Cura/resources/images/Ultimaker2backplate.png
new file mode 100644 (file)
index 0000000..9b663bf
Binary files /dev/null and b/Cura/resources/images/Ultimaker2backplate.png differ
index 9c76445085e79a6f20c11f362178689bb2b6c9cd..5a1bb14001ab6ddb0610165292f2c6fc6e65165b 100644 (file)
Binary files a/Cura/resources/meshes/ultimaker2_platform.stl and b/Cura/resources/meshes/ultimaker2_platform.stl differ
index 5249237f8c1dd67d64ade35d76990a8df57e797d..9a3d20455f7a98b2dcfbdafb2cba5d52960c65c1 100644 (file)
@@ -13,9 +13,22 @@ from Cura.util import resources
 from Cura.util import version
 from Cura.util import validators
 
+#The settings dictionary contains a key/value reference to all possible settings. With the setting name as key.
 settingsDictionary = {}
+#The settings list is used to keep a full list of all the settings. This is needed to keep the settings in the proper order,
+# as the dictionary will not contain insertion order.
 settingsList = []
+
 class setting(object):
+       #A setting object contains a configuration setting. These are globally accessible trough the quick access functions
+       # and trough the settingsDictionary function.
+       # Settings can be:
+       # * profile settings (settings that effect the slicing process and the print result)
+       # * preferences (settings that effect how cura works and acts)
+       # * machine settings (settings that relate to the physical configuration of your machine)
+       # * alterations (bad name copied from Skeinforge. These are the start/end code pieces)
+       # Settings have validators that check if the value is valid, but do not prevent invalid values!
+       # Settings have conditions that enable/disable this setting depending on other settings. (Ex: Dual-extrusion)
        def __init__(self, name, default, type, category, subcategory):
                self._name = name
                self._label = name
@@ -43,7 +56,7 @@ class setting(object):
                self._tooltip = tooltip
                return self
 
-       def setRange(self, minValue = None, maxValue = None):
+       def setRange(self, minValue=None, maxValue=None):
                if len(self._validators) < 1:
                        return
                self._validators[0].minValue = minValue
@@ -307,6 +320,7 @@ setting('check_for_updates', 'True', bool, 'preference', 'hidden').setLabel('Che
 setting('submit_slice_information', 'False', bool, 'preference', 'hidden').setLabel('Send usage statistics', 'Submit anonymous usage information to improve next versions of Cura')
 setting('youmagine_token', '', str, 'preference', 'hidden')
 setting('filament_physical_density', '1240', float, 'preference', 'hidden').setRange(500.0, 3000.0).setLabel('Density (kg/m3)', 'Weight of the filament per m3. Around 1240 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print.')
+setting('active_machine', '', str, 'preference', 'hidden')
 
 setting('model_colour', '#FFC924', str, 'preference', 'hidden').setLabel('Model colour')
 setting('model_colour2', '#CB3030', str, 'preference', 'hidden').setLabel('Model colour (2)')
@@ -320,10 +334,11 @@ setting('window_width', '-1', float, 'preference', 'hidden')
 setting('window_height', '-1', float, 'preference', 'hidden')
 setting('window_normal_sash', '320', float, 'preference', 'hidden')
 
+setting('machine_name', 'unknown', str, 'machine', 'hidden')
+setting('machine_type', 'unknown', str, 'machine', 'hidden') #Ultimaker, Ultimaker2, RepRap
 setting('machine_width', '205', float, 'machine', 'hidden').setLabel('Maximum width (mm)', 'Size of the machine in mm')
 setting('machine_depth', '205', float, 'machine', 'hidden').setLabel('Maximum depth (mm)', 'Size of the machine in mm')
 setting('machine_height', '200', float, 'machine', 'hidden').setLabel('Maximum height (mm)', 'Size of the machine in mm')
-setting('machine_type', 'unknown', str, 'machine', 'hidden')
 setting('machine_center_is_zero', 'False', bool, 'machine', 'hidden')
 setting('ultimaker_extruder_upgrade', 'False', bool, 'machine', 'hidden')
 setting('has_heated_bed', 'False', bool, 'machine', 'hidden').setLabel('Heated bed', 'If you have an heated bed, this enabled heated bed settings (requires restart)')
index 1b3efc1aa31fdc979e9a530dcd4e7d652bd1dd0e..8944b057af500109d285cbfda646034a0d5982d8 100644 (file)
@@ -243,7 +243,6 @@ class Slicer(object):
                        'insetCount': int(profile.calculateLineCount()),
                        'downSkinCount': int(profile.calculateSolidLayerCount()) if profile.getProfileSetting('solid_bottom') == 'True' else 0,
                        'upSkinCount': int(profile.calculateSolidLayerCount()) if profile.getProfileSetting('solid_top') == 'True' else 0,
-                       'sparseInfillLineDistance': int(100 * profile.calculateEdgeWidth() * 1000 / profile.getProfileSettingFloat('fill_density')) if profile.getProfileSettingFloat('fill_density') > 0 else -1,
                        'infillOverlap': int(profile.getProfileSettingFloat('fill_overlap')),
                        'initialSpeedupLayers': int(4),
                        'initialLayerSpeed': int(profile.getProfileSettingFloat('bottom_layer_speed')),
@@ -281,6 +280,16 @@ class Slicer(object):
                        'extruderOffset[3].Y': int(profile.getMachineSettingFloat('extruder_offset_y3') * 1000),
                        'fixHorrible': 0,
                }
+               if profile.getProfileSettingFloat('fill_density') == 0:
+                       settings['sparseInfillLineDistance'] = -1
+               elif profile.getProfileSettingFloat('fill_density') == 100:
+                       settings['sparseInfillLineDistance'] = settings['extrusionWidth']
+                       #Set the up/down skins height to 10000 if we want a 100% filled object.
+                       # This gives better results then normal 100% infill as the sparse and up/down skin have some overlap.
+                       settings['downSkinCount'] = 10000
+                       settings['upSkinCount'] = 10000
+               else:
+                       settings['sparseInfillLineDistance'] = int(100 * profile.calculateEdgeWidth() * 1000 / profile.getProfileSettingFloat('fill_density'))
                if profile.getProfileSetting('platform_adhesion') == 'Brim':
                        settings['skirtDistance'] = 0
                        settings['skirtLineCount'] = int(profile.getProfileSettingFloat('brim_line_count'))