Convert unit of adaptive layers threshold and change name

This usage is hopefully more intuitive than the previous one.
This commit is contained in:
Ghostkeeper 2019-11-01 11:54:17 +01:00
parent 05b1ce9658
commit eaedca1917
No known key found for this signature in database
GPG key ID: 59A4C0959592C05C
2 changed files with 11 additions and 3 deletions

View file

@ -66,6 +66,13 @@ class VersionUpgrade43to44(VersionUpgrade):
# Alternate skin rotation should be translated to top/bottom line directions.
if "skin_alternate_rotation" in parser["values"] and parseBool(parser["values"]["skin_alternate_rotation"]):
parser["values"]["skin_angles"] = "[45, 135, 0, 90]"
# Unit of adaptive layers topography size changed.
if "adaptive_layer_height_threshold" in parser["values"]:
val = parser["values"]["adaptive_layer_height_threshold"]
if val.startswith("="):
val = val[1:]
val = "=({val}) / 1000".format(val = val) # Convert microns to millimetres. Works even if the profile contained a formula.
parser["values"]["adaptive_layer_height_threshold"] = val
result = io.StringIO()
parser.write(result)