diff --git a/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py b/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py index 38de647..bd4c89b 100644 --- a/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py +++ b/SkeinPyPy_NewUI/fabmetheus_utilities/settings.py @@ -22,6 +22,9 @@ def storedSetting(name): def ifSettingAboveZero(name): return lambda setting: float(getSetting(name, '0.0')) > 0 +def ifSettingIs(name, value): + return lambda setting: getSetting(name) == value + def storedPercentSetting(name): return lambda setting: float(getSetting(name, setting.value)) / 100 @@ -40,11 +43,16 @@ def calculateEdgeWidth(setting): return lineWidth 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')) if wallThickness < nozzleSize: - return wallThickness + return 0 lineCount = int(wallThickness / nozzleSize + 0.0001) lineWidth = wallThickness / lineCount @@ -106,10 +114,12 @@ def getSkeinPyPyProfileInformation(): 'Volume_Fraction_ratio': DEFSET, },'fill': { 'Activate_Fill': "True", + 'Solid_Surface_Top': storedSetting("solid_top"), + 'Override_First_Layer_Sequence': storedSetting("force_first_layer_sequence"), 'Diaphragm_Period_layers': DEFSET, 'Diaphragm_Thickness_layers': DEFSET, '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, 'Grid_Circle_Separation_over_Perimeter_Width_ratio': DEFSET, 'Grid_Extra_Overlap_ratio': DEFSET, @@ -119,10 +129,10 @@ def getSkeinPyPyProfileInformation(): 'Infill_Begin_Rotation_degrees': DEFSET, 'Infill_Begin_Rotation_Repeat_layers': DEFSET, 'Infill_Odd_Layer_Extra_Rotation_degrees': DEFSET, - 'Grid_Circular': DEFSET, - 'Grid_Hexagonal': DEFSET, - 'Grid_Rectangular': DEFSET, - 'Line': DEFSET, + 'Grid_Circular': ifSettingIs('infill_type', 'Grid Circular'), + 'Grid_Hexagonal': ifSettingIs('infill_type', 'Grid Hexagonal'), + 'Grid_Rectangular': ifSettingIs('infill_type', 'Grid Rectangular'), + 'Line': ifSettingIs('infill_type', 'Line'), 'Infill_Perimeter_Overlap_ratio': DEFSET, 'Infill_Solidity_ratio': storedPercentSetting('fill_density'), 'Infill_Width': storedSetting("nozzle_size"), diff --git a/SkeinPyPy_NewUI/newui/advancedConfig.py b/SkeinPyPy_NewUI/newui/advancedConfig.py new file mode 100644 index 0000000..6bdfe8d --- /dev/null +++ b/SkeinPyPy_NewUI/newui/advancedConfig.py @@ -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() + diff --git a/SkeinPyPy_NewUI/newui/configWindowBase.py b/SkeinPyPy_NewUI/newui/configWindowBase.py index 81da88f..730cb73 100644 --- a/SkeinPyPy_NewUI/newui/configWindowBase.py +++ b/SkeinPyPy_NewUI/newui/configWindowBase.py @@ -132,7 +132,6 @@ class SettingRow(): elif res == validators.WARNING and result != validators.ERROR: result = res if res != validators.SUCCESS: - print err msgs.append(err) if result == validators.ERROR: self.ctrl.SetBackgroundColour('Red') diff --git a/SkeinPyPy_NewUI/newui/mainWindow.py b/SkeinPyPy_NewUI/newui/mainWindow.py index 483d257..4e6231e 100644 --- a/SkeinPyPy_NewUI/newui/mainWindow.py +++ b/SkeinPyPy_NewUI/newui/mainWindow.py @@ -7,6 +7,7 @@ import ConfigParser from fabmetheus_utilities import settings from newui import configWindowBase +from newui import advancedConfig from newui import preview3d from newui import sliceProgessPanel from newui import alterationPanel @@ -155,7 +156,7 @@ class mainWindow(configWindowBase.configWindowBase): if self.filename != None: self.preview3d.loadModelFile(self.filename) self.lastPath = os.path.split(self.filename)[0] - + self.updateProfileToControls() self.Fit() @@ -186,7 +187,7 @@ class mainWindow(configWindowBase.configWindowBase): dlg.SetWildcard("OBJ, STL files (*.stl;*.obj)|*.stl;*.obj") if dlg.ShowModal() == wx.ID_OK: self.filename=dlg.GetPath() - putPreference('lastFile', self.filename) + configWindowBase.putPreference('lastFile', self.filename) if not(os.path.exists(self.filename)): return self.lastPath = os.path.split(self.filename)[0] @@ -208,7 +209,9 @@ class mainWindow(configWindowBase.configWindowBase): self.progressPanelList.append(spp) def OnExpertOpen(self, e): - pass + acw = advancedConfig.advancedConfigWindow() + acw.Centre() + acw.Show(True) def removeSliceProgress(self, spp): self.progressPanelList.remove(spp) diff --git a/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/fill.py b/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/fill.py index 75ea0f2..7cf5bcc 100644 --- a/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/fill.py +++ b/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/fill.py @@ -769,6 +769,8 @@ class FillRepository: 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.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.LabelDisplay().getFromName('- Diaphragm -', self ) self.diaphragmPeriod = settings.IntSpin().getFromValue( 20, 'Diaphragm Period (layers):', self, 200, 100 ) @@ -862,8 +864,12 @@ class FillSkein: self.distanceFeedRate.addLine('( %s )' % rotatedLayer.z) if layerRemainder >= int(round(self.repository.diaphragmThickness.value)): for surroundingIndex in xrange(1, self.solidSurfaceThickness + 1): - self.addRotatedCarve(layerIndex, -surroundingIndex, reverseRotation, surroundingCarves) - self.addRotatedCarve(layerIndex, surroundingIndex, reverseRotation, surroundingCarves) + if self.repository.solidSurfaceTop.value: + 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: extraShells = self.repository.extraShellsAlternatingSolidLayer.value if self.lastExtraShells != self.repository.extraShellsBase.value: @@ -1085,7 +1091,7 @@ class FillSkein: self.oldOrderedLocation = getLowerLeftCorner(nestedRings) extrusionHalfWidth = 0.5 * self.infillWidth threadSequence = self.threadSequence - if layerIndex < 1: + if layerIndex < 1 and self.repository.overrideFirstLayerSequence.value: threadSequence = ['edge', 'loops', 'infill'] euclidean.addToThreadsRemove(extrusionHalfWidth, nestedRings, self.oldOrderedLocation, self, threadSequence) if testLoops != None: