From c465ca261ce3289daf427cb30a5626c159232287 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 3 Nov 2016 16:40:12 -0200 Subject: [PATCH] Arch: Added preference setting to control linewidth of Draft objects seen by Arch Section Planes --- src/Mod/Arch/ArchSectionPlane.py | 7 +-- src/Mod/Arch/Resources/ui/preferences-arch.ui | 53 +++++++++++++++++++ src/Mod/Draft/Draft.py | 11 ++-- 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index c28cdab10..c527a6754 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -219,6 +219,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill= svg += svgs scaledlinewidth = linewidth/scale st = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetFloat("CutLineThickness",2) + yt = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetFloat("SymbolLineThickness",0.6) da = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetString("archHiddenPattern","30,10") da = da.replace(" ","") svg = svg.replace('LWPlaceholder', str(scaledlinewidth) + 'px') @@ -228,7 +229,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill= if not techdraw: svg += '' for d in drafts: - svg += Draft.getSVG(d,scale=scale,linewidth=linewidth,fontsize=fontsize,direction=direction,techdraw=techdraw,rotation=rotation) + svg += Draft.getSVG(d,scale=scale,linewidth=linewidth*yt,fontsize=fontsize,direction=direction,techdraw=techdraw,rotation=rotation) if not techdraw: svg += '' # filter out spaces not cut by the section plane @@ -238,7 +239,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill= if not techdraw: svg += '' for s in spaces: - svg += Draft.getSVG(s,scale=scale,linewidth=linewidth,fontsize=fontsize,direction=direction,techdraw=techdraw,rotation=rotation) + svg += Draft.getSVG(s,scale=scale,linewidth=linewidth*yt,fontsize=fontsize,direction=direction,techdraw=techdraw,rotation=rotation) if not techdraw: svg += '' # add additional edge symbols from windows @@ -263,7 +264,7 @@ def getSVG(section,allOn=False,renderMode="Wireframe",showHidden=False,showFill= if not techdraw: svg += '' for s in sh: - svg += Draft.getSVG(s,scale=scale,linewidth=linewidth,fontsize=fontsize,fillstyle="none",direction=direction,techdraw=techdraw,rotation=rotation) + svg += Draft.getSVG(s,scale=scale,linewidth=linewidth*yt,fontsize=fontsize,fillstyle="none",direction=direction,techdraw=techdraw,rotation=rotation) if not techdraw: svg += '' diff --git a/src/Mod/Arch/Resources/ui/preferences-arch.ui b/src/Mod/Arch/Resources/ui/preferences-arch.ui index 263a43a3e..5583cbf64 100644 --- a/src/Mod/Arch/Resources/ui/preferences-arch.ui +++ b/src/Mod/Arch/Resources/ui/preferences-arch.ui @@ -366,6 +366,59 @@ + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + Symbol line thickness ratio + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0.600000000000000 + + + SymbolLineThickness + + + Mod/Arch + + + + + diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 39dd3fd62..c2c04776d 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -2023,14 +2023,9 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct t = text[i] if not isinstance(t,unicode): t = t.decode("utf8") - # temporary workaround for unsupported UTF8 in techdraw - try: - import unicodedata - except: - t = "" - print "Draft.getSVG: unicodedata not available" - else: - t = u"".join([c for c in unicodedata.normalize("NFKD",t) if not unicodedata.combining(c)]).encode("utf8") + # possible workaround if UTF8 is unsupported + # import unicodedata + # t = u"".join([c for c in unicodedata.normalize("NFKD",t) if not unicodedata.combining(c)]).encode("utf8") svg += '