mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 07:14:24 +08:00
Merge pull request #8964 from Ultimaker/CURA-7835_Fix_skirt_brim_line_width
Ensure that the skirt_brim_line_width is selected from right extruder
This commit is contained in:
commit
9f2ad1c577
@ -1068,7 +1068,14 @@ class BuildVolume(SceneNode):
|
|||||||
adhesion_type = adhesion_override
|
adhesion_type = adhesion_override
|
||||||
if adhesion_type is None:
|
if adhesion_type is None:
|
||||||
adhesion_type = container_stack.getProperty("adhesion_type", "value")
|
adhesion_type = container_stack.getProperty("adhesion_type", "value")
|
||||||
skirt_brim_line_width = self._global_container_stack.getProperty("skirt_brim_line_width", "value")
|
|
||||||
|
# Skirt_brim_line_width is a bit of an odd one out. The primary bit of the skirt/brim is printed
|
||||||
|
# with the adhesion extruder, but it also prints one extra line by all other extruders. As such, the
|
||||||
|
# setting does *not* have a limit_to_extruder setting (which means that we can't ask the global extruder what
|
||||||
|
# the value is.
|
||||||
|
adhesion_extruder = self._global_container_stack.getProperty("adhesion_extruder_nr", "value")
|
||||||
|
skirt_brim_line_width = self._global_container_stack.extruderList[int(adhesion_extruder)].getProperty("skirt_brim_line_width", "value")
|
||||||
|
|
||||||
initial_layer_line_width_factor = self._global_container_stack.getProperty("initial_layer_line_width_factor", "value")
|
initial_layer_line_width_factor = self._global_container_stack.getProperty("initial_layer_line_width_factor", "value")
|
||||||
# Use brim width if brim is enabled OR the prime tower has a brim.
|
# Use brim width if brim is enabled OR the prime tower has a brim.
|
||||||
if adhesion_type == "brim":
|
if adhesion_type == "brim":
|
||||||
|
@ -66,9 +66,12 @@ class TestCalculateBedAdhesionSize:
|
|||||||
return properties.get(args[2])
|
return properties.get(args[2])
|
||||||
|
|
||||||
def createAndSetGlobalStack(self, build_volume):
|
def createAndSetGlobalStack(self, build_volume):
|
||||||
mocked_stack = MagicMock()
|
mocked_stack = MagicMock(name = "mocked_stack")
|
||||||
mocked_stack.getProperty = MagicMock(side_effect=self.getPropertySideEffect)
|
mocked_stack.getProperty = MagicMock(side_effect=self.getPropertySideEffect)
|
||||||
|
mocked_extruder = MagicMock(name = "mocked_extruder")
|
||||||
|
mocked_extruder.getProperty = MagicMock(side_effect=self.getPropertySideEffect)
|
||||||
|
|
||||||
|
mocked_stack.extruderList = [mocked_extruder]
|
||||||
build_volume._global_container_stack = mocked_stack
|
build_volume._global_container_stack = mocked_stack
|
||||||
|
|
||||||
def test_noGlobalStack(self, build_volume: BuildVolume):
|
def test_noGlobalStack(self, build_volume: BuildVolume):
|
||||||
@ -90,6 +93,7 @@ class TestCalculateBedAdhesionSize:
|
|||||||
self.createAndSetGlobalStack(build_volume)
|
self.createAndSetGlobalStack(build_volume)
|
||||||
patched_dictionary = self.setting_property_dict.copy()
|
patched_dictionary = self.setting_property_dict.copy()
|
||||||
patched_dictionary.update(setting_dict)
|
patched_dictionary.update(setting_dict)
|
||||||
|
patched_dictionary.update({"adhesion_extruder_nr": {"value": 0}})
|
||||||
with patch.dict(self.setting_property_dict, patched_dictionary):
|
with patch.dict(self.setting_property_dict, patched_dictionary):
|
||||||
assert build_volume._calculateBedAdhesionSize([]) == result
|
assert build_volume._calculateBedAdhesionSize([]) == result
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user