Add bottom layer thickness. Fix bug with line with in 3D preview (was not calculated from layer thickness)

This commit is contained in:
daid 2012-04-05 16:50:59 +02:00
parent 374b2d1b5e
commit 835b7883ca
8 changed files with 42 additions and 5 deletions

View File

@ -64,6 +64,27 @@ def calculateMultiplyDistance(setting):
edgeWidth = calculateEdgeWidth(setting)
return 10.0 / edgeWidth
def calcBottomLayerFlowRateRatio(setting):
bottomThickness = float(profile.getProfileSetting('bottom_thickness'))
layerThickness = float(profile.getProfileSetting('layer_height'))
if bottomThickness < layerThickness:
return 1.0
return bottomThickness / layerThickness
def calcExtraBottomThickness(setting):
bottomThickness = float(profile.getProfileSetting('bottom_thickness'))
layerThickness = float(profile.getProfileSetting('layer_height'))
if bottomThickness < layerThickness:
return 0.0
return bottomThickness - layerThickness
def calcLayerSkip(setting):
bottomThickness = float(profile.getProfileSetting('bottom_thickness'))
layerThickness = float(profile.getProfileSetting('layer_height'))
if bottomThickness < layerThickness:
return 0
return int(math.ceil((bottomThickness - layerThickness) / layerThickness + 0.0001) - 1)
def getProfileInformation():
return {
'carve': {
@ -72,7 +93,7 @@ def getProfileInformation():
'Extra_Decimal_Places_float': DEFSET,
'Import_Coarseness_ratio': DEFSET,
'Layer_Height_mm': storedSetting("layer_height"),
'Layers_From_index': DEFSET,
'Layers_From_index': calcLayerSkip,
'Layers_To_index': DEFSET,
'Correct_Mesh': DEFSET,
'Unproven_Mesh': DEFSET,
@ -90,7 +111,7 @@ def getProfileInformation():
},'bottom': {
'Activate_Bottom': DEFSET,
'Additional_Height_over_Layer_Thickness_ratio': DEFSET,
'Altitude_mm': DEFSET,
'Altitude_mm': calcExtraBottomThickness,
'SVG_Viewer': DEFSET,
},'preface': {
'Meta': DEFSET,
@ -167,6 +188,7 @@ def getProfileInformation():
'Perimeter_Feed_Rate_Multiplier_ratio': DEFSET,
'Perimeter_Flow_Rate_Multiplier_ratio': DEFSET,
'Travel_Feed_Rate_mm/s': storedSetting("travel_speed"),
'Bottom_layer_flow_rate_ratio': calcBottomLayerFlowRateRatio,
},'temperature': {
'Activate_Temperature': DEFSET,#ifSettingAboveZero('print_temperature'),
'Cooling_Rate_Celcius/second': DEFSET,

View File

@ -210,6 +210,8 @@ class SpeedRepository:
settings.LabelSeparator().getFromRepository(self)
self.travelFeedRatePerSecond = settings.FloatSpin().getFromValue( 2.0, 'Travel Feed Rate (mm/s):', self, 350.0, 250.0 )
self.executeTitle = 'Speed'
self.bottomLayerFlowRateMultiplier = settings.FloatSpin().getFromValue(0.0, 'Bottom layer flow rate (ratio):', self, 10.0, 1.0)
def execute(self):
"Speed button has been clicked."
@ -246,6 +248,8 @@ class SpeedSkein:
flowRate *= ((self.repository.objectFirstLayerFlowRatePerimeterMultiplier.value * (self.repository.objectFirstLayersLayerAmount.value - self.layerIndex)) + self.layerIndex) / self.repository.objectFirstLayersLayerAmount.value
else:
flowRate *= ((self.repository.objectFirstLayerFlowRateInfillMultiplier.value * (self.repository.objectFirstLayersLayerAmount.value - self.layerIndex)) + self.layerIndex) / self.repository.objectFirstLayersLayerAmount.value
if self.layerIndex == 0:
flowRate *= self.repository.bottomLayerFlowRateMultiplier.value
if flowRate != self.oldFlowRate:
self.distanceFeedRate.addLine('M108 S' + euclidean.getFourSignificantFigures(flowRate))
self.oldFlowRate = flowRate

View File

@ -171,6 +171,10 @@ class mainWindow(configBase.configWindowBase):
validators.validFloat(c, 0.0)
c = configBase.SettingRow(right, "Enable cooling fan", 'fan_enabled', True, 'Enable the cooling fan during the print. The extra cooling from the cooling fan is essensial during faster prints.')
configBase.TitleRow(right, "Accuracy")
c = configBase.SettingRow(right, "Initial layer thickness (mm)", 'bottom_thickness', '0.0', 'Layer thickness of the bottom layer. A thicker bottom layer makes sticking to the bed easier. Set to 0.0 to have the bottom layer thickness the same as the other layers.')
validators.validFloat(c, 0.0)
nb.AddPage(alterationPanel.alterationPanel(nb), "Start/End-GCode")
# load and slice buttons.

View File

@ -439,10 +439,13 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
layerThickness = 0.0
filamentRadius = float(profile.getProfileSetting('filament_diameter')) / 2
filamentArea = math.pi * filamentRadius * filamentRadius
lineWidth = float(profile.getProfileSetting('nozzle_size')) / 2
lineWidth = float(profile.getProfileSetting('nozzle_size')) / 2 / 10
curLayerNum = 0
for layer in self.parent.gcode.layerList:
curLayerZ = layer[0].list[1].z
layerThickness = curLayerZ - prevLayerZ
prevLayerZ = layer[-1].list[-1].z
for path in layer:
c = 1.0
if curLayerNum != self.parent.layerSpin.GetValue():

View File

@ -199,7 +199,7 @@ class printWindow(wx.Frame):
self.temp = float(re.search("[0-9\.]*", line.split('T:')[1]).group(0))
wx.CallAfter(self.UpdateProgress)
if self.printIdx == None:
if line == '': #When we have a communication "timeout" and we're not sending gcode read the temperature.
if line == '': #When we have a communication "timeout" and we're not sending gcode, then read the temperature.
self.machineCom.sendCommand("M105")
else:
if line.startswith("ok"):

View File

@ -214,6 +214,7 @@ class simpleModeWindow(configBase.configWindowBase):
put('raft_margin', '5')
put('raft_base_material_amount', '100')
put('raft_interface_material_amount', '100')
put('bottom_thickness', '0.0')
if self.printSupport.GetValue():
put('support', 'Exterior Only')
@ -234,6 +235,7 @@ class simpleModeWindow(configBase.configWindowBase):
put('layer_height', '0.1')
put('fill_density', '30')
put('bottom_layer_speed', '15')
put('bottom_thickness', '0.2')
elif self.printTypeJoris.GetValue():
put('wall_thickness', nozzle_size * 1.5)
put('layer_height', '0.2')
@ -255,6 +257,7 @@ class simpleModeWindow(configBase.configWindowBase):
put('enable_raft', 'True')
put('skirt_line_count', '0')
put('fan_layer', '1')
put('bottom_thickness', '0.0')
#Create a progress panel and add it to the window. The progress panel will start the Skein operation.
spp = sliceProgessPanel.sliceProgessPanel(self, self, self.filename)

View File

@ -61,6 +61,7 @@ profileDefaultSettings = {
'raft_margin': '5',
'raft_base_material_amount': '100',
'raft_interface_material_amount': '100',
'bottom_thickness': '0.0',
}
preferencesDefaultSettings = {
'wizardDone': 'False',

View File

@ -89,7 +89,7 @@ def getSliceCommand(filename):
'--solid-layers', str(profile.calculateSolidLayerCount()),
'--fill-density', str(float(profile.getProfileSetting('fill_density'))/100),
'--fill-angle', '45',
'--fill-pattern', 'rectilinear',
'--fill-pattern', 'rectilinear', #rectilinear line concentric hilbertcurve archimedeanchords octagramspiral
'--solid-fill-pattern', 'rectilinear',
'--start-gcode', profile.getAlterationFilePath('start.gcode'),
'--end-gcode', profile.getAlterationFilePath('end.gcode'),