From fed516d58218ae2b164a250282df6800d7d391a3 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 26 Jun 2015 13:50:02 -0300 Subject: [PATCH] Arch: fixed bug in rebars --- src/Mod/Arch/ArchRebar.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/ArchRebar.py b/src/Mod/Arch/ArchRebar.py index b8c2504c6..f7cc0bb84 100644 --- a/src/Mod/Arch/ArchRebar.py +++ b/src/Mod/Arch/ArchRebar.py @@ -146,13 +146,17 @@ class _Rebar(ArchComponent.Component): self.Type = "Rebar" obj.setEditorMode("Spacing",1) - def getBaseAndAxis(self,obj): - "returns a base point and orientation axis from the base sketch" + def getBaseAndAxis(self,wire): + "returns a base point and orientation axis from the base wire" + import DraftGeomUtils + if wire: + e = wire.Edges[0] + v = DraftGeomUtils.vec(e).normalize() + return e.Vertexes[0].Point,v if obj.Base: if obj.Base.Shape: if obj.Base.Shape.Wires: e = obj.Base.Shape.Wires[0].Edges[0] - import DraftGeomUtils v = DraftGeomUtils.vec(e).normalize() return e.Vertexes[0].Point,v return None,None @@ -186,7 +190,7 @@ class _Rebar(ArchComponent.Component): radius = obj.Rounding * obj.Diameter.Value import DraftGeomUtils wire = DraftGeomUtils.filletWire(wire,radius) - bpoint, bvec = self.getBaseAndAxis(obj) + bpoint, bvec = self.getBaseAndAxis(wire) if not bpoint: return axis = obj.Base.Placement.Rotation.multVec(FreeCAD.Vector(0,0,-1))