diff options
author | Jaime van Kessel <nallath@gmail.com> | 2015-07-22 13:08:38 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2015-07-22 13:08:38 +0300 |
commit | 7349e28b841448f703c6cf7160540f04fc72db98 (patch) | |
tree | 2d48bc7d61d03e7fb5d295940ff63e2a0bab21ed /cura/OneAtATimeIterator.py | |
parent | 68cf0c8b2398438a997732c6cd4f4f3f85d2a2c5 (diff) |
Added gantry height check
Diffstat (limited to 'cura/OneAtATimeIterator.py')
-rw-r--r-- | cura/OneAtATimeIterator.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cura/OneAtATimeIterator.py b/cura/OneAtATimeIterator.py index e617f4b232..4f798148c0 100644 --- a/cura/OneAtATimeIterator.py +++ b/cura/OneAtATimeIterator.py @@ -3,6 +3,7 @@ from UM.Scene.Iterator import Iterator from functools import cmp_to_key +from UM.Application import Application ## Iterator that returns a list of nodes in the order that they need to be printed # If there is no solution an empty list is returned. @@ -16,11 +17,13 @@ class OneAtATimeIterator(Iterator.Iterator): def _fillStack(self): node_list = [] for node in self._scene_node.getChildren(): + if node.getBoundingBox().height > Application.getInstance().getActiveMachine().getSettingByKey("gantry_height"): + return if node.callDecoration("getConvexHull"): node_list.append(node) if len(node_list) < 2: - return node_list + return self._original_node_list = node_list[:] @@ -31,7 +34,7 @@ class OneAtATimeIterator(Iterator.Iterator): for a in range(0,len(node_list)): for b in range(0,len(node_list)): if a != b and self._hit_map[a][b] and self._hit_map[b][a]: - return [] + return # Sort the original list so that items that block the most other objects are at the beginning. # This does not decrease the worst case running time, but should improve it in most cases. |