[MayaVi-users] How to plot triangular mesh without the GUI coming up?
Status: Beta
Brought to you by:
prabhu_r
|
From: John R. C. <ca...@tx...> - 2009-05-25 15:53:13
|
I got past the installation and am now trying
batch generation of images, in particular of
a triangular mesh. At the top of my script,
following the nongui.py example, I have
import tables
import numpy
from enthought.mayavi import mlab
from enthought.mayavi.plugins.app import Mayavi, get_non_gui_plugins
class CrabCavity(Mayavi):
def run(self):
# Then generate points and triangles
# Then at the bottom I have
# Create script and add triangles
script = self.script
script.new_scene()
tmesh = mlab.triangular_mesh(points[:, 0], points[:, 1],
points[:, 2], triangles)
script.add_module(tmesh)
# Set the view
s = script.engine.current_scene
cam = s.scene.camera
cam.azimuth(45)
cam.elevation(15)
s.render()
s.scene.save("crabcav.png", size=(640,480))
if __name__ == '__main__':
m = CrabCavity()
# Get the default non GUI plugins.
plugins = get_non_gui_plugins()
# Start the app with these plugins.
m.main(plugins=plugins)
which I run with python.
It seems that the gui always comes up. I just want to
create my scene and save it in a png without the GUI
coming up.
What am I doing wrong?
Thanks....John Cary
|