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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 637 - (show annotations)
Thu Mar 23 10:55:31 2006 UTC (14 years, 2 months ago) by gross
File MIME type: text/x-python
File size: 1926 byte(s)
more copyright statements added
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 @var __author__: name of author
7 @var __license__: licence agreement
8 @var __copyright__: copyrights
9 @var __url__: url entry point on documentation
10 @var __version__: version
11 @var __date__: date of the version
12 """
13
14 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
15 http://www.access.edu.au
16 Primary Business: Queensland, Australia"""
17 __license__="""Licensed under the Open Software License version 3.0
18 http://www.opensource.org/licenses/osl-3.0.php"""
19 __author__="Paul Cochrane"
20 __url__="http://www.iservo.edu.au/esys"
21 __version__="$Revision$"
22 __date__="$Date$"
23
24
25 import sys
26 numArgs = len(sys.argv)
27 if numArgs == 1:
28 ren_mod = "vtk"
29 else:
30 ren_mod = sys.argv[1]
31
32 # set up some data to plot
33 from Numeric import *
34
35 # example code for how a user would write a script in pyvisi
36 from esys.pyvisi import * # base level visualisation stuff
37 # import the objects to render the scene using the specific renderer
38
39 if ren_mod == "vtk":
40 from esys.pyvisi.renderers.vtk import * # vtk
41 elif ren_mod == "povray":
42 from esys.pyvisi.renderers.povray import * # povray
43 else:
44 raise ValueError, "Unknown renderer module"
45
46 # define the scene object
47 # a Scene is a container for all of the kinds of things you want to put
48 # into your plot for instance, images, meshes, arrow/vector/quiver plots,
49 # contour plots, spheres etc.
50 scene = Scene()
51
52 # create a EllipsoidPlot object
53 plot = EllipsoidPlot(scene)
54
55 # add some helpful info to the plot
56 plot.title = 'Example ellipsoid plot'
57
58 # plot data defined in a vtk file
59 plot.setData(fname='stress22.vtk', format='vtk-xml')
60
61 scene.render(pause=True, interactive=True)
62
63 # save the plot
64 scene.save(fname="ellipsoidPlot.png", format="png")
65
66 # vim: expandtab shiftwidth=4:
67

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26