BoundBox: fix wrong shape if using external orientation

This commit is contained in:
DeepSOIC 2017-11-25 23:33:02 +03:00
parent e643fc9ff1
commit 503388ead3

View File

@ -182,12 +182,13 @@ class _BoundBox:
if abs(Q[0])+abs(Q[1])+abs(Q[2]) < ParaConfusion: if abs(Q[0])+abs(Q[1])+abs(Q[2]) < ParaConfusion:
orients[i] = None orients[i] = None
from lattice2ShapeCopy import shallowCopy
boxes_shapes = [] boxes_shapes = []
for i in range(N): for i in range(N):
child = baseChildren[i] child = baseChildren[i]
if orients[i] is not None: if orients[i] is not None:
child = child.copy() child = shallowCopy(child)
child.transformShape(orients[i].inverse().toMatrix()) child.Placement = orients[i].inverse().multiply(child.Placement)
if obj.Precision: if obj.Precision:
bb = getPrecisionBoundBox(child) bb = getPrecisionBoundBox(child)
@ -199,7 +200,7 @@ class _BoundBox:
bb_shape = boundBox2RealBox(bb) bb_shape = boundBox2RealBox(bb)
if orients[i] is not None: if orients[i] is not None:
bb_shape.transformShape(orients[i].toMatrix()) bb_shape.transformShape(orients[i].toMatrix(), True)
boxes_shapes.append(bb_shape) boxes_shapes.append(bb_shape)
#Fill in read-only properties #Fill in read-only properties