Fixed bug when wall width was less then the nozzle size.

Added advanced settings (mostly for 'joris' cups)
master
daid 2012-02-27 16:40:33 +01:00
parent 5921a7e947
commit bca89f9ce5
5 changed files with 66 additions and 14 deletions

View File

@ -22,6 +22,9 @@ def storedSetting(name):
def ifSettingAboveZero(name): def ifSettingAboveZero(name):
return lambda setting: float(getSetting(name, '0.0')) > 0 return lambda setting: float(getSetting(name, '0.0')) > 0
def ifSettingIs(name, value):
return lambda setting: getSetting(name) == value
def storedPercentSetting(name): def storedPercentSetting(name):
return lambda setting: float(getSetting(name, setting.value)) / 100 return lambda setting: float(getSetting(name, setting.value)) / 100
@ -40,11 +43,16 @@ def calculateEdgeWidth(setting):
return lineWidth return lineWidth
def calculateShells(setting): def calculateShells(setting):
wallThickness = float(getSetting('wall_thickness')) return calculateShellsImp(float(getSetting('wall_thickness')))
def calculateShellsBase(setting):
return calculateShellsImp(float(getSetting('wall_thickness')) + float(getSetting('extra_base_wall_thickness')))
def calculateShellsImp(wallThickness):
nozzleSize = float(getSetting('nozzle_size')) nozzleSize = float(getSetting('nozzle_size'))
if wallThickness < nozzleSize: if wallThickness < nozzleSize:
return wallThickness return 0
lineCount = int(wallThickness / nozzleSize + 0.0001) lineCount = int(wallThickness / nozzleSize + 0.0001)
lineWidth = wallThickness / lineCount lineWidth = wallThickness / lineCount
@ -106,10 +114,12 @@ def getSkeinPyPyProfileInformation():
'Volume_Fraction_ratio': DEFSET, 'Volume_Fraction_ratio': DEFSET,
},'fill': { },'fill': {
'Activate_Fill': "True", 'Activate_Fill': "True",
'Solid_Surface_Top': storedSetting("solid_top"),
'Override_First_Layer_Sequence': storedSetting("force_first_layer_sequence"),
'Diaphragm_Period_layers': DEFSET, 'Diaphragm_Period_layers': DEFSET,
'Diaphragm_Thickness_layers': DEFSET, 'Diaphragm_Thickness_layers': DEFSET,
'Extra_Shells_on_Alternating_Solid_Layer_layers': calculateShells, 'Extra_Shells_on_Alternating_Solid_Layer_layers': calculateShells,
'Extra_Shells_on_Base_layers': calculateShells, 'Extra_Shells_on_Base_layers': calculateShellsBase,
'Extra_Shells_on_Sparse_Layer_layers': calculateShells, 'Extra_Shells_on_Sparse_Layer_layers': calculateShells,
'Grid_Circle_Separation_over_Perimeter_Width_ratio': DEFSET, 'Grid_Circle_Separation_over_Perimeter_Width_ratio': DEFSET,
'Grid_Extra_Overlap_ratio': DEFSET, 'Grid_Extra_Overlap_ratio': DEFSET,
@ -119,10 +129,10 @@ def getSkeinPyPyProfileInformation():
'Infill_Begin_Rotation_degrees': DEFSET, 'Infill_Begin_Rotation_degrees': DEFSET,
'Infill_Begin_Rotation_Repeat_layers': DEFSET, 'Infill_Begin_Rotation_Repeat_layers': DEFSET,
'Infill_Odd_Layer_Extra_Rotation_degrees': DEFSET, 'Infill_Odd_Layer_Extra_Rotation_degrees': DEFSET,
'Grid_Circular': DEFSET, 'Grid_Circular': ifSettingIs('infill_type', 'Grid Circular'),
'Grid_Hexagonal': DEFSET, 'Grid_Hexagonal': ifSettingIs('infill_type', 'Grid Hexagonal'),
'Grid_Rectangular': DEFSET, 'Grid_Rectangular': ifSettingIs('infill_type', 'Grid Rectangular'),
'Line': DEFSET, 'Line': ifSettingIs('infill_type', 'Line'),
'Infill_Perimeter_Overlap_ratio': DEFSET, 'Infill_Perimeter_Overlap_ratio': DEFSET,
'Infill_Solidity_ratio': storedPercentSetting('fill_density'), 'Infill_Solidity_ratio': storedPercentSetting('fill_density'),
'Infill_Width': storedSetting("nozzle_size"), 'Infill_Width': storedSetting("nozzle_size"),

View File

@ -0,0 +1,34 @@
from __future__ import absolute_import
import __init__
import wx, os, platform, types
import ConfigParser
from fabmetheus_utilities import settings
from newui import configWindowBase
from newui import preview3d
from newui import sliceProgessPanel
from newui import alterationPanel
from newui import validators
class advancedConfigWindow(configWindowBase.configWindowBase):
"Advanced configuration window"
def __init__(self):
super(advancedConfigWindow, self).__init__(title='Advanced config')
left, right, main = self.CreateConfigPanel(self)
configWindowBase.TitleRow(left, "Accuracy")
c = configWindowBase.SettingRow(left, "Extra Wall thickness for bottom/top (mm)", 'extra_base_wall_thickness', '0.0', 'Additional perimeter thickness of the bottom layer.')
validators.validFloat(c, 0.0)
validators.wallThicknessValidator(c)
configWindowBase.TitleRow(left, "Infill")
c = configWindowBase.SettingRow(left, "Infill pattern", 'infill_type', ['Line', 'Grid Circular', 'Grid Hexagonal', 'Grid Rectangular'], 'Pattern of the none-solid infill. Line is default, but grids can provide a strong print.')
c = configWindowBase.SettingRow(left, "Solid infill top", 'solid_top', ['True', 'False'], 'Create a solid top surface, if set to false the top is filled with the fill percentage. Useful for cups.')
c = configWindowBase.SettingRow(left, "Force first layer sequence", 'force_first_layer_sequence', ['True', 'False'], 'This setting forces the order of the first layer to be \'Perimeter > Loops > Infill\'')
main.Fit()
self.Fit()

View File

@ -132,7 +132,6 @@ class SettingRow():
elif res == validators.WARNING and result != validators.ERROR: elif res == validators.WARNING and result != validators.ERROR:
result = res result = res
if res != validators.SUCCESS: if res != validators.SUCCESS:
print err
msgs.append(err) msgs.append(err)
if result == validators.ERROR: if result == validators.ERROR:
self.ctrl.SetBackgroundColour('Red') self.ctrl.SetBackgroundColour('Red')

View File

@ -7,6 +7,7 @@ import ConfigParser
from fabmetheus_utilities import settings from fabmetheus_utilities import settings
from newui import configWindowBase from newui import configWindowBase
from newui import advancedConfig
from newui import preview3d from newui import preview3d
from newui import sliceProgessPanel from newui import sliceProgessPanel
from newui import alterationPanel from newui import alterationPanel
@ -155,7 +156,7 @@ class mainWindow(configWindowBase.configWindowBase):
if self.filename != None: if self.filename != None:
self.preview3d.loadModelFile(self.filename) self.preview3d.loadModelFile(self.filename)
self.lastPath = os.path.split(self.filename)[0] self.lastPath = os.path.split(self.filename)[0]
self.updateProfileToControls() self.updateProfileToControls()
self.Fit() self.Fit()
@ -186,7 +187,7 @@ class mainWindow(configWindowBase.configWindowBase):
dlg.SetWildcard("OBJ, STL files (*.stl;*.obj)|*.stl;*.obj") dlg.SetWildcard("OBJ, STL files (*.stl;*.obj)|*.stl;*.obj")
if dlg.ShowModal() == wx.ID_OK: if dlg.ShowModal() == wx.ID_OK:
self.filename=dlg.GetPath() self.filename=dlg.GetPath()
putPreference('lastFile', self.filename) configWindowBase.putPreference('lastFile', self.filename)
if not(os.path.exists(self.filename)): if not(os.path.exists(self.filename)):
return return
self.lastPath = os.path.split(self.filename)[0] self.lastPath = os.path.split(self.filename)[0]
@ -208,7 +209,9 @@ class mainWindow(configWindowBase.configWindowBase):
self.progressPanelList.append(spp) self.progressPanelList.append(spp)
def OnExpertOpen(self, e): def OnExpertOpen(self, e):
pass acw = advancedConfig.advancedConfigWindow()
acw.Centre()
acw.Show(True)
def removeSliceProgress(self, spp): def removeSliceProgress(self, spp):
self.progressPanelList.remove(spp) self.progressPanelList.remove(spp)

View File

@ -769,6 +769,8 @@ class FillRepository:
self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Fill', self, '') self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Fill', self, '')
self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Fill') self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Fill')
self.activateFill = settings.BooleanSetting().getFromValue('Activate Fill', self, True) self.activateFill = settings.BooleanSetting().getFromValue('Activate Fill', self, True)
self.solidSurfaceTop = settings.BooleanSetting().getFromValue('Solid Surface Top', self, True)
self.overrideFirstLayerSequence = settings.BooleanSetting().getFromValue('Override First Layer Sequence', self, True)
settings.LabelSeparator().getFromRepository(self) settings.LabelSeparator().getFromRepository(self)
settings.LabelDisplay().getFromName('- Diaphragm -', self ) settings.LabelDisplay().getFromName('- Diaphragm -', self )
self.diaphragmPeriod = settings.IntSpin().getFromValue( 20, 'Diaphragm Period (layers):', self, 200, 100 ) self.diaphragmPeriod = settings.IntSpin().getFromValue( 20, 'Diaphragm Period (layers):', self, 200, 100 )
@ -862,8 +864,12 @@ class FillSkein:
self.distanceFeedRate.addLine('(<layer> %s )' % rotatedLayer.z) self.distanceFeedRate.addLine('(<layer> %s )' % rotatedLayer.z)
if layerRemainder >= int(round(self.repository.diaphragmThickness.value)): if layerRemainder >= int(round(self.repository.diaphragmThickness.value)):
for surroundingIndex in xrange(1, self.solidSurfaceThickness + 1): for surroundingIndex in xrange(1, self.solidSurfaceThickness + 1):
self.addRotatedCarve(layerIndex, -surroundingIndex, reverseRotation, surroundingCarves) if self.repository.solidSurfaceTop.value:
self.addRotatedCarve(layerIndex, surroundingIndex, reverseRotation, surroundingCarves) self.addRotatedCarve(layerIndex, -surroundingIndex, reverseRotation, surroundingCarves)
self.addRotatedCarve(layerIndex, surroundingIndex, reverseRotation, surroundingCarves)
else:
self.addRotatedCarve(layerIndex, -surroundingIndex, reverseRotation, surroundingCarves)
self.addRotatedCarve(layerIndex, -surroundingIndex, reverseRotation, surroundingCarves)
if len(surroundingCarves) < self.doubleSolidSurfaceThickness: if len(surroundingCarves) < self.doubleSolidSurfaceThickness:
extraShells = self.repository.extraShellsAlternatingSolidLayer.value extraShells = self.repository.extraShellsAlternatingSolidLayer.value
if self.lastExtraShells != self.repository.extraShellsBase.value: if self.lastExtraShells != self.repository.extraShellsBase.value:
@ -1085,7 +1091,7 @@ class FillSkein:
self.oldOrderedLocation = getLowerLeftCorner(nestedRings) self.oldOrderedLocation = getLowerLeftCorner(nestedRings)
extrusionHalfWidth = 0.5 * self.infillWidth extrusionHalfWidth = 0.5 * self.infillWidth
threadSequence = self.threadSequence threadSequence = self.threadSequence
if layerIndex < 1: if layerIndex < 1 and self.repository.overrideFirstLayerSequence.value:
threadSequence = ['edge', 'loops', 'infill'] threadSequence = ['edge', 'loops', 'infill']
euclidean.addToThreadsRemove(extrusionHalfWidth, nestedRings, self.oldOrderedLocation, self, threadSequence) euclidean.addToThreadsRemove(extrusionHalfWidth, nestedRings, self.oldOrderedLocation, self, threadSequence)
if testLoops != None: if testLoops != None: