[vtkusers] newbie help with unstructured_grid vtk files

joshua reich josh at i2pi.com
Sun Dec 16 20:32:30 EST 2001


Hi,
I have a few sets of data files that I wish to convert to
vtk files. Basically, I have 2 file types, scalar and vector
fields.
My scalar fields are stored as :
x,y,z: scalar_value
The vector fields as:
x,y,z: Vx,Vy,Vz

Given that i dont have a regular density of (x,y,z), I assume
that unstuctured grid, with a cell_type of vtk_vertex is
what I want to use.. but I can't seem to get my head around
a few concepts. I have read the file format doc, but im a newbie
and all, so I figure I can ask a few basics of the list ;)

I guess my header should be something along the lines of :

# vtk DataFile Version 2.0
My Scalar Field
ASCII
DATASET UNSTRUCTURED_GRID
POINTS n+1 float	// n being the number of points in my field
x0 y0 z0
...
xn yn zn
CELLS n+1 size		// What is size for a list of verticies ?
1 i			// is i a reference to scalar value defined
...			// in the POINT_DATA section ?
1 i
POINT_DATA n+1
SCALARS my_scalars float 1
n+1 lines of scalar data..

this doest seem to be working. here is an example file i made..

# vtk DataFile Version 2.0
Stuff
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 8 float
0 0 0
1 0 0
0 1 0
1 1 0
0 0 1
1 0 1
0 1 1
1 1 1
CELLS 8 8
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
CELL_TYPES 8
1
1
1
1
1
1
1
1
POINT_DATA 8
SCALARS scalars float 1
LOOKUP_TABLE default
1
2
3
4
5
6
7
8


Thanks,

Josh.



-- 
joshua reich
i2pi.creative technology
Ph: +61 (0) 3 9415 9557
Mb: +61 (0) 408 355 788




More information about the vtkusers mailing list