self.machineHeight = self.AddLabelTextCtrl('Machine height (mm)', '60')
self.nozzleSize = self.AddLabelTextCtrl('Nozzle size (mm)', '0.5')
self.heatedBed = self.AddCheckbox('Heated bed')
+ self.HomeAtCenter = self.AddCheckbox('Bed center is 0,0,0 (RoStock)')
def StoreData(self):
profile.putPreference('machine_width', self.machineWidth.GetValue())
profile.putProfileSetting('nozzle_size', self.nozzleSize.GetValue())
profile.putProfileSetting('wall_thickness', float(profile.getProfileSettingFloat('nozzle_size')) * 2)
profile.putPreference('has_heated_bed', str(self.heatedBed.GetValue()))
+ profile.putPreference('machine_center_is_zero', str(self.HomeAtCenter.GetValue()))
class MachineSelectPage(InfoPage):
profile.putPreference('machine_depth', '205')
profile.putPreference('machine_height', '200')
profile.putPreference('machine_type', 'ultimaker')
+ profile.putPreference('machine_center_is_zero', 'False')
profile.putProfileSetting('nozzle_size', '0.4')
else:
profile.putPreference('machine_width', '80')
glPopMatrix()
- if self.parent.gcode != None and (self.viewMode == "GCode" or self.viewMode == "Mixed"):
+ if self.parent.gcode is not None and (self.viewMode == "GCode" or self.viewMode == "Mixed"):
+ glPushMatrix()
+ if profile.getPreference('machine_center_is_zero') == 'True':
+ glTranslate(self.parent.machineCenter.x, self.parent.machineCenter.y, 0)
glEnable(GL_COLOR_MATERIAL)
glEnable(GL_LIGHTING)
drawUpToLayer = min(self.gcodeDisplayListMade, self.parent.layerSpin.GetValue() + 1)
glDisable(GL_COLOR_MATERIAL)
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, [0.2, 0.2, 0.2, 1.0]);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, [0.8, 0.8, 0.8, 1.0]);
+ glPopMatrix()
glColor3f(1.0,1.0,1.0)
glPushMatrix()
positionList = []
for item in self.list:
fileList.append(item.filename)
- positionList.append([item.centerX, item.centerY] + (item.mesh.matrix * item.scale).reshape((9,)).tolist())
+ if profile.getPreference('machine_center_is_zero') == 'True':
+ pos = [item.centerX - self.machineSize[0] / 2, item.centerY - self.machineSize[1] / 2]
+ else:
+ pos = [item.centerX, item.centerY]
+ positionList.append(pos + (item.mesh.matrix * item.scale).reshape((9,)).tolist())
sliceCommand = sliceRun.getSliceCommand(resultFilename, fileList, positionList)
else:
self._saveCombinedSTL(resultFilename + "_temp_.stl")
position += [0,0,1]
filenames = fixUTF8(args[idx + 1]).split('|')
+ profile.setTempOverride('object_center_x', position[0])
+ profile.setTempOverride('object_center_y', position[1])
if idx == 0:
resultFile.write(';TYPE:CUSTOM\n')
resultFile.write(profile.getAlterationFileContents('start.gcode').replace('?filename?', ' '.join(filenames).encode('ascii', 'replace')))
'Unproven_Mesh': DEFSET,
'SVG_Viewer': DEFSET,
'ObjectMatrix': storedSetting("object_matrix"),
- 'CenterX': lambda setting: profile.getProfileSettingFloat('object_center_x') if profile.getProfileSettingFloat('object_center_x') > 0 else profile.getPreferenceFloat("machine_width") / 2,
- 'CenterY': lambda setting: profile.getProfileSettingFloat('object_center_y') if profile.getProfileSettingFloat('object_center_y') > 0 else profile.getPreferenceFloat("machine_depth") / 2,
+ 'CenterX': lambda setting: profile.getProfileSettingFloat('object_center_x'),
+ 'CenterY': lambda setting: profile.getProfileSettingFloat('object_center_y'),
'AlternativeCenterFile': storedSetting("alternative_center"),
},'scale': {
'Activate_Scale': "False",
'machine_depth': '205',
'machine_height': '200',
'machine_type': 'unknown',
+ 'machine_center_is_zero': 'False',
'ultimaker_extruder_upgrade': 'False',
'has_heated_bed': 'False',
'extruder_amount': '1',
return int(math.ceil(solidThickness / layerHeight - 0.0001))
def getMachineCenterCoords():
+ if getPreference('machine_center_is_zero') == 'True':
+ return [0, 0]
return [getPreferenceFloat('machine_width') / 2, getPreferenceFloat('machine_depth') / 2]
def getObjectMatrix():