From 659add8ba3843dabe1145d067fa3dbeb2e6ca9c2 Mon Sep 17 00:00:00 2001 From: wood galaxy Date: Mon, 10 Nov 2014 21:09:57 +0100 Subject: [PATCH] Add BasePoint Property to Arch Frame BasePoint allow user to change by wich vertex of the profil the frame passe of. --- src/Mod/Arch/ArchFrame.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchFrame.py b/src/Mod/Arch/ArchFrame.py index 0aec461cd..cf4881c95 100644 --- a/src/Mod/Arch/ArchFrame.py +++ b/src/Mod/Arch/ArchFrame.py @@ -83,6 +83,7 @@ class _Frame(ArchComponent.Component): obj.addProperty("App::PropertyLink","Profile","Arch","The profile used to build this frame") obj.addProperty("App::PropertyBool","Align","Arch","Specifies if the profile must be aligned with the extrusion wires") obj.addProperty("App::PropertyVector","Offset","Arch","An offset vector between the base sketch and the frame") + obj.addProperty("App::PropertyInteger","BasePoint","Arch","The point of the profile by which the path passes.") obj.addProperty("App::PropertyAngle","Rotation","Arch","The rotation of the profile around its extrusion axis") self.Type = "Frame" obj.Role = Roles @@ -132,8 +133,15 @@ class _Frame(ArchComponent.Component): bpoint = e.Vertexes[0].Point profile = baseprofile.copy() #basepoint = profile.Placement.Base - basepoint = profile.CenterOfMass - profile.translate(bpoint.sub(basepoint)) + #basepoint = profile.CenterOfMass + #profile.translate(bpoint.sub(basepoint)) + if obj.BasePoint == 0 : + basepoint = profile.CenterOfMass + profile.translate(bpoint.sub(basepoint)) + else : + # TODO add mid point of edges and make an ordered list point, mid point , ... + basepoint = profile.Vertexes[obj.BasePoint - 1].Point + profile.translate(bpoint.sub(basepoint)) if obj.Align: axis = profile.Placement.Rotation.multVec(FreeCAD.Vector(0,0,1)) angle = bvec.getAngle(axis)