CURA-4425 Avoid adding the center bounding box. Revert some previous changes.

This commit is contained in:
Diego Prado Gesto 2018-02-01 16:37:16 +01:00
parent 433176d25a
commit c432646908

View File

@ -24,10 +24,15 @@ class Snapshot:
camera = Camera("snapshot", root) camera = Camera("snapshot", root)
# determine zoom and look at # determine zoom and look at
bbox = AxisAlignedBox() bbox = None
for node in DepthFirstIterator(root): for node in DepthFirstIterator(root):
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible(): if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible():
bbox = bbox + node.getBoundingBox() if bbox is None:
bbox = node.getBoundingBox()
else:
bbox = bbox + node.getBoundingBox()
if bbox is None:
bbox = AxisAlignedBox()
look_at = bbox.center look_at = bbox.center
size = max(bbox.width, bbox.height, bbox.depth * 0.5) size = max(bbox.width, bbox.height, bbox.depth * 0.5)