[Paraview] VTK XML binary file format

Peter Bastian Peter.Bastian at iwr.uni-heidelberg.de
Wed Jan 11 11:13:18 EST 2006


Hi all,

I am trying to write VTK XML unstructured grid files (.vtu) by myself
(i.e. without using vtkXMLUnstructuredGridWriter). Ascii works fine but
binary makes problems. I followed the instructions given previously on
this list, i.e. I use inline DataArrays, put the size of the data in
front of the block and encode everything base64.

Now there are two problems:

1) The "offsets" array causes an error when reading:

peter at cray:~/FE/dune-dd$ paraview
ErrorMessage
# Error or warning: There was a VTK Error in file:
/home/amy/ParaViewReleaseRoot/paraview-2.4.1/VTK/IO/vtkXMLUnstructuredDataReader.cxx
(592)
 vtkXMLUnstructuredGridReader (0x8dfacb0): Cannot read cell connectivity
from Cells in piece 0 because the "offsets" array is not monotonically
increasing or starts with a value less than 1.
ErrorMessage end

When I write only the offsets array in ascii, the file is read without
error message. This is curious because all the writing is done by one
class in my code. I also checked the encoded binary data and it looks OK.

2) Loading the file with all in binary except the "offsets" array, the
point data as well as the cell data and the point positions are not correct.

Now my question:

Is there some further undocumented magic (like the size in bytes at the
beginning) that I have to consider?

I would prefer to write VTK files without linking in VTK itself.
In the attachment I append binary and ascii versions of my file.

Thanks for any response.

-- Peter
------------------------------------------------------------------
Peter Bastian, IWR,Uni Heidelberg, INF 348,R 020, 69120 Heidelberg
email: Peter.Bastian at iwr.uni-heidelberg.de   Tel: +49 6221 54 4984
WWW: http://www.iwr.uni-heidelberg.de/~Peter.Bastian Fax: ... 8860

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ascii.vtu
Type: text/xml
Size: 1565 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/paraview/attachments/20060111/f7451859/test.ascii.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.binary.vtu
Type: text/xml
Size: 1950 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/paraview/attachments/20060111/f7451859/test.binary.bin


More information about the ParaView mailing list