Merge pull request #4598 from DesktopMetal/feature_support_line_directions

Feature: "Support Infill/Interface Line Directions"
This commit is contained in:
Lipu Fei 2019-08-12 10:47:08 +02:00 committed by GitHub
commit 5804110c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 9 deletions

View File

@ -18,6 +18,10 @@ _removed_settings = {
"start_layers_at_same_position" "start_layers_at_same_position"
} }
_renamed_settings = {
"support_infill_angle": "support_infill_angles"
} # type: Dict[str, str]
## Upgrades configurations from the state they were in at version 4.2 to the ## Upgrades configurations from the state they were in at version 4.2 to the
# state they should be in at version 4.3. # state they should be in at version 4.3.
class VersionUpgrade42to43(VersionUpgrade): class VersionUpgrade42to43(VersionUpgrade):
@ -46,6 +50,17 @@ class VersionUpgrade42to43(VersionUpgrade):
if "camera_perspective_mode" in parser["general"] and parser["general"]["camera_perspective_mode"] == "orthogonal": if "camera_perspective_mode" in parser["general"] and parser["general"]["camera_perspective_mode"] == "orthogonal":
parser["general"]["camera_perspective_mode"] = "orthographic" parser["general"]["camera_perspective_mode"] = "orthographic"
# Fix renamed settings for visibility
if "visible_settings" in parser["general"]:
all_setting_keys = parser["general"]["visible_settings"].strip().split(";")
if all_setting_keys:
for idx, key in enumerate(all_setting_keys):
if key in _renamed_settings:
all_setting_keys[idx] = _renamed_settings[key]
parser["general"]["visible_settings"] = ";".join(all_setting_keys)
parser["metadata"]["setting_version"] = "9"
result = io.StringIO() result = io.StringIO()
parser.write(result) parser.write(result)
return [filename], [result.getvalue()] return [filename], [result.getvalue()]
@ -62,10 +77,19 @@ class VersionUpgrade42to43(VersionUpgrade):
parser["metadata"]["setting_version"] = "9" parser["metadata"]["setting_version"] = "9"
if "values" in parser: if "values" in parser:
for old_name, new_name in _renamed_settings.items():
if old_name in parser["values"]:
parser["values"][new_name] = parser["values"][old_name]
del parser["values"][old_name]
for key in _removed_settings: for key in _removed_settings:
if key in parser["values"]: if key in parser["values"]:
del parser["values"][key] del parser["values"][key]
if "support_infill_angles" in parser["values"]:
old_value = float(parser["values"]["support_infill_angles"])
new_value = [int(round(old_value))]
parser["values"]["support_infill_angles"] = str(new_value)
result = io.StringIO() result = io.StringIO()
parser.write(result) parser.write(result)
return [filename], [result.getvalue()] return [filename], [result.getvalue()]

View File

@ -4260,15 +4260,12 @@
} }
} }
}, },
"support_infill_angle": "support_infill_angles":
{ {
"label": "Support Infill Line Direction", "label": "Support Infill Line Directions",
"description": "Orientation of the infill pattern for supports. The support infill pattern is rotated in the horizontal plane.", "description": "A list of integer line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the default angle 0 degrees.",
"unit": "°", "type": "[int]",
"type": "float", "default_value": "[ ]",
"minimum_value": "-180",
"maximum_value": "180",
"default_value": 0,
"enabled": "(support_enable or support_tree_enable) and support_pattern != 'concentric' and support_infill_rate > 0", "enabled": "(support_enable or support_tree_enable) and support_pattern != 'concentric' and support_infill_rate > 0",
"limit_to_extruder": "support_infill_extruder_nr", "limit_to_extruder": "support_infill_extruder_nr",
"settable_per_mesh": false, "settable_per_mesh": false,
@ -4834,6 +4831,42 @@
} }
} }
}, },
"support_interface_angles":
{
"label": "Support Interface Line Directions",
"description": "A list of integer line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the default angles (alternates between 45 and 135 degrees if interfaces are quite thick or 90 degrees).",
"type": "[int]",
"default_value": "[ ]",
"limit_to_extruder": "support_interface_extruder_nr",
"enabled": "support_interface_enable and support_interface_pattern != 'concentric'",
"settable_per_mesh": false,
"settable_per_extruder": true,
"children":
{
"support_roof_angles":
{
"label": "Support Roof Line Directions",
"description": "A list of integer line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the default angles (alternates between 45 and 135 degrees if interfaces are quite thick or 90 degrees).",
"type": "[int]",
"default_value": "[ ]",
"limit_to_extruder": "support_roof_extruder_nr",
"enabled": "support_roof_enable and support_roof_pattern != 'concentric'",
"settable_per_mesh": false,
"settable_per_extruder": true
},
"support_bottom_angles":
{
"label": "Support Floor Line Directions",
"description": "A list of integer line directions to use. Elements from the list are used sequentially as the layers progress and when the end of the list is reached, it starts at the beginning again. The list items are separated by commas and the whole list is contained in square brackets. Default is an empty list which means use the default angles (alternates between 45 and 135 degrees if interfaces are quite thick or 90 degrees).",
"type": "[int]",
"default_value": "[ ]",
"limit_to_extruder": "support_bottom_extruder_nr",
"enabled": "support_bottom_enable and support_bottom_pattern != 'concentric'",
"settable_per_mesh": false,
"settable_per_extruder": true
}
}
},
"support_fan_enable": "support_fan_enable":
{ {
"label": "Fan Speed Override", "label": "Fan Speed Override",