Ensure that objects outside build volume are not added to thumbnail

CURA-6545
This commit is contained in:
Jaime van Kessel 2019-05-29 15:53:23 +02:00
parent f6627daa49
commit 07ff08f6bb
2 changed files with 30 additions and 29 deletions

View file

@ -48,12 +48,12 @@ class Snapshot:
# determine zoom and look at
bbox = None
for node in DepthFirstIterator(root):
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonThumbnailVisibleMesh"):
if bbox is None:
bbox = node.getBoundingBox()
else:
bbox = bbox + node.getBoundingBox()
if hasattr(node, "_outside_buildarea") and not node._outside_buildarea:
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonThumbnailVisibleMesh"):
if bbox is None:
bbox = node.getBoundingBox()
else:
bbox = bbox + node.getBoundingBox()
# If there is no bounding box, it means that there is no model in the buildplate
if bbox is None:
return None