From 77f6684dfec6eb910656c81f0b4b9f0b7f3bd240 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sat, 28 Feb 2015 19:33:49 -0300 Subject: [PATCH] Arch: Enabled section filling in Arch drawing views --- src/Mod/Arch/ArchSectionPlane.py | 31 ++++++++++++++++++++++++++----- src/Mod/Draft/Draft.py | 16 +++++++++++++--- src/Mod/Draft/DraftGeomUtils.py | 7 ++++++- 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index 54109dde9..560b965b0 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -292,6 +292,7 @@ class _ArchDrawingView: obj.addProperty("App::PropertyLink","Source","Base","The linked object") obj.addProperty("App::PropertyEnumeration","RenderingMode","Drawing view","The rendering mode to use") obj.addProperty("App::PropertyBool","ShowCut","Drawing view","If cut geometry is shown or not") + obj.addProperty("App::PropertyBool","ShowFill","Drawing view","If cut geometry is filled or not") obj.addProperty("App::PropertyFloat","LineWidth","Drawing view","The line width of the rendered objects") obj.addProperty("App::PropertyLength","FontSize","Drawing view","The size of the texts inside this object") obj.RenderingMode = ["Solid","Wireframe"] @@ -408,12 +409,17 @@ class _ArchDrawingView: c = sol.cut(cutvolume) s = sol.section(cutface) try: - s = Part.Wire(s.Edges) - s = Part.Face(s) + wires = DraftGeomUtils.findWires(s.Edges) + for w in wires: + f = Part.Face(w) + sshapes.append(f) + #s = Part.Wire(s.Edges) + #s = Part.Face(s) except Part.OCCError: - pass + #print "ArchDrawingView: unable to get a face" + sshapes.append(s) nsh.extend(c.Solids) - sshapes.append(s) + #sshapes.append(s) if hasattr(obj,"ShowCut"): if obj.ShowCut: c = sol.cut(invcutvolume) @@ -439,13 +445,28 @@ class _ArchDrawingView: svgh = svgh.replace('fill="none"','fill="none"\nstroke-dasharray="DAPlaceholder"') self.svg += svgh if sshapes: + svgs = "" + if hasattr(obj,"ShowFill"): + if obj.ShowFill: + svgs += '\n' + svgs += '