mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 04:36:01 +08:00
Fix situation where _calculateMoveFromWallRadius could cause exception
This commit is contained in:
parent
4018c24b4c
commit
f842769c1d
@ -1118,7 +1118,9 @@ class BuildVolume(SceneNode):
|
|||||||
|
|
||||||
def _calculateMoveFromWallRadius(self, used_extruders):
|
def _calculateMoveFromWallRadius(self, used_extruders):
|
||||||
move_from_wall_radius = 0 # Moves that start from outer wall.
|
move_from_wall_radius = 0 # Moves that start from outer wall.
|
||||||
move_from_wall_radius = max(move_from_wall_radius, max(self._getSettingFromAllExtruders("infill_wipe_dist")))
|
all_values = [move_from_wall_radius]
|
||||||
|
all_values.extend(self._getSettingFromAllExtruders("infill_wipe_dist"))
|
||||||
|
move_from_wall_radius = max(all_values)
|
||||||
avoid_enabled_per_extruder = [stack.getProperty("travel_avoid_other_parts", "value") for stack in used_extruders]
|
avoid_enabled_per_extruder = [stack.getProperty("travel_avoid_other_parts", "value") for stack in used_extruders]
|
||||||
travel_avoid_distance_per_extruder = [stack.getProperty("travel_avoid_distance", "value") for stack in used_extruders]
|
travel_avoid_distance_per_extruder = [stack.getProperty("travel_avoid_distance", "value") for stack in used_extruders]
|
||||||
for avoid_other_parts_enabled, avoid_distance in zip(avoid_enabled_per_extruder, travel_avoid_distance_per_extruder): # For each extruder (or just global).
|
for avoid_other_parts_enabled, avoid_distance in zip(avoid_enabled_per_extruder, travel_avoid_distance_per_extruder): # For each extruder (or just global).
|
||||||
|
@ -255,9 +255,10 @@ class TestGetEdgeDisallowedSize:
|
|||||||
def test_unknownAdhesion(self, build_volume: BuildVolume):
|
def test_unknownAdhesion(self, build_volume: BuildVolume):
|
||||||
build_volume._global_container_stack = self.createMockedStack()
|
build_volume._global_container_stack = self.createMockedStack()
|
||||||
with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance"):
|
with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance"):
|
||||||
with pytest.raises(Exception):
|
#with pytest.raises(Exception):
|
||||||
# Since we don't have any adhesion set, this should break.
|
# Since we don't have any adhesion set, this should break.
|
||||||
build_volume.getEdgeDisallowedSize()
|
|
||||||
|
build_volume.getEdgeDisallowedSize()
|
||||||
|
|
||||||
def test_oneAtATime(self, build_volume: BuildVolume):
|
def test_oneAtATime(self, build_volume: BuildVolume):
|
||||||
build_volume._global_container_stack = self.createMockedStack()
|
build_volume._global_container_stack = self.createMockedStack()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user