Newer
Older
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# state file generated using paraview version 5.7.0
# ----------------------------------------------------------------
# setup views used in the visualization
# ----------------------------------------------------------------
# trace generated using paraview version 5.7.0
#
# To ensure correct image size when batch processing, please search
# for and uncomment the line `# renderView*.ViewSize = [*,*]`
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# Create a new 'Render View'
renderView1 = CreateView('RenderView')
renderView1.ViewSize = [901, 795]
renderView1.AxesGrid = 'GridAxes3DActor'
renderView1.CenterOfRotation = [0.22986745834350586, 0.03941011428833008, 0.17028677463531494]
renderView1.StereoType = 'Crystal Eyes'
renderView1.CameraPosition = [53.44770716226582, -21.61022632014142, -4.102774671003825]
renderView1.CameraFocalPoint = [0.22986745834350583, 0.039410114288330106, 0.17028677463531497]
renderView1.CameraViewUp = [-0.28235039193869665, -0.7988816556360265, 0.531099196441028]
renderView1.CameraFocalDisk = 1.0
renderView1.CameraParallelScale = 5.748834779828519
renderView1.Background = [0.32, 0.34, 0.43]
SetActiveView(None)
# ----------------------------------------------------------------
# setup view layouts
# ----------------------------------------------------------------
# create new layout object 'Layout #1'
layout1 = CreateLayout(name='Layout #1')
layout1.AssignView(0, renderView1)
# ----------------------------------------------------------------
# restore active view
SetActiveView(renderView1)
# ----------------------------------------------------------------
# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------
# create a new 'Legacy VTK Reader'
matlab_exportvtk = LegacyVTKReader(FileNames=['/home/klaus/Desktop/DUNE/dune-microstructure/Matlab-Programs/matlab_export.vtk'])
# create a new 'Legacy VTK Reader'
pointSetvtk = LegacyVTKReader(FileNames=['/home/klaus/Desktop/Paraview-Data/ParaView-v5.9.0/Testing/Data/pointSet.vtk'])
# ----------------------------------------------------------------
# setup the visualization in view 'renderView1'
# ----------------------------------------------------------------
# show data from pointSetvtk
pointSetvtkDisplay = Show(pointSetvtk, renderView1)
# get color transfer function/color map for 'RandomPointScalars'
randomPointScalarsLUT = GetColorTransferFunction('RandomPointScalars')
randomPointScalarsLUT.RGBPoints = [2.0, 0.231373, 0.298039, 0.752941, 5.5, 0.865003, 0.865003, 0.865003, 9.0, 0.705882, 0.0156863, 0.14902]
randomPointScalarsLUT.ScalarRangeInitialized = 1.0
# trace defaults for the display properties.
pointSetvtkDisplay.Representation = 'Points'
pointSetvtkDisplay.ColorArrayName = ['POINTS', 'RandomPointScalars']
pointSetvtkDisplay.LookupTable = randomPointScalarsLUT
pointSetvtkDisplay.RenderPointsAsSpheres = 1
pointSetvtkDisplay.OSPRayScaleArray = 'RandomPointScalars'
pointSetvtkDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
pointSetvtkDisplay.SelectOrientationVectors = 'RandomCellVectors'
pointSetvtkDisplay.ScaleFactor = 0.7009325742721558
pointSetvtkDisplay.SelectScaleArray = 'RandomPointScalars'
pointSetvtkDisplay.GlyphType = 'Arrow'
pointSetvtkDisplay.GlyphTableIndexArray = 'RandomPointScalars'
pointSetvtkDisplay.GaussianRadius = 0.03504662871360779
pointSetvtkDisplay.SetScaleArray = ['POINTS', 'RandomPointScalars']
pointSetvtkDisplay.ScaleTransferFunction = 'PiecewiseFunction'
pointSetvtkDisplay.OpacityArray = ['POINTS', 'RandomPointScalars']
pointSetvtkDisplay.OpacityTransferFunction = 'PiecewiseFunction'
pointSetvtkDisplay.DataAxesGrid = 'GridAxesRepresentation'
pointSetvtkDisplay.PolarAxes = 'PolarAxesRepresentation'
# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
pointSetvtkDisplay.ScaleTransferFunction.Points = [2.0, 0.0, 0.5, 0.0, 9.0, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
pointSetvtkDisplay.OpacityTransferFunction.Points = [2.0, 0.0, 0.5, 0.0, 9.0, 1.0, 0.5, 0.0]
# show data from matlab_exportvtk
matlab_exportvtkDisplay = Show(matlab_exportvtk, renderView1)
# trace defaults for the display properties.
matlab_exportvtkDisplay.Representation = 'Surface With Edges'
matlab_exportvtkDisplay.ColorArrayName = [None, '']
matlab_exportvtkDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
matlab_exportvtkDisplay.SelectOrientationVectors = 'None'
matlab_exportvtkDisplay.ScaleFactor = 9.9
matlab_exportvtkDisplay.SelectScaleArray = 'None'
matlab_exportvtkDisplay.GlyphType = 'Arrow'
matlab_exportvtkDisplay.GlyphTableIndexArray = 'None'
matlab_exportvtkDisplay.GaussianRadius = 0.495
matlab_exportvtkDisplay.SetScaleArray = [None, '']
matlab_exportvtkDisplay.ScaleTransferFunction = 'PiecewiseFunction'
matlab_exportvtkDisplay.OpacityArray = [None, '']
matlab_exportvtkDisplay.OpacityTransferFunction = 'PiecewiseFunction'
matlab_exportvtkDisplay.DataAxesGrid = 'GridAxesRepresentation'
matlab_exportvtkDisplay.PolarAxes = 'PolarAxesRepresentation'
# setup the color legend parameters for each legend in this view
# get color legend/bar for randomPointScalarsLUT in view renderView1
randomPointScalarsLUTColorBar = GetScalarBar(randomPointScalarsLUT, renderView1)
randomPointScalarsLUTColorBar.Title = 'RandomPointScalars'
randomPointScalarsLUTColorBar.ComponentTitle = ''
# set color bar visibility
randomPointScalarsLUTColorBar.Visibility = 1
# show color legend
pointSetvtkDisplay.SetScalarBarVisibility(renderView1, True)
# ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization
# note: the Get..() functions create a new object, if needed
# ----------------------------------------------------------------
# get opacity transfer function/opacity map for 'RandomPointScalars'
randomPointScalarsPWF = GetOpacityTransferFunction('RandomPointScalars')
randomPointScalarsPWF.Points = [2.0, 0.0, 0.5, 0.0, 9.0, 1.0, 0.5, 0.0]
randomPointScalarsPWF.ScalarRangeInitialized = 1
# ----------------------------------------------------------------
# finally, restore active source
SetActiveSource(matlab_exportvtk)
# ----------------------------------------------------------------