Merge branch 'CURA-6094_brim_width_crash_4_0' of github.com:Ultimaker/Cura into 4.0

This commit is contained in:
Jaime van Kessel 2019-01-23 09:52:07 +01:00
commit fa3e4fe69a
3 changed files with 17 additions and 4 deletions

View File

@ -1043,6 +1043,12 @@ class BuildVolume(SceneNode):
else: else:
raise Exception("Unknown bed adhesion type. Did you forget to update the build volume calculations for your new bed adhesion type?") raise Exception("Unknown bed adhesion type. Did you forget to update the build volume calculations for your new bed adhesion type?")
max_length_available = 0.5 * min(
self._global_container_stack.getProperty("machine_width", "value"),
self._global_container_stack.getProperty("machine_depth", "value")
)
bed_adhesion_size = min(bed_adhesion_size, max_length_available)
support_expansion = 0 support_expansion = 0
support_enabled = self._global_container_stack.getProperty("support_enable", "value") support_enabled = self._global_container_stack.getProperty("support_enable", "value")
support_offset = self._global_container_stack.getProperty("support_offset", "value") support_offset = self._global_container_stack.getProperty("support_offset", "value")

View File

@ -289,16 +289,21 @@ class ConvexHullDecorator(SceneNodeDecorator):
# Add extra margin depending on adhesion type # Add extra margin depending on adhesion type
adhesion_type = self._global_stack.getProperty("adhesion_type", "value") adhesion_type = self._global_stack.getProperty("adhesion_type", "value")
max_length_available = 0.5 * min(
self._getSettingProperty("machine_width", "value"),
self._getSettingProperty("machine_depth", "value")
)
if adhesion_type == "raft": if adhesion_type == "raft":
extra_margin = max(0, self._getSettingProperty("raft_margin", "value")) extra_margin = min(max_length_available, max(0, self._getSettingProperty("raft_margin", "value")))
elif adhesion_type == "brim": elif adhesion_type == "brim":
extra_margin = max(0, self._getSettingProperty("brim_line_count", "value") * self._getSettingProperty("skirt_brim_line_width", "value")) extra_margin = min(max_length_available, max(0, self._getSettingProperty("brim_line_count", "value") * self._getSettingProperty("skirt_brim_line_width", "value")))
elif adhesion_type == "none": elif adhesion_type == "none":
extra_margin = 0 extra_margin = 0
elif adhesion_type == "skirt": elif adhesion_type == "skirt":
extra_margin = max( extra_margin = min(max_length_available, max(
0, self._getSettingProperty("skirt_gap", "value") + 0, self._getSettingProperty("skirt_gap", "value") +
self._getSettingProperty("skirt_line_count", "value") * self._getSettingProperty("skirt_brim_line_width", "value")) self._getSettingProperty("skirt_line_count", "value") * self._getSettingProperty("skirt_brim_line_width", "value")))
else: else:
raise Exception("Unknown bed adhesion type. Did you forget to update the convex hull calculations for your new bed adhesion type?") raise Exception("Unknown bed adhesion type. Did you forget to update the convex hull calculations for your new bed adhesion type?")

View File

@ -4690,6 +4690,7 @@
"default_value": 8.0, "default_value": 8.0,
"minimum_value": "0.0", "minimum_value": "0.0",
"maximum_value_warning": "50.0", "maximum_value_warning": "50.0",
"maximum_value": "0.5 * min(machine_width, machine_depth)",
"enabled": "resolveOrValue('adhesion_type') == 'brim'", "enabled": "resolveOrValue('adhesion_type') == 'brim'",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": true, "settable_per_extruder": true,
@ -4704,6 +4705,7 @@
"default_value": 20, "default_value": 20,
"minimum_value": "0", "minimum_value": "0",
"maximum_value_warning": "50 / skirt_brim_line_width", "maximum_value_warning": "50 / skirt_brim_line_width",
"maximum_value": "0.5 * min(machine_width, machine_depth) / skirt_brim_line_width",
"value": "math.ceil(brim_width / (skirt_brim_line_width * initial_layer_line_width_factor / 100.0))", "value": "math.ceil(brim_width / (skirt_brim_line_width * initial_layer_line_width_factor / 100.0))",
"enabled": "resolveOrValue('adhesion_type') == 'brim'", "enabled": "resolveOrValue('adhesion_type') == 'brim'",
"settable_per_mesh": false, "settable_per_mesh": false,