Skip to content

Commit 8991302

Browse files
committed
Export to vector works for transparent geometries as well
1 parent 667750c commit 8991302

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

Packages/vcs/vcs/VTKPlots.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -688,21 +688,16 @@ def plot(self, data1, data2, template, gtype, gname, bg, *args, **kargs):
688688
self.scaleLogo()
689689

690690
# Decide whether to rasterize background in vector outputs
691-
# Current criteria to rasterize:
691+
# Current limitation to vectorize:
692692
# * if fillarea style is either pattern or hatch
693-
# * if fillarea opacity is less than 100 for solid fill
694693
try:
695694
if gm.style and all(style != 'solid' for style in gm.style):
696695
self._rasterPropsInVectorFormats = True
697-
elif gm.opacity and not all(o == 100 for o in gm.opacity):
698-
self._rasterPropsInVectorFormats = True
699696
except:
700697
pass
701698
try:
702699
if gm.fillareastyle in ['pattern', 'hatch']:
703700
self._rasterPropsInVectorFormats = True
704-
elif not all(o == 100 for o in gm.fillareaopacity):
705-
self._rasterPropsInVectorFormats = True
706701
except:
707702
pass
708703

@@ -1109,8 +1104,9 @@ def vectorGraphics(self, output_type, file, width=None, height=None,
11091104

11101105
# Since the patterns are applied as textures on vtkPolyData, enabling
11111106
# background rasterization is required to write them out
1112-
# if self._rasterPropsInVectorFormats:
1113-
# gl.Write3DPropsAsRasterImageOn()
1107+
1108+
if self._rasterPropsInVectorFormats:
1109+
gl.Write3DPropsAsRasterImageOn()
11141110

11151111
gl.SetInput(self.renWin)
11161112
gl.SetCompress(0) # Do not compress

0 commit comments

Comments
 (0)