Browse Source

Fix situation where _calculateMoveFromWallRadius could cause exception

Jaime van Kessel 5 years ago
parent
commit
f842769c1d
2 changed files with 6 additions and 3 deletions
  1. 3 1
      cura/BuildVolume.py
  2. 3 2
      tests/TestBuildVolume.py

+ 3 - 1
cura/BuildVolume.py

@@ -1118,7 +1118,9 @@ class BuildVolume(SceneNode):
 
     def _calculateMoveFromWallRadius(self, used_extruders):
         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]
         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).

+ 3 - 2
tests/TestBuildVolume.py

@@ -255,9 +255,10 @@ class TestGetEdgeDisallowedSize:
     def test_unknownAdhesion(self, build_volume: BuildVolume):
         build_volume._global_container_stack = self.createMockedStack()
         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.
-                build_volume.getEdgeDisallowedSize()
+
+            build_volume.getEdgeDisallowedSize()
 
     def test_oneAtATime(self, build_volume: BuildVolume):
         build_volume._global_container_stack = self.createMockedStack()