mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 10:39:01 +08:00
Added gantry height check
This commit is contained in:
parent
68cf0c8b23
commit
7349e28b84
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from UM.Scene.Iterator import Iterator
|
from UM.Scene.Iterator import Iterator
|
||||||
from functools import cmp_to_key
|
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
|
## 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.
|
# If there is no solution an empty list is returned.
|
||||||
@ -16,11 +17,13 @@ class OneAtATimeIterator(Iterator.Iterator):
|
|||||||
def _fillStack(self):
|
def _fillStack(self):
|
||||||
node_list = []
|
node_list = []
|
||||||
for node in self._scene_node.getChildren():
|
for node in self._scene_node.getChildren():
|
||||||
|
if node.getBoundingBox().height > Application.getInstance().getActiveMachine().getSettingByKey("gantry_height"):
|
||||||
|
return
|
||||||
if node.callDecoration("getConvexHull"):
|
if node.callDecoration("getConvexHull"):
|
||||||
node_list.append(node)
|
node_list.append(node)
|
||||||
|
|
||||||
if len(node_list) < 2:
|
if len(node_list) < 2:
|
||||||
return node_list
|
return
|
||||||
|
|
||||||
self._original_node_list = node_list[:]
|
self._original_node_list = node_list[:]
|
||||||
|
|
||||||
@ -31,7 +34,7 @@ class OneAtATimeIterator(Iterator.Iterator):
|
|||||||
for a in range(0,len(node_list)):
|
for a in range(0,len(node_list)):
|
||||||
for b 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]:
|
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.
|
# 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.
|
# This does not decrease the worst case running time, but should improve it in most cases.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user