Skip to content

Commit 9cdcd09

Browse files
committed
isosurface examples
1 parent 907b9d7 commit 9cdcd09

File tree

3 files changed

+962
-0
lines changed

3 files changed

+962
-0
lines changed

hotwater-isosurface-recorded.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import tecplot as tp
2+
from tecplot.exception import *
3+
from tecplot.constant import *
4+
5+
# Uncomment the following line to connect to a running instance of Tecplot 360:
6+
# tp.session.connect()
7+
8+
tp.active_frame().plot(PlotType.Cartesian3D).show_isosurfaces=True
9+
tp.active_frame().plot().isosurface(0).definition_contour_group_index=1
10+
tp.active_frame().plot().isosurface(0).isosurface_values[0]=-6000
11+
12+
tp.active_frame().plot().isosurface(0).contour.flood_contour_group_index=0
13+
tp.active_frame().plot().slice(0).effects.use_translucency=True
14+
tp.active_frame().plot().slice(0).effects.surface_translucency=40
15+
16+
tp.active_frame().plot().view.psi=68.2286
17+
tp.active_frame().plot().view.theta=-124.114
18+
tp.active_frame().plot().view.position=(
19+
2.95931,
20+
tp.active_frame().plot().view.position[1],
21+
tp.active_frame().plot().view.position[2])
22+
tp.active_frame().plot().view.position=(
23+
tp.active_frame().plot().view.position[0],
24+
2.15999,
25+
tp.active_frame().plot().view.position[2])
26+
tp.active_frame().plot().view.position=(
27+
tp.active_frame().plot().view.position[0],
28+
tp.active_frame().plot().view.position[1],
29+
1.45886)
30+
tp.active_frame().plot().view.width=0.339885
31+
# End Macro.

hotwater-isosurface.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import sys
2+
import numpy as np
3+
import tecplot as tp
4+
from tecplot.exception import *
5+
from tecplot.constant import *
6+
7+
if '-c' in sys.argv:
8+
tp.session.connect()
9+
tp.new_layout()
10+
11+
infile = 'hotwatermixing/HotWaterMixing.plt'
12+
dataset = tp.data.load_tecplot(infile)
13+
plot = tp.active_frame().plot(PlotType.Cartesian3D)
14+
plot.show_shade = False
15+
plot.show_slices = True
16+
contour = plot.slice(0).contour.flood_contour_group
17+
contour.variable = dataset.variable('Temperature')
18+
contour.legend.auto_resize = True
19+
contour.levels.reset_levels(np.linspace(280, 380, 201))
20+
21+
# get handle to isosurface group
22+
isosurf = plot.isosurface(0)
23+
24+
isosurf.definition_contour_group_index = 1
25+
isosurf.definition_contour_group.variable = P
26+
isosurf.contour.flood_contour_group = contour
27+
isosurf.isosurface_values = -6000
28+
29+
slice = tp.active_frame().plot().slice(0)
30+
slice.effects.use_translucency = True
31+
slice.effects.surface_translucency = 40
32+
33+
34+
plot.view.psi = 68.2286
35+
plot.view.theta = -124.114
36+
plot.view.position = 2.95931, 2.15999, 1.45886
37+
plot.view.width = 0.339885
38+
39+
tp.save_png('hotwater-isosurface.png')
40+

0 commit comments

Comments
 (0)