22
|
1 |
# Recorded script from Mayavi2
|
|
2 |
from numpy import array
|
|
3 |
try:
|
|
4 |
engine = mayavi.engine
|
|
5 |
except NameError:
|
|
6 |
from enthought.mayavi.api import Engine
|
|
7 |
engine = Engine()
|
|
8 |
engine.start()
|
|
9 |
if len(engine.scenes) == 0:
|
|
10 |
engine.new_scene()
|
|
11 |
# -------------------------------------------
|
|
12 |
scene = engine.scenes[0]
|
|
13 |
vtkxml_file_reader = engine.open(u'/Users/prabhu/work/MEDIA/m2/data/solution.vtp', scene)
|
|
14 |
from enthought.mayavi.modules.surface import Surface
|
|
15 |
surface = Surface()
|
|
16 |
engine.add_filter(surface, vtkxml_file_reader)
|
|
17 |
scene.scene.camera.position = [-5.0805380472988206, -22.772737120755238, 27.951999647518075]
|
|
18 |
scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052]
|
|
19 |
scene.scene.camera.view_angle = 30.0
|
|
20 |
scene.scene.camera.view_up = [-0.1142423672711194, 0.76412329986979977, 0.63487342369670707]
|
|
21 |
scene.scene.camera.clipping_range = [22.838642391722981, 51.077591804257452]
|
|
22 |
scene.scene.camera.compute_view_plane_normal()
|
|
23 |
scene.scene.render()
|
|
24 |
scene.scene.camera.position = [-26.79814746753679, -17.616423028517339, 16.698474306673273]
|
|
25 |
scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052]
|
|
26 |
scene.scene.camera.view_angle = 30.0
|
|
27 |
scene.scene.camera.view_up = [0.117668827287714, 0.54423876670086724, 0.83063723243342136]
|
|
28 |
scene.scene.camera.clipping_range = [16.95271984178639, 58.486755617116714]
|
|
29 |
scene.scene.camera.compute_view_plane_normal()
|
|
30 |
scene.scene.render()
|
|
31 |
surface.actor.property.edge_visibility = True
|
|
32 |
surface.actor.property.line_width = 1.0908000469207764
|
|
33 |
surface.actor.property.line_width = 1.0908
|
|
34 |
vtkxml_file_reader1 = engine.open(u'/Users/prabhu/work/MEDIA/m2/data/shuttle_flow_vel.vti', scene)
|
|
35 |
from enthought.mayavi.filters.extract_vector_norm import ExtractVectorNorm
|
|
36 |
extract_vector_norm = ExtractVectorNorm()
|
|
37 |
engine.add_filter(extract_vector_norm, vtkxml_file_reader1)
|
|
38 |
from enthought.mayavi.modules.streamline import Streamline
|
|
39 |
streamline = Streamline()
|
|
40 |
engine.add_filter(streamline, extract_vector_norm)
|
|
41 |
from enthought.mayavi.modules.outline import Outline
|
|
42 |
outline = Outline()
|
|
43 |
engine.add_filter(outline, extract_vector_norm)
|
|
44 |
scene.scene.camera.position = [-26.161739435640946, -23.33968605285963, -4.330818803012459]
|
|
45 |
scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052]
|
|
46 |
scene.scene.camera.view_angle = 30.0
|
|
47 |
scene.scene.camera.view_up = [-0.41262625326967384, 0.24138827815138408, 0.87833437498696409]
|
|
48 |
scene.scene.camera.clipping_range = [12.567524761986057, 64.885104918139973]
|
|
49 |
scene.scene.camera.compute_view_plane_normal()
|
|
50 |
scene.scene.render()
|
|
51 |
scene.scene.camera.position = [-33.987476012111991, 7.0742035800218508, 9.2515505356797192]
|
|
52 |
scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052]
|
|
53 |
scene.scene.camera.view_angle = 30.0
|
|
54 |
scene.scene.camera.view_up = [0.27210126222372499, 0.27131677472862931, 0.92322700937911817]
|
|
55 |
scene.scene.camera.clipping_range = [13.498366440121661, 63.78023185599239]
|
|
56 |
scene.scene.camera.compute_view_plane_normal()
|
|
57 |
scene.scene.render()
|
|
58 |
streamline.seed.widget.center = array([-1.76092294, -2.19636703, -4.07769924])
|
|
59 |
streamline.seed.widget.handle_direction = array([ 1., 0., 0.])
|
|
60 |
scene.scene.camera.position = [-0.14627247022011527, 35.246003093475835, -0.59149933326899151]
|
|
61 |
scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052]
|
|
62 |
scene.scene.camera.view_angle = 30.0
|
|
63 |
scene.scene.camera.view_up = [0.10775362069649223, 0.055684269920481991, 0.99261695497821301]
|
|
64 |
scene.scene.camera.clipping_range = [22.165106941458703, 51.720503614694223]
|
|
65 |
scene.scene.camera.compute_view_plane_normal()
|
|
66 |
scene.scene.render()
|
|
67 |
streamline.seed.widget.center = array([-9.46036585, -1.98695846, -0.98230673])
|
|
68 |
streamline.seed.widget.handle_direction = array([ 1., 0., 0.])
|
|
69 |
scene.scene.camera.position = [-24.531837698557823, -25.223630761907124, -3.3952332503501701]
|
|
70 |
scene.scene.camera.focal_point = [-0.30313491821289062, 0.0, 1.4027749300003052]
|
|
71 |
scene.scene.camera.view_angle = 30.0
|
|
72 |
scene.scene.camera.view_up = [-0.014255927708073379, -0.17361673895115709, 0.98471010783943314]
|
|
73 |
scene.scene.camera.clipping_range = [10.590545716157719, 65.485850871289045]
|
|
74 |
scene.scene.camera.compute_view_plane_normal()
|
|
75 |
scene.scene.render()
|
|
76 |
# -------------------------------------------
|
|
77 |
from enthought.mayavi.tools.show import show
|
|
78 |
show()
|