diff --git a/src/Mod/Path/Gui/Resources/preferences/PathJob.ui b/src/Mod/Path/Gui/Resources/preferences/PathJob.ui index ea793c3cc4..2e84541bbc 100644 --- a/src/Mod/Path/Gui/Resources/preferences/PathJob.ui +++ b/src/Mod/Path/Gui/Resources/preferences/PathJob.ui @@ -17,7 +17,7 @@ - 2 + 0 @@ -91,18 +91,28 @@ - - + + + + + Default value for new Jobs, used for computing Paths. Smaller increases accuracy, but slows down computation + + + + Default Geometry Tolerance - - - - Default value for new Jobs, used for computing Paths. Smaller increases accuracy, but slows down computation + + + + + + + Default Curve Accuracy @@ -132,8 +142,8 @@ 0 0 - 422 - 558 + 406 + 360 @@ -334,6 +344,14 @@ + + + 0 + 0 + 422 + 558 + + Setup diff --git a/src/Mod/Path/Init.py b/src/Mod/Path/Init.py index 28c1bc22b5..3fa8e508b8 100644 --- a/src/Mod/Path/Init.py +++ b/src/Mod/Path/Init.py @@ -29,3 +29,7 @@ ParGrp.SetString("HelpIndex", "Path/Help/index.html") ParGrp.SetString("WorkBenchName", "Path") ParGrp.SetString("WorkBenchModule", "PathWorkbench.py") +# Setup global default values +import Path +from PathScripts.PathPreferences import PathPreferences +Path.Area.setDefaultParams(Accuracy = PathPreferences.defaultLibAreaCurveAccuracy()) diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index d8cde7f3bc..1609b377c0 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -42,7 +42,8 @@ class PathPreferences: PostProcessorOutputPolicy = "PostProcessorOutputPolicy" # Linear tolerance to use when generating Paths, eg when tesselating geometry - GeometryTolerance = "GeometryTolerance" + GeometryTolerance = "GeometryTolerance" + LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" @classmethod def preferences(cls): @@ -90,6 +91,10 @@ class PathPreferences: def defaultGeometryTolerance(cls): return cls.preferences().GetFloat(cls.GeometryTolerance, 0.01) + @classmethod + def defaultLibAreaCurveAccuracy(cls): + return cls.preferences().GetFloat(cls.LibAreaCurveAccuracy, 0.01) + @classmethod def defaultFilePath(cls): return cls.preferences().GetString(cls.DefaultFilePath) @@ -125,12 +130,13 @@ class PathPreferences: return '' @classmethod - def setJobDefaults(cls, filePath, jobTemplate, geometryTolerance): - PathLog.track("(%s='%s', %s, %s)" % (cls.DefaultFilePath, filePath, jobTemplate, geometryTolerance)) + def setJobDefaults(cls, filePath, jobTemplate, geometryTolerance, curveAccuracy): + PathLog.track("(%s='%s', %s, %s, %s)" % (cls.DefaultFilePath, filePath, jobTemplate, geometryTolerance, curveAccuracy)) pref = cls.preferences() pref.SetString(cls.DefaultFilePath, filePath) pref.SetString(cls.DefaultJobTemplate, jobTemplate) pref.SetFloat(cls.GeometryTolerance, geometryTolerance) + pref.SetFloat(cls.LibAreaCurveAccuracy, curveAccuracy) @classmethod def postProcessorBlacklist(cls): diff --git a/src/Mod/Path/PathScripts/PathPreferencesPathJob.py b/src/Mod/Path/PathScripts/PathPreferencesPathJob.py index ae290e0374..9839883ab2 100644 --- a/src/Mod/Path/PathScripts/PathPreferencesPathJob.py +++ b/src/Mod/Path/PathScripts/PathPreferencesPathJob.py @@ -50,7 +50,8 @@ class JobPreferencesPage: filePath = self.form.leDefaultFilePath.text() jobTemplate = self.form.leDefaultJobTemplate.text() geometryTolerance = Units.Quantity(self.form.geometryTolerance.text()) - PathPreferences.setJobDefaults(filePath, jobTemplate, geometryTolerance) + curveAccuracy = Units.Quantity(self.form.curveAccuracy.text()) + PathPreferences.setJobDefaults(filePath, jobTemplate, geometryTolerance, curveAccuracy) processor = str(self.form.defaultPostProcessor.currentText()) args = str(self.form.defaultPostProcessorArgs.text()) @@ -148,6 +149,7 @@ class JobPreferencesPage: geomTol = Units.Quantity(PathPreferences.defaultGeometryTolerance(), Units.Length) self.form.geometryTolerance.setText(geomTol.UserString) + self.form.curveAccuracy.setText(Units.Quantity(PathPreferences.defaultLibAreaCurveAccuracy(), Units.Length).UserString) self.form.leOutputFile.setText(PathPreferences.defaultOutputFile()) self.selectComboEntry(self.form.cboOutputPolicy, PathPreferences.defaultOutputPolicy())