1r3.out.vtk(1) Grass User's Manual r3.out.vtk(1)
2
3
4
6 r3.out.vtk - Converts 3D raster maps (G3D) into the VTK-Ascii format
7
9 raster3d, voxel
10
12 r3.out.vtk
13 r3.out.vtk help
14 r3.out.vtk [-psmoc] [input=name[,name,...]] [output=name]
15 [null=float] [top=string] [bottom=string]
16 [rgbmaps=string[,string,...]] [vectormaps=string[,string,...]]
17 [elevscale=float] [dp=integer] [--verbose] [--quiet]
18
19 Flags:
20 -p
21 Create VTK pointdata instead of VTK celldata (celldata is default)
22
23 -s
24 Create 3d elevation output with a top and a bottom surface, both
25 raster maps are required.
26
27 -m
28 Use g3d mask (if exists) with input maps
29
30 -o
31 Scale factor effects the origin
32
33 -c
34 Correct the coordinates to fit the VTK-OpenGL precision
35
36 --verbose
37 Verbose module output
38
39 --quiet
40 Quiet module output
41
42 Parameters:
43 input=name[,name,...]
44 G3D map(s) to be converted to VTK-ASCII data format
45
46 output=name
47 Name for VTK-ASCII output file
48
49 null=float
50 Float value to represent no data cell/points
51 Default: -99999.99
52
53 top=string
54 top surface 2D raster map
55
56 bottom=string
57 bottom surface 2D raster map
58
59 rgbmaps=string[,string,...]
60 Three (r,g,b) 3d raster maps to create rgb values [redmap,green‐
61 map,bluemap]
62
63 vectormaps=string[,string,...]
64 Three (x,y,z) 3d raster maps to create vector values
65 [xmap,ymap,zmap]
66
67 elevscale=float
68 Scale factor for elevation
69 Default: 1.0
70
71 dp=integer
72 Number of significant digits (floating point only)
73 Options: 0-20
74 Default: 12
75
77 Outputs G3D maps into VTK-ASCII format. Map's are valid G3D map's in
78 the current mapset. output is the name of a VTK-ASCII file which will
79 be written in the current working directory. If output is not speci‐
80 fied then stdout is used. The module is sensitive to region settings
81 (set with g.region).
82
84 This filter generates structured points with celldata (default) or
85 pointdata. If top and bottom surfaces are requested a unstructured grid
86 with celldata or a structured grid with pointdata is generated. This
87 data is put in a simple VTK-ASCII file. Neither XML nor binary output
88 are supported. It is possible to choose more then one G3D map to be
89 written in the VTK-ASCII file. Each celldata is named as the G3D map it
90 represents. You can visualize this file with the VTK Toolkit, Paraview
91 and MayaVi which are based on VTK. If you have a G3D map with partly
92 no data, use the threshold filter in paraview to visualize the valid
93 data. Just filter all data which is greater/lesser than the choosen
94 null value in the VTK-ASCII file.
95 The top and bottom region settings are expected in meters. If a Lati‐
96 tude-Longitude (LL) coordinates are used, the elevation value for each
97 voxel will be converted into degree.
98 The input, rgbmaps and vectormaps are optional, so only the geometry
99 can be exported.
100 If you use top and bottom and the 2d and 3d region settings are differ‐
101 ent, the 2d resolution will be adjust to the 3d resolution. The eleva‐
102 tion maps are expected in meters. If LL coordinates are used, the ele‐
103 vation will automatically converted into degree. If the surface and
104 bottom maps are in a different unit than meters, use the scale parame‐
105 ter to convert them into meters.
106 The RGB voxel data can be created from 2d raster maps (Landsat TM
107 images) with r.to.rast3. The values of the RGB maps must be within 0
108 and 255. If not, the values are automatically set to 0 and warnings
109 will be printed to stderr.
110 The vector data is created from three 3d raster maps. Each map repre‐
111 sents a vector component. So x, y and z components are required in
112 this order. This data can be visualized with Glyph3d or StreamTracer
113 filters within Paraview.
114 If the -c flag is used and the data should be visualised together with
115 other data exported via *.out.vtk modules, be sure the -c flag was also
116 set in these modules. But this will only work with data from the SAME
117 location (the reference point for the coordinates transformation is
118 based on the center point of the default region).
119
120 Difference between point- and celldata
121 r3.out.vtk can export G3D cells with different representations.
122
123 pointdata -- the cells/values are represented by the cen‐
124 ter of the cell. Instead of cells, points are created.
125 Each point can hold different values, but the user can
126 only visualize one value at a time.
127
128 celldata The cells are created with the same hight, width
129 and depth as in GRASS. Each cell can hold different val‐
130 ues, but the user can only visualize one value at a time.
131
133 Simple Spearfish example
134
135 g.region -d
136 g.region res=150 res3=150 t=80 b=0 tbres=10
137 r.mapcalc "bottom=1800. - elevation.10m"
138 # synthetic data, could be geological structures:
139 r3.mapcalc "map3d=row()+col()+depth()"
140 #export of volume to VTK:
141 r3.out.vtk -s input=map3d top=elevation.10m bottom=bottom out‐
142 put=/tmp/out.vtk
143 # visualize in paraview or other VTK viewer:
144 paraview --data=/tmp/out.vtk
145
146
147 Spearfish example with RGB data
148
149 #set the region
150 g.region -d
151 g.region n=4926970 s=4914857 w=591583 e=607793 res=50 res3=50 t=80 b=0
152 tbres=10
153 #create a bottom surface
154 r.mapcalc "bottom=1800. - elevation.10m"
155 # synthetic data, could be geological structures:
156 r3.mapcalc "map3d=row()+col()+depth()"
157 #get some satellite images with r.in.onearth
158 r.in.onearth -l output=Sat tmband=Red
159 r.in.onearth -l output=Sat tmband=IR1
160 r.in.onearth -l output=Sat tmband=IR2
161 #Convert the 2d maps to 3d raster maps with r.to.rast3
162 r.to.rast3 input=SatLandsatTM_Red output=SatLandsatTM_Red
163 r.to.rast3 input=SatLandsatTM_IR1 output=SatLandsatTM_IR1
164 r.to.rast3 input=SatLandsatTM_IR2 output=SatLandsatTM_IR2
165 #export of volume to VTK:
166 r3.out.vtk -s rgbmaps=SatLandsatTM_IR1,SatLandsatTM_IR2,SatLand‐
167 satTM_Red input=map3d top=elevation.10m bottom=bottom out‐
168 put=/tmp/out.vtk
169 # visualize in paraview or other VTK viewer:
170 paraview --data=/tmp/out.vtk
171
172
173 Spearfish example with vector data
174
175 # set the region
176 g.region -d
177 g.region n=4926970 s=4914857 w=591583 e=607793 res=50 res3=50 t=80 b=0
178 tbres=10
179 # create a bottom surface
180 r.mapcalc "bottom=1800. - elevation.10m"
181 # synthetic data, could be geological structures:
182 r3.mapcalc "map3d=row()+col()+depth()"
183 # synthetic vector data, could be groundwater stream vectors
184 r3.mapcalc "x_part =sin(row())"
185 r3.mapcalc "y_part =cos(col())"
186 r3.mapcalc "z_part =sin(depth())"
187 # export the stuff data to VTK:
188 r3.out.vtk -s vectormaps=x_part,y_part,z_part input=map3d top=eleva‐
189 tion.10m bottom=bottom output=/tmp/out.vtk
190 # visualize in paraview or other VTK viewer:
191 paraview --data=/tmp/out.vtk
192 # Now use the Glyph and Stream-Trace Filter to get nice vectors and
193 streamlines
194
195
196 Slovakia3d example
197
198 #reduce resolution:
199 g.region -dp3 res=1000 res3=1000
200 r.mapcalc "bottom=100"
201 #export of volume to VTK:
202 r3.out.vtk -s in=precip3d.500z50 top=dem500 bottom=bottom out=/tmp/slo‐
203 vakia3d.vtk
204 # visualize in paraview or other VTK viewer:
205 paraview --data=/tmp/slovakia3d.vtk
206 # set Display style to 'surface#
207 # set Actor Control z to 10
208
209
211 r.out.vtk
212 r3.out.ascii
213 g.region
214
216 Soeren Gebbert
217
218 Last changed: $Date: 2007-07-04 09:51:08 +0200 (Wed, 04 Jul 2007) $
219
220 Full index
221
222 © 2003-2008 GRASS Development Team
223
224
225
226GRASS 6.3.0 r3.out.vtk(1)