diff --git a/.coverage b/.coverage index b9068da..2d312f0 100644 Binary files a/.coverage and b/.coverage differ diff --git a/cadquery/CQ.py b/cadquery/CQ.py index 0ecac23..92449cd 100644 --- a/cadquery/CQ.py +++ b/cadquery/CQ.py @@ -684,7 +684,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) diff --git a/cadquery/freecad_impl/shapes.py b/cadquery/freecad_impl/shapes.py index 1d0336f..d35a992 100644 --- a/cadquery/freecad_impl/shapes.py +++ b/cadquery/freecad_impl/shapes.py @@ -185,10 +185,7 @@ class Shape(object): return BoundBox(self.wrapped.BoundBox) def Center(self): - try: - return Vector(self.wrapped.CenterOfMass) - except: - pass + return Vector(self.wrapped.CenterOfMass) def Closed(self): return self.wrapped.Closed