Skip to content

Commit

Permalink
Arch: Fixed windows symbol position
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Aug 22, 2019
1 parent 5806fc6 commit d6fdaef
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Mod/Arch/ArchWindow.py
Expand Up @@ -1085,11 +1085,10 @@ def buildShapes(self,obj):
e = obj.Base.Shape.Edges[hinge]
ev1 = e.Vertexes[0].Point
ev2 = e.Vertexes[-1].Point
if (ev2.z - ev1.z) < 0.1**Draft.precision():
if ev2.y < ev1.y:
ev1,ev2 = ev2,ev1
elif ev2.z < ev1.z:
# choose the one with lowest z to draw the symbol
if ev2.z < ev1.z:
ev1,ev2 = ev2,ev1
# find the point most distant from the hinge
p = None
d = 0
for v in shape.Vertexes:
Expand All @@ -1098,13 +1097,16 @@ def buildShapes(self,obj):
d = dist
p = v.Point
if p:
# bring that point to the level of ev1 if needed
chord = p.sub(ev1)
enorm = ev2.sub(ev1)
proj = DraftVecUtils.project(chord,enorm)
v1 = ev1
if proj.Length > 0:
chord = p.sub(ev1.add(proj))
p = v1.add(chord)
#chord = p.sub(ev1.add(proj))
#p = v1.add(chord)
p = p.add(proj.negative())
# calculate symbols
v4 = p.add(DraftVecUtils.scale(enorm,0.5))
if omode == 1: # Arc 90
v2 = v1.add(DraftVecUtils.rotate(chord,math.pi/4,enorm))
Expand Down

0 comments on commit d6fdaef

Please sign in to comment.