diff --git a/src/Mod/Arch/ArchMaterial.py b/src/Mod/Arch/ArchMaterial.py
index bc035f7bf..71c71ca8e 100644
--- a/src/Mod/Arch/ArchMaterial.py
+++ b/src/Mod/Arch/ArchMaterial.py
@@ -219,6 +219,7 @@ class _ArchMaterialTaskPanel:
self.obj.Material = self.material
self.obj.Label = self.material['Name']
FreeCADGui.ActiveDocument.resetEdit()
+ FreeCADGui.Control.closeDialog()
def chooseMat(self, card):
"sets self.material from a card"
@@ -247,7 +248,7 @@ class _ArchMaterialTaskPanel:
if e.upper() == ".FCMAT":
self.cards[b] = p + os.sep + f
if self.cards:
- for k,i in self.cards.items():
+ for k in sorted(self.cards.keys()):
self.form.comboBox_MaterialsInDir.addItem(k)
def openEditor(self):
diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py
index fce4ff8fd..8963c6850 100644
--- a/src/Mod/Arch/ArchSectionPlane.py
+++ b/src/Mod/Arch/ArchSectionPlane.py
@@ -357,20 +357,28 @@ class _ArchDrawingView:
os.append(o)
objs = os
self.svg = ''
+ fillpattern = ''
+ fillpattern += ''
+ fillpattern += ''
# generating SVG
if obj.RenderingMode == "Solid":
# render using the Arch Vector Renderer
- import ArchVRM
+ import ArchVRM, WorkingPlane
+ wp = WorkingPlane.plane()
+ wp.setFromPlacement(obj.Source.Placement)
+ wp.inverse()
render = ArchVRM.Renderer()
- render.setWorkingPlane(obj.Source.Placement)
+ render.setWorkingPlane(wp)
render.addObjects(objs)
if hasattr(obj,"ShowCut"):
render.cut(obj.Source.Shape,obj.ShowCut)
else:
render.cut(obj.Source.Shape)
self.svg += render.getViewSVG(linewidth="LWPlaceholder")
- self.svg += render.getSectionSVG(linewidth="SWPLaceholder")
+ self.svg += fillpattern
+ self.svg += render.getSectionSVG(linewidth="SWPlaceholder",fillpattern="sectionfill")
if hasattr(obj,"ShowCut"):
if obj.ShowCut:
self.svg += render.getHiddenSVG(linewidth="LWPlaceholder")
@@ -448,11 +456,8 @@ class _ArchDrawingView:
svgs = ""
if hasattr(obj,"ShowFill"):
if obj.ShowFill:
+ svgs += fillpattern
svgs += '\n'
- svgs += ''
- svgs += ''
- svgs += ''
for s in sshapes:
if s.Edges:
f = Draft.getSVG(s,direction=self.direction.negative(),linewidth=0,fillstyle="sectionfill",color=(0,0,0))
diff --git a/src/Mod/Arch/ArchVRM.py b/src/Mod/Arch/ArchVRM.py
index 27b1aba9a..3eb1a60b6 100644
--- a/src/Mod/Arch/ArchVRM.py
+++ b/src/Mod/Arch/ArchVRM.py
@@ -521,13 +521,16 @@ class Renderer:
notfoundstack = 0
break
elif r == 31:
- faces.remove(f1)
+ if f1 in faces:
+ faces.remove(f1)
elif r == 32:
- faces.remove(f2)
+ if f2 in faces:
+ faces.remove(f2)
else:
# nothing found, move the face to the end of the pile
- faces.remove(f1)
- faces.append(f1)
+ if f1 in faces:
+ faces.remove(f1)
+ faces.append(f1)
loopcount += 1
if loopcount == MAXLOOP * len(self.faces):
if DEBUG: print "Too many loops, aborting."
@@ -586,50 +589,42 @@ class Renderer:
if DEBUG: print "Printing ", len(self.faces), " faces"
if not self.sorted:
self.sort()
- svg = ''
+ svg = '\n'
for f in self.faces:
if f:
fill = self.getFill(f[1])
- svg +='\n'
+ svg += '" style="fill:' + fill + ';fill-rule: evenodd;"/>\n'
+ svg += '\n'
return svg
- def getSectionSVG(self,linewidth=0.02):
+ def getSectionSVG(self,linewidth=0.02,fillpattern=None):
"Returns a SVG fragment from cut faces"
if DEBUG: print "Printing ", len(self.sections), " sections"
if not self.oriented:
self.reorient()
- svg = ''
+ svg = '\n'
for f in self.sections:
if f:
- fill = self.getFill(f[1])
+ if fillpattern:
+ if "#" in fillpattern: # color
+ fill = fillpattern
+ else:
+ fill="url(#"+fillpattern+")" # pattern name
+ else:
+ fill = 'none' # none
svg +='\n'
+ svg += '" style="fill:' + fill + ';fill-rule: evenodd;"/>\n'
+ svg += '\n'
return svg
def getHiddenSVG(self,linewidth=0.02):
@@ -637,19 +632,13 @@ class Renderer:
if DEBUG: print "Printing ", len(self.sections), " hidden faces"
if not self.oriented:
self.reorient()
- svg = ''
+ svg = '\n'
for e in self.hiddenEdges:
svg +='\n'
+ svg += '\n'
return svg
diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py
index f0999b009..8518291a1 100644
--- a/src/Mod/Draft/Draft.py
+++ b/src/Mod/Draft/Draft.py
@@ -4237,7 +4237,8 @@ class _Wire(_DraftObject):
if len(obj.Points) > 2:
obj.setEditorMode('Start',2)
obj.setEditorMode('End',2)
- obj.setEditorMode('Length',2)
+ if hasattr(obj,"Length"):
+ obj.setEditorMode('Length',2)
class _ViewProviderWire(_ViewProviderDraft):
diff --git a/src/Mod/Draft/WorkingPlane.py b/src/Mod/Draft/WorkingPlane.py
index 2c6f4bec8..de0a385d6 100644
--- a/src/Mod/Draft/WorkingPlane.py
+++ b/src/Mod/Draft/WorkingPlane.py
@@ -302,6 +302,11 @@ class plane:
self.u = rot.multVec(FreeCAD.Vector(1,0,0))
self.v = rot.multVec(FreeCAD.Vector(0,1,0))
self.axis = rot.multVec(FreeCAD.Vector(0,0,1))
+
+ def inverse(self):
+ "inverts the direction of the working plane"
+ self.u = self.u.negative()
+ self.axis = self.axis.negative()
def save(self):
"stores the current plane state"