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)
|
||||
|
||||
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
|
||||
return obj.rotate(startPt, endPt, angleDegrees)
|
||||
|
||||
|
|
|
@ -185,10 +185,10 @@ class Shape(object):
|
|||
return BoundBox(self.wrapped.BoundBox)
|
||||
|
||||
def Center(self):
|
||||
try:
|
||||
return Vector(self.wrapped.CenterOfMass)
|
||||
except:
|
||||
pass
|
||||
# try:
|
||||
return Vector(self.wrapped.CenterOfMass)
|
||||
# except:
|
||||
# pass
|
||||
|
||||
def Closed(self):
|
||||
return self.wrapped.Closed
|
||||
|
|
Loading…
Reference in New Issue
Block a user