Fixed the Center call for Shape objects on rotateAboutCenter, and changed CenterOfMass usage so that it won't fail silently.
This commit is contained in:
parent
14262e744d
commit
6e70ad5e97
|
@ -685,7 +685,8 @@ class CQ(object):
|
||||||
endVec = Vector(axisEndPoint)
|
endVec = Vector(axisEndPoint)
|
||||||
|
|
||||||
def _rot(obj):
|
def _rot(obj):
|
||||||
startPt = obj.Center()
|
# TODO: compute the weighted average instead of using the first solid
|
||||||
|
startPt = obj.Solids()[0].Center()
|
||||||
endPt = startPt + endVec
|
endPt = startPt + endVec
|
||||||
return obj.rotate(startPt, endPt, angleDegrees)
|
return obj.rotate(startPt, endPt, angleDegrees)
|
||||||
|
|
||||||
|
|
|
@ -185,10 +185,10 @@ class Shape(object):
|
||||||
return BoundBox(self.wrapped.BoundBox)
|
return BoundBox(self.wrapped.BoundBox)
|
||||||
|
|
||||||
def Center(self):
|
def Center(self):
|
||||||
try:
|
# try:
|
||||||
return Vector(self.wrapped.CenterOfMass)
|
return Vector(self.wrapped.CenterOfMass)
|
||||||
except:
|
# except:
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
def Closed(self):
|
def Closed(self):
|
||||||
return self.wrapped.Closed
|
return self.wrapped.Closed
|
||||||
|
|
Loading…
Reference in New Issue
Block a user