def test_noExtruders(self, build_volume: BuildVolume): mocked_stack = MagicMock() mocked_stack.getProperty = MagicMock(side_effect=self.getPropertySideEffect) build_volume._global_container_stack = mocked_stack # No extruders, so still expect that we get no area assert build_volume._computeDisallowedAreasPrimeBlob(12, []) == {}
def test_singleExtruder(self, build_volume: BuildVolume): mocked_global_stack = MagicMock(name = "mocked_global_stack") mocked_global_stack.getProperty = MagicMock(side_effect=self.getPropertySideEffect) mocked_extruder_stack = MagicMock(name = "mocked_extruder_stack") mocked_extruder_stack.getId = MagicMock(return_value = "0") mocked_extruder_stack.getProperty = MagicMock(side_effect=self.getPropertySideEffect) build_volume._global_container_stack = mocked_global_stack # Create a polygon that should be the result resulting_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE) # Since we want a blob of size 12; resulting_polygon = resulting_polygon.getMinkowskiHull(Polygon.approximatedCircle(12)) # In the The translation result is 25, -50 (due to the settings used) resulting_polygon = resulting_polygon.translate(25, -50) assert build_volume._computeDisallowedAreasPrimeBlob(12, [mocked_extruder_stack]) == {"0": [resulting_polygon]}
def test_noGlobalContainer(self, build_volume: BuildVolume): # No global container and no extruders, so we expect no blob areas assert build_volume._computeDisallowedAreasPrimeBlob(12, []) == {}