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)
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)
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
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
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)')
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)')
'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')),
'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'))