Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLipu Fei <lipu.fei815@gmail.com>2017-06-21 15:50:40 +0300
committerLipu Fei <lipu.fei815@gmail.com>2017-06-23 09:33:03 +0300
commitb958e30fe6b5f175af85055250c563c49e2535f0 (patch)
tree6d16b9361b93386e9c4e5efd32d4303b05cf53d6 /cura/BuildVolume.py
parent7fe5c2ad07d571e03ef31b5ba695584405e22a5a (diff)
Add machine_disallowed_areas and turn off nozzle offsetting for disallowed areas calculation
CURA-3663 We don't need to calculate the disallowed areas for certain machines because they have taken into account the nozzle offsets. This commit does the following: - Add machine_disallowed_areas - Add a flag in definition so that disallowed areas calculation with nozzle offsets becomes optional in Cura. Update documentation for no offsetting for nozzles Contributes to issue CURA-3663.
Diffstat (limited to 'cura/BuildVolume.py')
-rwxr-xr-xcura/BuildVolume.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py
index ff5888b722..4963df65cd 100755
--- a/cura/BuildVolume.py
+++ b/cura/BuildVolume.py
@@ -716,6 +716,11 @@ class BuildVolume(SceneNode):
polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size))
machine_disallowed_polygons.append(polygon)
+ # For certain machines we don't need to compute disallowed areas for each nozzle.
+ # So we check here and only do the nozzle offsetting if needed.
+ no_nozzle_offsetting_for_disallowed_areas = self._global_container_stack.getMetaDataEntry(
+ "no_nozzle_offsetting_for_disallowed_areas", False)
+
result = {}
for extruder in used_extruders:
extruder_id = extruder.getId()
@@ -735,14 +740,17 @@ class BuildVolume(SceneNode):
right_unreachable_border = 0
top_unreachable_border = 0
bottom_unreachable_border = 0
- #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")
- other_offset_y = other_extruder.getProperty("machine_nozzle_offset_y", "value")
- left_unreachable_border = min(left_unreachable_border, other_offset_x - offset_x)
- right_unreachable_border = max(right_unreachable_border, other_offset_x - offset_x)
- top_unreachable_border = min(top_unreachable_border, other_offset_y - offset_y)
- bottom_unreachable_border = max(bottom_unreachable_border, other_offset_y - offset_y)
+
+ # Only do nozzle offsetting if needed
+ if not no_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.
+ for other_extruder in ExtruderManager.getInstance().getActiveExtruderStacks():
+ other_offset_x = other_extruder.getProperty("machine_nozzle_offset_x", "value")
+ other_offset_y = other_extruder.getProperty("machine_nozzle_offset_y", "value")
+ left_unreachable_border = min(left_unreachable_border, other_offset_x - offset_x)
+ right_unreachable_border = max(right_unreachable_border, other_offset_x - offset_x)
+ top_unreachable_border = min(top_unreachable_border, other_offset_y - offset_y)
+ bottom_unreachable_border = max(bottom_unreachable_border, other_offset_y - offset_y)
half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2
half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2