Browse Source

Merge pull request #9997 from Ultimaker/CURA-8109_option_centre_walls_last

Change outer_inset_first setting to an enum, adding Center Last option
Remco Burema 3 years ago
parent
commit
4f37bcec0b

+ 14 - 1
plugins/VersionUpgrade/VersionUpgrade49to50/VersionUpgrade49to50.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Ultimaker B.V.
+# Copyright (c) 2021 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 import configparser
@@ -38,6 +38,12 @@ class VersionUpgrade49to50(VersionUpgrade):
             for removed in _removed_settings:
                 if removed in visible_settings:
                     visible_settings.remove(removed)
+
+            # Replace Outer Before Inner Walls with equivalent.
+            if "outer_inset_first" in visible_settings:
+                visible_settings.remove("outer_inset_first")
+                visible_settings.add("inset_direction")
+
             parser["general"]["visible_settings"] = ";".join(visible_settings)
 
         result = io.StringIO()
@@ -69,6 +75,13 @@ class VersionUpgrade49to50(VersionUpgrade):
                 if removed in parser["values"]:
                     del parser["values"][removed]
 
+            # Replace Outer Before Inner Walls with equivalent setting.
+            if "outer_inset_first" in parser["values"]:
+                old_value = parser["values"]["outer_inset_first"]
+                if old_value.startswith("="):  # Was already a formula.
+                    old_value = old_value[1:]
+                parser["values"]["inset_direction"] = f"='outside_in' if ({old_value}) else 'inside_out'"  # Makes it work both with plain setting values and formulas.
+
             # Disable Fuzzy Skin as it doesn't work with with the libArachne walls
             if "magic_fuzzy_skin_enabled" in parser["values"]:
                 parser["values"]["magic_fuzzy_skin_enabled"] = "False"

+ 2 - 2
resources/definitions/eryone_thinker.def.json

@@ -121,8 +121,8 @@
         "optimize_wall_printing_order": {
             "default_value": true 
         },
-        "outer_inset_first": {
-            "default_value": false 
+        "inset_direction": {
+            "default_value": "inside_out"
         },
         "retract_at_layer_change": {
             "value": true

+ 12 - 8
resources/definitions/fdmprinter.def.json

@@ -831,7 +831,7 @@
                                     "description": "Width of the outermost wall line. By lowering this value, higher levels of detail can be printed.",
                                     "unit": "mm",
                                     "minimum_value": "0.001",
-                                    "minimum_value_warning": "(0.1 + 0.4 * machine_nozzle_size) if outer_inset_first else 0.1 * machine_nozzle_size",
+                                    "minimum_value_warning": "(0.1 + 0.4 * machine_nozzle_size) if inset_direction == \"outside_in\" else 0.1 * machine_nozzle_size",
                                     "maximum_value_warning": "2 * machine_nozzle_size",
                                     "default_value": 0.4,
                                     "value": "wall_line_width",
@@ -1159,7 +1159,7 @@
                     "unit": "mm",
                     "type": "float",
                     "default_value": 0.0,
-                    "value": "(machine_nozzle_size - wall_line_width_0) / 2 if (wall_line_width_0 < machine_nozzle_size and not outer_inset_first) else 0",
+                    "value": "(machine_nozzle_size - wall_line_width_0) / 2 if (wall_line_width_0 < machine_nozzle_size and inset_direction != \"outside_in\") else 0",
                     "minimum_value_warning": "0",
                     "maximum_value_warning": "machine_nozzle_size",
                     "limit_to_extruder": "wall_0_extruder_nr",
@@ -1173,13 +1173,17 @@
                     "default_value": false,
                     "settable_per_mesh": true
                 },
-                "outer_inset_first":
+                "inset_direction":
                 {
-                    "label": "Outer Before Inner Walls",
-                    "description": "Prints walls in order of outside to inside when enabled. This can help improve dimensional accuracy in X and Y when using a high viscosity plastic like ABS; however it can decrease outer surface print quality, especially on overhangs.",
-                    "type": "bool",
-                    "default_value": false,
-                    "enabled": "wall_0_extruder_nr == wall_x_extruder_nr",
+                    "label": "Wall Ordering",
+                    "description": "Determines the order in which walls are printed. Printing outer walls earlier helps with dimensional accuracy, as faults from inner walls cannot propagate to the outside. However printing them later allows them to stack better when overhangs are printed.",
+                    "type": "enum",
+                    "options": {
+                        "inside_out": "Inside To Outside",
+                        "outside_in": "Outside To Inside",
+                        "center_last": "Center Last"
+                    },
+                    "default_value": "inside_out",
                     "settable_per_mesh": true
                 },
                 "alternate_extra_perimeter":

+ 1 - 1
resources/definitions/hms434.def.json

@@ -89,7 +89,7 @@
         "top_layers":                {"value": "4 if infill_sparse_density < 95 else 1" },
         "bottom_layers":             {"value": "(top_layers)" },
         "wall_0_inset":              {"value": "0" },
-        "outer_inset_first":         {"value": true },
+        "inset_direction":           {"value": "'outside_in'" },
         "alternate_extra_perimeter": {"value": false },
         "filter_out_tiny_gaps":      {"value": true },
         "fill_outline_gaps":         {"value": true },

+ 1 - 1
resources/definitions/maker_made_300x.def.json

@@ -49,7 +49,7 @@
         "top_bottom_pattern_0": {"value": "'lines'" },
         "wall_0_inset": {"value": 0},
         "optimize_wall_printing_order": {"value": false },
-        "outer_inset_first": {"value": false },
+        "inset_direction": {"value": "'inside_out'" },
         "alternate_extra_perimeter": {"value": false },
         "wall_min_flow": {"value": 0},
         "filter_out_tiny_gaps": {"value": true },

+ 1 - 1
resources/quality/key3d/key3d_tyro_best.inst.cfg

@@ -28,7 +28,7 @@ top_bottom_pattern = lines
 top_bottom_pattern_0 = lines
 wall_0_inset = 0
 optimize_wall_printing_order = False
-outer_inset_first = False
+inset_direction = inside_out
 alternate_extra_perimeter = False
 wall_min_flow = 0
 filter_out_tiny_gaps = True

+ 1 - 1
resources/quality/key3d/key3d_tyro_fast.inst.cfg

@@ -27,7 +27,7 @@ top_bottom_pattern = lines
 top_bottom_pattern_0 = lines
 wall_0_inset = 0
 optimize_wall_printing_order = False
-outer_inset_first = False
+inset_direction = inside_out
 alternate_extra_perimeter = False
 wall_min_flow = 0
 filter_out_tiny_gaps = True

+ 1 - 1
resources/quality/key3d/key3d_tyro_normal.inst.cfg

@@ -27,7 +27,7 @@ top_bottom_pattern = lines
 top_bottom_pattern_0 = lines
 wall_0_inset = 0
 optimize_wall_printing_order = False
-outer_inset_first = False
+inset_direction = inside_out
 alternate_extra_perimeter = False
 wall_min_flow = 0
 filter_out_tiny_gaps = True

+ 1 - 1
resources/quality/nwa3d_a31/nwa3d_a31_best.inst.cfg

@@ -29,7 +29,7 @@ top_bottom_pattern = lines
 top_bottom_pattern_0 = lines
 wall_0_inset = 0
 optimize_wall_printing_order = False
-outer_inset_first = False
+inset_direction = inside_out
 alternate_extra_perimeter = False
 wall_min_flow = 0
 filter_out_tiny_gaps = True

+ 1 - 1
resources/quality/nwa3d_a31/nwa3d_a31_e.inst.cfg

@@ -26,7 +26,7 @@ top_bottom_pattern = lines
 top_bottom_pattern_0 = lines
 wall_0_inset = 0
 optimize_wall_printing_order = False
-outer_inset_first = False
+inset_direction = inside_out
 alternate_extra_perimeter = False
 wall_min_flow = 0
 filter_out_tiny_gaps = True

Some files were not shown because too many files changed in this diff