From ee8a544f120a64c18a3db5fb3b604eba8d95229b Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sun, 26 Feb 2012 12:26:13 -0300 Subject: [PATCH] Fixed block mirroring and text rotation bugs in Draft DXF import --- src/Mod/Draft/importDXF.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/importDXF.py b/src/Mod/Draft/importDXF.py index df08ab619..eff99a51f 100644 --- a/src/Mod/Draft/importDXF.py +++ b/src/Mod/Draft/importDXF.py @@ -609,7 +609,7 @@ def drawBlock(blockref,num=None): def drawInsert(insert,num=None): if blockshapes.has_key(insert): - shape = blockshapes[insert.block] + shape = blockshapes[insert.block].copy() else: shape = None for b in drawing.blocks.data: @@ -624,7 +624,7 @@ def drawInsert(insert,num=None): rot = math.radians(insert.rotation) scale = insert.scale tsf = FreeCAD.Matrix() - tsf.scale(vec(scale)) + tsf.scale(scale[0],scale[1],0) # for some reason z must be 0 to work tsf.rotateZ(rot) shape = shape.transformGeometry(tsf) shape.translate(pos) @@ -709,6 +709,9 @@ def addText(text,attrib=False): ax = Vector(0,0,1) ang = -math.degrees(fcvec.angle(xv,Vector(1,0,0),ax)) Draft.rotate(newob,ang,axis=ax) + elif hasattr(text,"rotation"): + if text.rotation: + Draft.rotate(newob,text.rotation) newob.LabelText = val.split("\n") newob.Position = pos if gui: