I’m trying to write a legacy VTK file for an unstructured tetrahedral grid. All of the VTK documentation I can find suggests that the cell linkage block should have a header as follows
CELLS <# cells> <total number of points in all cells + # points in each cell array>
e.g.
CELLS 2233592 11167960
4 51509 26695 53716 54650
4 225124 286911 289432 347607
If I do that with a VTK header of # vtk DataFile Version 5.0
I get an error on import to Paraview
ERROR: In vtkDataReader.cxx, line 3335
vtkUnstructuredGridReader (0x6a6e0480): Error reading cell array offset header.
If I change the VTK header to # vtk DataFile Version 3.0 the file loads correctly
Taking some hints from the xml format documentation and AI I tried changing the cell header line to
CELLS <# cells>
e.g.
CELLS 2233592 8934368
51509 26695 53716 54650
225124 286911 289432 347607
but that just gave me the same array offset read error.
All but one of the example Unstructured grid VTK files in the PV download are for Version <=3. The one example with Version 5 is binary. If I import it and export to ascii from PV it looks like I’m missing the OFFSET and CONNECTIVITY arrays but the CELLS line format looks like it should be
CELLS <# cells+1>
It also appears that if you have n cells then you have n+1 elements in the OFFSET array?
so the CELLS header format could be
CELLS
What is the correct syntax for V5.0 files, please? Better still can someone point me to a VTK file format manual which describes it, preferably with an example.
Also it appears that Paraview is limited to 256 characters on a line in an ASCII VTK. Is that a VTK limitation of one imposed by the Paraview reader?