/[escript]/trunk/pyvisi_old/examples/ellipsoidPlot.py
ViewVC logotype

Contents of /trunk/pyvisi_old/examples/ellipsoidPlot.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 605 - (show annotations)
Mon Mar 20 07:16:27 2006 UTC (13 years, 8 months ago) by gross
Original Path: trunk/pyvisi/examples/ellipsoidPlot.py
File MIME type: text/x-python
File size: 1318 byte(s)
pyvisi with vtk runs noe on the altix
1 # $Id: ellipsoidPlot.py,v 1.5 2005/11/08 08:23:45 paultcochrane Exp $
2
3 """
4 Example of plotting ellipsoids (useful for visualising tensors) with pyvisi
5 """
6
7 import sys
8 numArgs = len(sys.argv)
9 if numArgs == 1:
10 ren_mod = "vtk"
11 else:
12 ren_mod = sys.argv[1]
13
14 # set up some data to plot
15 from Numeric import *
16
17 # example code for how a user would write a script in pyvisi
18 from esys.pyvisi import * # base level visualisation stuff
19 # import the objects to render the scene using the specific renderer
20
21 if ren_mod == "vtk":
22 from esys.pyvisi.renderers.vtk import * # vtk
23 elif ren_mod == "povray":
24 from esys.pyvisi.renderers.povray import * # povray
25 else:
26 raise ValueError, "Unknown renderer module"
27
28 # define the scene object
29 # a Scene is a container for all of the kinds of things you want to put
30 # into your plot for instance, images, meshes, arrow/vector/quiver plots,
31 # contour plots, spheres etc.
32 scene = Scene()
33
34 # create a EllipsoidPlot object
35 plot = EllipsoidPlot(scene)
36
37 # add some helpful info to the plot
38 plot.title = 'Example ellipsoid plot'
39
40 # plot data defined in a vtk file
41 plot.setData(fname='stress22.vtk', format='vtk-xml')
42
43 scene.render(pause=True, interactive=True)
44
45 # save the plot
46 scene.save(fname="ellipsoidPlot.png", format="png")
47
48 # vim: expandtab shiftwidth=4:
49

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26