forked from Tecplot/handyscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path15_wing_mach_iso.py
More file actions
48 lines (38 loc) · 1.37 KB
/
15_wing_mach_iso.py
File metadata and controls
48 lines (38 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import tecplot
from tecplot.constant import *
import os
# Run this script with "-c" to connect to Tecplot 360 on port 7600
# To enable connections in Tecplot 360, click on:
# "Scripting" -> "PyTecplot Connections..." -> "Accept connections"
import sys
if '-c' in sys.argv:
tecplot.session.connect()
examples_dir = tecplot.session.tecplot_examples_directory()
datafile = os.path.join(examples_dir, 'OneraM6wing', 'OneraM6_SU2_RANS.plt')
ds = tecplot.data.load_tecplot(datafile)
frame = tecplot.active_frame()
plot = frame.plot()
# Set Isosurface to match Contour Levels of the first group.
iso = plot.isosurface(0)
iso.isosurface_selection = IsoSurfaceSelection.AllContourLevels
cont = plot.contour(0)
iso.definition_contour_group = cont
cont.colormap_name = 'Magma'
# Setup definition Isosurface layers
cont.variable = ds.variable('Mach')
cont.levels.reset_levels( [.95,1.0,1.1,1.4])
print(list(cont.levels))
# Turn on Translucency
iso.effects.use_translucency = True
iso.effects.surface_translucency = 80
# Turn on Isosurfaces
plot.show_isosurfaces = True
iso.show = True
cont.legend.show = False
view = plot.view
view.psi = 65.777
view.theta = 166.415
view.alpha = -1.05394
view.position = (-23.92541680486183, 101.8931504712126, 47.04269529295333)
view.width = 1.3844
tecplot.export.save_png("wing_iso.png",width=600, supersample=3)