Error reading PolyData VTKHDF file

I am trying to read a VTKHDF file storing a PolyData dataset. However, is complaining that I haven’t defined the Vertices, Lines and Strips groups. I only want to represent the polygons, so I dont really need Vertices, Lines or Strips. Is it possible to store only the Polygons?

@Lucas_Givord @danlipsa

Hi @Juan_Jose_Casafranca,

I’m afraid that these groups are mandatory, so you need to define the structure for each CellCategory(doc) like in this data:

HDFWriter_cow.vtp.vtkhdf (168.5 KB)

Okay, fair enough. Since all my cells are triangles, I think I might just use an UnstructuredGrid and compress the Types group.

May I ask which viewer you are using fot the VTK file? That looks nicer than hdfview!

This is not the right way to do that imo.

@Lucas_Givord should we consider making the groups optional ?

Note that making them optional might break TransientData:

CellOffsets [dims = (NSteps, NTopologies)]: each entry indicates by how many cells to offset reading into the connectivity offset structures for the associated time step (relevant for Unstructured Grid and Poly Data).

Unstructured Grids only have one set of connectivity data and NTopologies = 1.

Poly Data, however, have Vertices,Lines, Polygons and Strips in that order and therefore NTopologies = 4.

ConnectivityIdOffsets [dims = (NSteps, NTopologies)]: each entry indicates by how many values to offset reading into the connectivity indexing structures for the associated time step (relevant for Unstructured Grid and Poly Data).

Unstructured Grids only have one set of connectivity data and NTopologies = 1.

Poly Data, however, have Vertices,Lines, Polygons and Strips in that order and therefore NTopologies = 4.

May I ask which viewer you are using fot the VTK file? That looks nicer than hdfview!

I use this one GitHub - marts/hdf5view: Simple Qt/Python based viewer for HDF5 files, I like it because its simpler than hdfview, however, it does not have as much functionality as hdfview.

This is not the right way to do that imo.

We can change that ofc and make it optional but as Juan say it, it will also impact Transient support for PolyData as we do some assumptions when we compute the cell offset.

We can open an issue on gitlab and ping other developers, wdyt @mwestphal ?

Sounds good to me

done https://gitlab.kitware.com/vtk/vtk/-/issues/19238

1 Like