I have tested VTK 5.8.0, 5.10.1, 6.2.0, 6.3.0 and only got seg faults for VTK 6.3.0
from __future__ import print_function
from mayavi import mlab
def mlab_save_figs(off_screen_rendering, **kwargs):
for ifig in xrange(5):
figure = mlab.figure()
figure.scene.off_screen_rendering = off_screen_rendering
mlab.test_contour3d()
mlab.savefig("test{}.png".format(ifig), **kwargs)
print("figure {} created".format(ifig))
mlab.close()
## This is fine but the saved image dimension is different from the figure (window) size
# mlab_save_figs(True)
## This seg fault while making the second/third/... figure
# mlab_save_figs(True, size=(100, 200))
## This won't segfault but 3/4 of the image is black
## as figure size < image size
# mlab_save_figs(False, size=(800, 700), magnification=1.0)
## This won't segfault and the image seems fine but the size is not exactly (800, 700)
# mlab_save_figs(False, size=(800, 700))
OS: Ubuntu 12.02 LTS 64bit
Branch: master
I have tested VTK 5.8.0, 5.10.1, 6.2.0, 6.3.0 and only got seg faults for VTK 6.3.0
OS: Ubuntu 12.02 LTS 64bit
Branch: master