Skip to content

Commit

Permalink
Arch: Support for opening symbols - fixes #2353
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Nov 2, 2016
1 parent b4ae2be commit 6951705
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 7 deletions.
31 changes: 30 additions & 1 deletion src/Mod/Arch/ArchSectionPlane.py
Expand Up @@ -85,7 +85,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill=

if not section.Objects:
return
import DraftGeomUtils
import Part,DraftGeomUtils
p = FreeCAD.Placement(section.Placement)
direction = p.Rotation.multVec(FreeCAD.Vector(0,0,1))
objs = Draft.getGroupContents(section.Objects,walls=True,addgroups=True)
Expand All @@ -95,6 +95,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill=
spaces = []
nonspaces = []
drafts = []
windows = []
cutface = None
for o in objs:
if Draft.getType(o) == "Space":
Expand All @@ -105,6 +106,8 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill=
drafts.append(o)
else:
nonspaces.append(o)
if Draft.getType(o) == "Window":
windows.append(o)
objs = nonspaces
svg = ''
fillpattern = '<pattern id="sectionfill" patternUnits="userSpaceOnUse" patternTransform="matrix(5,0,0,5,0,0)"'
Expand Down Expand Up @@ -238,6 +241,32 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill=
svg += Draft.getSVG(s,scale=scale,linewidth=linewidth,fontsize=fontsize,direction=direction,techdraw=techdraw,rotation=rotation)
if not techdraw:
svg += '</g>'
# add additional edge symbols from windows
if cutface and windows:
cutwindows = [w.Name for w in windows if w.Shape.BoundBox.intersect(cutface.BoundBox)]
if windows:
sh = []
for w in windows:
if not hasattr(w.Proxy,"sshapes"):
w.Proxy.execute(w)
if hasattr(w.Proxy,"sshapes"):
if w.Proxy.sshapes and (w.Name in cutwindows):
c = Part.makeCompound(w.Proxy.sshapes)
c.Placement = w.Placement
sh.append(c)
if hasattr(w.Proxy,"vshapes"):
if w.Proxy.vshapes:
c = Part.makeCompound(w.Proxy.vshapes)
c.Placement = w.Placement
sh.append(c)
if sh:
if not techdraw:
svg += '<g transform="scale(1,-1)">'
for s in sh:
svg += Draft.getSVG(s,scale=scale,linewidth=linewidth,fontsize=fontsize,fillstyle="none",direction=direction,techdraw=techdraw,rotation=rotation)
if not techdraw:
svg += '</g>'

#print "complete node:",svg
return svg

Expand Down

0 comments on commit 6951705

Please sign in to comment.