Do boundary checks on nodes for which the boundary check is unknown

Just before deciding whether to drop down the node on the build plate.

Contributes to issue CURA-4797.
This commit is contained in:
Ghostkeeper 2018-01-23 11:21:32 +01:00
parent cf556ccf8f
commit 27e441ecd9
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
2 changed files with 48 additions and 47 deletions

View file

@ -56,14 +56,17 @@ class PlatformPhysics:
# By shuffling the order of the nodes, this might happen a few times, but at some point it will resolve.
nodes = list(BreadthFirstIterator(root))
# Only check nodes inside build area.
nodes = [node for node in nodes if getattr(node, "_outside_buildarea", False)]
random.shuffle(nodes)
for node in nodes:
if node is root or not isinstance(node, SceneNode) or node.getBoundingBox() is None:
continue
#Only check nodes inside the build area.
if not hasattr(node, "_outside_buildarea"):
self._build_volume.updateNodeBoundaryCheck(node)
if getattr(node, "_outside_buildarea", True):
continue
bbox = node.getBoundingBox()
# Move it downwards if bottom is above platform
@ -155,7 +158,7 @@ class PlatformPhysics:
# After moving, we have to evaluate the boundary checks for nodes
build_volume = Application.getInstance().getBuildVolume()
build_volume.updateNodeBoundaryCheck()
build_volume.updateAllBoundaryChecks()
def _onToolOperationStarted(self, tool):
self._enabled = False