def _selectObject(self, obj, zoom = True):
if obj != self._selectedObj:
self._selectedObj = obj
- self.updateProfileToControls()
+ self.updateModelSettingsToControls()
self.updateToolButtons()
if zoom and obj is not None:
newViewPos = numpy.array([obj.getPosition()[0], obj.getPosition()[1], obj.getSize()[2] / 2])
self._objColors[2] = profile.getPreferenceColour('model_colour3')
self._objColors[3] = profile.getPreferenceColour('model_colour4')
self._scene.updateMachineDimensions()
+ self.updateModelSettingsToControls()
+ def updateModelSettingsToControls(self):
if self._selectedObj is not None:
scale = self._selectedObj.getScale()
size = self._selectedObj.getSize()
self._sizeOffsets = numpy.array([0.0,0.0], numpy.float32)
self._machineSize = numpy.array([100,100,100], numpy.float32)
self._headSizeOffsets = numpy.array([18.0,18.0], numpy.float32)
+ self._minExtruderCount = None
self._extruderOffset = [numpy.array([0,0], numpy.float32)] * 4
#Print order variables
# Size offsets are offsets caused by brim, skirt, etc.
def updateSizeOffsets(self, force=False):
newOffsets = numpy.array(profile.calculateObjectSizeOffsets(), numpy.float32)
- if not force and numpy.array_equal(self._sizeOffsets, newOffsets):
+ minExtruderCount = profile.minimalExtruderCount()
+ if not force and numpy.array_equal(self._sizeOffsets, newOffsets) and self._minExtruderCount == minExtruderCount:
return
self._sizeOffsets = newOffsets
+ self._minExtruderCount = minExtruderCount
extends = [numpy.array([[-newOffsets[0],-newOffsets[1]],[ newOffsets[0],-newOffsets[1]],[ newOffsets[0], newOffsets[1]],[-newOffsets[0], newOffsets[1]]], numpy.float32)]
for n in xrange(1, 4):
headOffset = numpy.array([[0, 0], [-profile.getMachineSettingFloat('extruder_offset_x%d' % (n)), -profile.getMachineSettingFloat('extruder_offset_y%d' % (n))]], numpy.float32)
extends.append(polygon.minkowskiHull(extends[n-1], headOffset))
+ if minExtruderCount > 1:
+ extends[0] = extends[1]
for obj in self._objectList:
obj.setPrintAreaExtends(extends[len(obj._meshList) - 1])
ret.append(numpy.array([[ size[0]/2, size[1]/2],[ size[0]/2-w-2, size[1]/2], [ size[0]/2-w, size[1]/2-h],[ size[0]/2, size[1]/2-h]], numpy.float32))
return ret
+#returns the number of extruders minimal used. Normally this returns 1, but with dual-extrusion support material it returns 2
+def minimalExtruderCount():
+ if int(getMachineSetting('extruder_amount')) < 2:
+ return 1
+ if getProfileSetting('support') == 'None':
+ return 1
+ if getProfileSetting('support_dual_extrusion') == 'Second extruder':
+ return 2
+ return 1
+
#########################################################
## Alteration file functions
#########################################################
for obj in scene.objects():
if scene.checkPlatform(obj):
extruderCount = max(extruderCount, len(obj._meshList))
- if profile.getProfileSetting('support_dual_extrusion') == 'Second extruder':
- extruderCount = max(extruderCount, 2)
+
+ extruderCount = max(extruderCount, profile.minimalExtruderCount())
commandList = [getEngineFilename(), '-vv']
for k, v in self._engineSettings(extruderCount).iteritems():
'supportLineDistance': int(100 * profile.calculateEdgeWidth() * 1000 / profile.getProfileSettingFloat('support_fill_rate')) if profile.getProfileSettingFloat('support_fill_rate') > 0 else -1,
'supportXYDistance': int(1000 * profile.getProfileSettingFloat('support_xy_distance')),
'supportZDistance': int(1000 * profile.getProfileSettingFloat('support_z_distance')),
- 'supportExtruder': 0 if profile.getProfileSetting('support_dual_extrusion') == 'First extruder' else (1 if profile.getProfileSetting('support_dual_extrusion') == 'Second extruder' else -1),
+ 'supportExtruder': 0 if profile.getProfileSetting('support_dual_extrusion') == 'First extruder' else (1 if profile.getProfileSetting('support_dual_extrusion') == 'Second extruder' and profile.minimalExtruderCount() > 1 else -1),
'retractionAmount': int(profile.getProfileSettingFloat('retraction_amount') * 1000) if profile.getProfileSetting('retraction_enable') == 'True' else 0,
'retractionSpeed': int(profile.getProfileSettingFloat('retraction_speed')),
'retractionMinimalDistance': int(profile.getProfileSettingFloat('retraction_min_travel') * 1000),