/[escript]/trunk-mpi-branch/doc/examples/pyvisi/ellipsoidonplaneclip.py
ViewVC logotype

Annotation of /trunk-mpi-branch/doc/examples/pyvisi/ellipsoidonplaneclip.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1306 - (hide annotations)
Tue Sep 18 05:51:09 2007 UTC (12 years ago) by ksteube
File MIME type: text/x-python
File size: 1747 byte(s)
New Copyright in each .c .h .cpp and .py file

1 ksteube 1306 #
2     # $Id$
3     #
4     #######################################################
5     #
6     # Copyright 2003-2007 by ACceSS MNRF
7     # Copyright 2007 by University of Queensland
8     #
9     # http://esscc.uq.edu.au
10     # Primary Business: Queensland, Australia
11     # Licensed under the Open Software License version 3.0
12     # http://www.opensource.org/licenses/osl-3.0.php
13     #
14     #######################################################
15     #
16    
17 ksteube 1295 """
18     Author: John Ngui, john.ngui@uq.edu.au
19     """
20    
21     # Import the necessary modules
22     from esys.pyvisi import Scene, DataCollector, EllipsoidOnPlaneClip, Camera
23     from esys.pyvisi.constant import *
24     import os
25    
26     PYVISI_EXAMPLE_MESHES_PATH = "data_meshes"
27     PYVISI_EXAMPLE_IMAGES_PATH = "data_sample_images"
28     X_SIZE = 400
29     Y_SIZE = 400
30    
31     TENSOR_FIELD_CELL_DATA = "stress_cell"
32     FILE_3D = "interior_3D.xml"
33     IMAGE_NAME = "ellipsoid.jpg"
34     JPG_RENDERER = Renderer.ONLINE_JPG
35    
36     # Create a Scene.
37     s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE,
38     y_size = Y_SIZE)
39    
40     # Create a DataCollector reading from a XML file.
41     dc1 = DataCollector(source = Source.XML)
42     dc1.setFileName(file_name = os.path.join(PYVISI_EXAMPLE_MESHES_PATH, FILE_3D))
43     dc1.setActiveTensor(tensor = TENSOR_FIELD_CELL_DATA)
44    
45     # Create an EllipsoidOnPlaneClip.
46     eopc1 = EllipsoidOnPlaneClip(scene = s, data_collector = dc1,
47     viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, cell_to_point = True,
48     outline = True)
49     eopc1.setPlaneToXY()
50     eopc1.setScaleFactor(scale_factor = 0.2)
51     eopc1.rotateX(angle = 10)
52    
53     # Create a Camera.
54     c1 = Camera(scene = s, viewport = Viewport.SOUTH_WEST)
55     c1.bottomView()
56     c1.azimuth(angle = -90)
57     c1.elevation(angle = 10)
58    
59     # Render the object.
60     s.render(image_name = os.path.join(PYVISI_EXAMPLE_IMAGES_PATH, IMAGE_NAME))
61    

  ViewVC Help
Powered by ViewVC 1.1.26