Change setting value defaults for maximum resolution to use deviation

All profiles that use maximum resolution should use maximum deviation instead, and halve it.

Contributes to issue CURA-6458.
This commit is contained in:
Ghostkeeper 2019-04-16 11:36:07 +02:00
parent 60777b72fc
commit 6325a5f1c2
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 12 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2018 Ultimaker B.V.
# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
@ -49,6 +49,15 @@ class VersionUpgrade40to41(VersionUpgrade):
parser["general"]["version"] = "4"
parser["metadata"]["setting_version"] = "7"
# Limit Maximum Deviation instead of Maximum Resolution. This should have approximately the same effect as before the algorithm change, only more consistent.
if "meshfix_maximum_resolution" in parser["values"]:
resolution = parser["values"]["meshfix_maximum_resolution"]
if resolution.startswith("="):
resolution = resolution[1:]
resolution = "=(" + resolution + ") / 2"
parser["values"]["meshfix_maximum_deviation"] = resolution
del parser["values"]["meshfix_maximum_resolution"]
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]