Skip to content

Commit

Permalink
Arch: Fixed wrong section fill when using archvrm module
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jan 5, 2021
1 parent 58cf466 commit d7692e3
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/Mod/Arch/ArchSectionPlane.py
Expand Up @@ -320,7 +320,7 @@ def getSVG(source,
lineColor=(0.0, 0.0, 0.0),
fontsize=1,
showFill=False,
fillColor=(0.8, 0.8, 0.8),
fillColor=(1.0, 1.0, 1.0),
techdraw=False,
fillSpaces=False,
cutlinewidth=0,
Expand Down Expand Up @@ -400,10 +400,10 @@ def getSVG(source,
svgSymbolLineWidth = str(linewidth * yt)
hiddenPattern = archUserParameters.GetString("archHiddenPattern","30,10")
svgHiddenPattern = hiddenPattern.replace(" ","")
fillpattern = '<pattern id="sectionfill" patternUnits="userSpaceOnUse" patternTransform="matrix(5,0,0,5,0,0)"'
fillpattern += ' x="0" y="0" width="10" height="10">'
fillpattern += '<g>'
fillpattern += '<rect width="10" height="10" style="stroke:none; fill:#ffffff" /><path style="stroke:#000000; stroke-width:1" d="M0,0 l10,10" /></g></pattern>'
#fillpattern = '<pattern id="sectionfill" patternUnits="userSpaceOnUse" patternTransform="matrix(5,0,0,5,0,0)"'
#fillpattern += ' x="0" y="0" width="10" height="10">'
#fillpattern += '<g>'
#fillpattern += '<rect width="10" height="10" style="stroke:none; fill:#ffffff" /><path style="stroke:#000000; stroke-width:1" d="M0,0 l10,10" /></g></pattern>'
svgLineColor = Draft.getrgb(lineColor)
svg = ''
# reading cached version
Expand Down Expand Up @@ -444,11 +444,16 @@ def getSVG(source,
render.cut(cutplane,showHidden)
else:
render.cut(cutplane)
svgcache += '<g transform="scale(1,-1)">\n'
g = '<g transform="scale(1,-1)">\n'
if hasattr(source.ViewObject,"RotateSolidRender"):
if (source.ViewObject.RotateSolidRender.Value != 0):
g = '<g transform="scale(1,-1) rotate('
g += str(source.ViewObject.RotateSolidRender.Value)
g += ')">\n'
svgcache += g
svgcache += render.getViewSVG(linewidth="SVGLINEWIDTH")
svgcache += fillpattern
svgcache += render.getSectionSVG(linewidth="SVGCUTLINEWIDTH",
fillpattern="sectionfill")
#svgcache += fillpattern
svgcache += render.getSectionSVG(linewidth="SVGCUTLINEWIDTH",fillpattern="#ffffff")
if showHidden:
svgcache += render.getHiddenSVG(linewidth="SVGLINEWIDTH")
svgcache += '</g>\n'
Expand Down

1 comment on commit d7692e3

@bitacovir
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yorikvanhavre Attention to a possible regression related to this commit maybe.
See: https://forum.freecadweb.org/viewtopic.php?f=23&t=57534

Please sign in to comment.