Add missing typing

This commit is contained in:
Jaime van Kessel 2019-06-28 13:44:47 +02:00
parent 67f10d8bc3
commit efc6ef2905

View file

@ -908,9 +908,12 @@ class BuildVolume(SceneNode):
# for.
# \return A dictionary with for each used extruder ID the disallowed areas
# where that extruder may not print.
def _computeDisallowedAreasStatic(self, border_size, used_extruders):
def _computeDisallowedAreasStatic(self, border_size:float, used_extruders: List["ExtruderStack"]) -> Dict[str, List[Polygon]]:
# Convert disallowed areas to polygons and dilate them.
machine_disallowed_polygons = []
if self._global_container_stack is None:
return {}
for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"):
polygon = Polygon(numpy.array(area, numpy.float32))
polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size))
@ -921,7 +924,7 @@ class BuildVolume(SceneNode):
nozzle_offsetting_for_disallowed_areas = self._global_container_stack.getMetaDataEntry(
"nozzle_offsetting_for_disallowed_areas", True)
result = {}
result = {} # type: Dict[str, List[Polygon]]
for extruder in used_extruders:
extruder_id = extruder.getId()
offset_x = extruder.getProperty("machine_nozzle_offset_x", "value")
@ -944,7 +947,8 @@ class BuildVolume(SceneNode):
# Only do nozzle offsetting if needed
if nozzle_offsetting_for_disallowed_areas:
#The build volume is defined as the union of the area that all extruders can reach, so we need to know the relative offset to all extruders.
# The build volume is defined as the union of the area that all extruders can reach, so we need to know
# the relative offset to all extruders.
for other_extruder in ExtruderManager.getInstance().getActiveExtruderStacks():
other_offset_x = other_extruder.getProperty("machine_nozzle_offset_x", "value")
if other_offset_x is None: