mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 11:47:50 -06:00
Add missing typing
This commit is contained in:
parent
67f10d8bc3
commit
efc6ef2905
1 changed files with 13 additions and 9 deletions
|
@ -908,9 +908,12 @@ class BuildVolume(SceneNode):
|
||||||
# for.
|
# for.
|
||||||
# \return A dictionary with for each used extruder ID the disallowed areas
|
# \return A dictionary with for each used extruder ID the disallowed areas
|
||||||
# where that extruder may not print.
|
# 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.
|
# Convert disallowed areas to polygons and dilate them.
|
||||||
machine_disallowed_polygons = []
|
machine_disallowed_polygons = []
|
||||||
|
if self._global_container_stack is None:
|
||||||
|
return {}
|
||||||
|
|
||||||
for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"):
|
for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"):
|
||||||
polygon = Polygon(numpy.array(area, numpy.float32))
|
polygon = Polygon(numpy.array(area, numpy.float32))
|
||||||
polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size))
|
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 = self._global_container_stack.getMetaDataEntry(
|
||||||
"nozzle_offsetting_for_disallowed_areas", True)
|
"nozzle_offsetting_for_disallowed_areas", True)
|
||||||
|
|
||||||
result = {}
|
result = {} # type: Dict[str, List[Polygon]]
|
||||||
for extruder in used_extruders:
|
for extruder in used_extruders:
|
||||||
extruder_id = extruder.getId()
|
extruder_id = extruder.getId()
|
||||||
offset_x = extruder.getProperty("machine_nozzle_offset_x", "value")
|
offset_x = extruder.getProperty("machine_nozzle_offset_x", "value")
|
||||||
|
@ -944,7 +947,8 @@ class BuildVolume(SceneNode):
|
||||||
|
|
||||||
# Only do nozzle offsetting if needed
|
# Only do nozzle offsetting if needed
|
||||||
if nozzle_offsetting_for_disallowed_areas:
|
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():
|
for other_extruder in ExtruderManager.getInstance().getActiveExtruderStacks():
|
||||||
other_offset_x = other_extruder.getProperty("machine_nozzle_offset_x", "value")
|
other_offset_x = other_extruder.getProperty("machine_nozzle_offset_x", "value")
|
||||||
if other_offset_x is None:
|
if other_offset_x is None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue