From 503d5d2a35dbbee496d6864dbd8dbc264164bb20 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Wed, 20 May 2020 13:56:24 +0200 Subject: [PATCH] Correctly upgrade the ironing_inset based on the ironing_pattern used Previously, the ironing_inset was changed in the profiles to reflect the changes made in the CuraEngine. This inset though was not taking into account the ironing_pattern (in the CuraEngine, the inset is compensated differently depending on the pattern). This commit fixes that in the version upgrader and the printer definitions in order to maintain the same behavior for the old profiles. CURA-7318 --- .../VersionUpgrade462to47/VersionUpgrade462to47.py | 6 +++++- resources/definitions/fdmprinter.def.json | 2 +- resources/definitions/hms434.def.json | 2 +- resources/definitions/skriware_2.def.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py index 7b328e10e6..70de42ab3b 100644 --- a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py +++ b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py @@ -64,7 +64,11 @@ class VersionUpgrade462to47(VersionUpgrade): ironing_inset = parser["values"]["ironing_inset"] if ironing_inset.startswith("="): ironing_inset = ironing_inset[1:] - ironing_inset = "=(" + ironing_inset + ") + skin_line_width * (1.0 - ironing_flow) / 2" + if "ironing_pattern" in parser["values"] and parser["values"]["ironing_pattern"] == "concentric": + correction = " + ironing_line_spacing - skin_line_width * (1.0 + ironing_flow / 100) / 2" + else: # If ironing_pattern doesn't exist, it means the default (zigzag) is selected + correction = " + skin_line_width * (1.0 - ironing_flow / 100) / 2" + ironing_inset = "=(" + ironing_inset + ")" + correction parser["values"]["ironing_inset"] = ironing_inset result = io.StringIO() diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 41031dbe2c..cfc3c6dc31 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1575,7 +1575,7 @@ "type": "float", "unit": "mm", "default_value": 0.35, - "value": "wall_line_width_0 / 2 + skin_line_width * (1.0 - ironing_flow) / 2", + "value": "wall_line_width_0 / 2 + (ironing_line_spacing - skin_line_width * (1.0 + ironing_flow / 100) / 2 if ironing_pattern == 'concentric' else skin_line_width * (1.0 - ironing_flow / 100) / 2)", "minimum_value_warning": "0", "maximum_value_warning": "wall_line_width_0", "enabled": "ironing_enabled", diff --git a/resources/definitions/hms434.def.json b/resources/definitions/hms434.def.json index 07ea24b2c2..cd20906ccc 100644 --- a/resources/definitions/hms434.def.json +++ b/resources/definitions/hms434.def.json @@ -104,7 +104,7 @@ "skin_outline_count": {"value": "0"}, "ironing_line_spacing": {"value": "line_width / 4 * 3"}, "ironing_flow": {"value": "0"}, - "ironing_inset": {"value": "ironing_line_spacing + skin_line_width * (1.0 - ironing_flow) / 2"}, + "ironing_inset": {"value": "ironing_line_spacing + (ironing_line_spacing - skin_line_width * (1.0 + ironing_flow / 100) / 2 if ironing_pattern == 'concentric' else skin_line_width * (1.0 - ironing_flow / 100) / 2)"}, "speed_ironing": {"value": "150"}, "infill_sparse_density": {"value": 30}, diff --git a/resources/definitions/skriware_2.def.json b/resources/definitions/skriware_2.def.json index 3b127b9a8f..ab5532db81 100644 --- a/resources/definitions/skriware_2.def.json +++ b/resources/definitions/skriware_2.def.json @@ -345,7 +345,7 @@ "value": "0.8" }, "ironing_inset": { - "value": "0.2 + skin_line_width * (1.0 - ironing_flow) / 2" + "value": "0.2 + (ironing_line_spacing - skin_line_width * (1.0 + ironing_flow / 100) / 2 if ironing_pattern == 'concentric' else skin_line_width * (1.0 - ironing_flow / 100) / 2)" }, "jerk_travel": { "value": "10"