Skip to content

Commit

Permalink
Add BasePoint Property to Arch Frame
Browse files Browse the repository at this point in the history
BasePoint allow user to change by wich vertex of the profil the frame
passe of.
  • Loading branch information
j-wiedemann authored and yorikvanhavre committed Nov 13, 2014
1 parent f7830b8 commit 659add8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Mod/Arch/ArchFrame.py
Expand Up @@ -83,6 +83,7 @@ def __init__(self,obj):
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
Expand Down Expand Up @@ -132,8 +133,15 @@ def execute(self,obj):
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)
Expand Down

0 comments on commit 659add8

Please sign in to comment.