From 028e54536ca381f2f28c4728a84fe6ecbd4af39c Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Wed, 26 Jul 2017 12:59:51 -0300 Subject: [PATCH] Draft: Fixed rotation of Points --- src/Mod/Draft/Draft.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index d3d1733ac4..e42b2e6596 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -1411,6 +1411,14 @@ def rotate(objectslist,angle,center=Vector(0,0,0),axis=Vector(0,0,1),copy=False) elif axis.normalize() == Vector(0,0,-1): newobj.ViewObject.RotationAxis = "Z" newobj.ViewObject.Rotation = -angle + elif getType(obj) == "Point": + v = Vector(obj.X,obj.Y,obj.Z) + rv = v.sub(center) + rv = DraftVecUtils.rotate(rv,math.radians(angle),axis) + v = center.add(rv) + newobj.X = v.x + newobj.Y = v.y + newobj.Z = v.z elif hasattr(obj,"Placement"): shape = Part.Shape() shape.Placement = obj.Placement