configBase.TitleRow(left, "Accuracy")
c = configBase.SettingRow(left, "Layer height (mm)", 'layer_height', '0.2', 'Layer height in millimeters.\n0.2 is a good value for quick prints.\n0.1 gives high quality prints.')
validators.validFloat(c, 0.0)
- validators.warningAbove(c, 0.31, "Thicker layers then 0.3mm usually give bad results and are not recommended.")
+ validators.warningAbove(c, lambda : (float(profile.getProfileSetting('nozzle_size')) * 80 / 100), "Thicker layers then %.2fmm (80%% nozzle size) usually give bad results and are not recommended.")
c = configBase.SettingRow(left, "Wall thickness (mm)", 'wall_thickness', '0.8', 'Thickness of the walls.\nThis is used in combination with the nozzle size to define the number\nof perimeter lines and the thickness of those perimeter lines.')
validators.validFloat(c, 0.0)
validators.wallThicknessValidator(c)
c = configBase.SettingRow(right, "Print speed (mm/s)", 'print_speed', '50', 'Speed at which printing happens. A well adjusted Ultimaker can reach 150mm/s, but for good quality prints you want to print slower. Printing speed depends on a lot of factors. So you will be experimenting with optimal settings for this.')
validators.validFloat(c, 1.0)
validators.warningAbove(c, 150.0, "It is highly unlikely that your machine can achieve a printing speed above 150mm/s")
+ validators.printSpeedValidator(c)
configBase.TitleRow(right, "Temperature")
c = configBase.SettingRow(right, "Printing temperature", 'print_temperature', '0', 'Temperature used for printing. Set at 0 to pre-heat yourself')
for i in xrange(0, len(path['list'])-1):\r
v0 = path['list'][i]\r
v1 = path['list'][i+1]\r
+\r
+ # Calculate line width from ePerDistance (needs layer thickness and filament diameter)\r
dist = (v0 - v1).vsize()\r
if dist > 0 and layerThickness > 0:\r
extrusionMMperDist = (v1.e - v0.e) / (v0 - v1).vsize()\r
lineWidth = extrusionMMperDist * filamentArea / layerThickness / 2\r
\r
- #TODO: Calculate line width from ePerDistance (needs layer thickness, steps_per_E and filament diameter)\r
normal = (v0 - v1).cross(util3d.Vector3(0,0,1))\r
normal.normalize()\r
v2 = v0 + normal * lineWidth\r
from __future__ import absolute_import
import __init__
+import types
+import math
+
from newui import profile
SUCCESS = 0
def validate(self):
try:
f = float(self.setting.GetValue())
- if f >= self.minValueForWarning:
- return WARNING, self.warningMessage
+ if isinstance(self.minValueForWarning, types.FunctionType):
+ if f >= self.minValueForWarning():
+ return WARNING, self.warningMessage % (self.minValueForWarning())
+ else:
+ if f >= self.minValueForWarning:
+ return WARNING, self.warningMessage
return SUCCESS, ''
except ValueError:
#We already have an error by the int/float validator in this case.
#We already have an error by the int/float validator in this case.
return SUCCESS, ''
+class printSpeedValidator():
+ def __init__(self, setting):
+ self.setting = setting
+ self.setting.validators.append(self)
+
+ def validate(self):
+ try:
+ nozzleSize = float(profile.getProfileSetting('nozzle_size'))
+ layerHeight = float(profile.getProfileSetting('layer_height'))
+ printSpeed = float(profile.getProfileSetting('print_speed'))
+
+ printVolumePerMM = layerHeight * nozzleSize
+ printVolumePerSecond = printVolumePerMM * printSpeed
+ #Using 10mm3 per second with a 0.4mm nozzle (normal max according to Joergen Geerds)
+ maxPrintVolumePerSecond = 10 / (math.pi*(0.2*0.2)) * (math.pi*(nozzleSize/2*nozzleSize/2))
+
+ if printVolumePerSecond > maxPrintVolumePerSecond:
+ return WARNING, 'You are trying to print more then %.1fmm^3 of filament per second. This might cause filament slipping.' % (maxPrintVolumePerSecond)
+
+ return SUCCESS, ''
+ except ValueError:
+ #We already have an error by the int/float validator in this case.
+ return SUCCESS, ''
+