# Error reading PolyData VTKHDF file

**URL:** https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834
**Category:** ParaView Support
**Created:** [January 31, 2024, 12:12pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834 "2024-01-31T12:12:19Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [January 31, 2024, 12:12pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/1 "2024-01-31T12:12:19Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 31, 2024, 12:39pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/2 "2024-01-31T12:39:26Z")

</div>

@Lucas_Givord @danlipsa

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [January 31, 2024, 12:50pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/3 "2024-01-31T12:50:26Z")

</div>

Hi @Juan_Jose_Casafranca,

I’m afraid that these groups are mandatory, so you need to define the structure for each `CellCategory`([doc](https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#poly-data)) like in this data:

[HDFWriter\_cow.vtp.vtkhdf](https://discourse.paraview.org/uploads/short-url/urGNolRBE0cBry6SXByWZaL89sC.vtkhdf) (168.5 KB)

 ![image](https://discourse.paraview.org/uploads/default/original/2X/6/64a694659b850cdc16eedbb879b87eaf30d6d1b2.png)

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [January 31, 2024, 12:54pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/4 "2024-01-31T12:54:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [January 31, 2024, 12:55pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/5 "2024-01-31T12:55:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 31, 2024, 12:59pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/6 "2024-01-31T12:59:11Z")

</div>

This is not the right way to do that imo.

@Lucas_Givord should we consider making the groups optional ?

---

<div class="post-metadata">

### Author: ![Juan\_Jose\_Casafranca](https://discourse.paraview.org/user_avatar/discourse.paraview.org/juan_jose_casafranca/32/3499_2.png) [@Juan\_Jose\_Casafranca](https://discourse.paraview.org/u/Juan_Jose_Casafranca)
#### Post date: [January 31, 2024, 1:03pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/7 "2024-01-31T13:03:47Z")

</div>

Note that making them optional might break TransientData:

```auto
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.

```

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [January 31, 2024, 1:07pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/8 "2024-01-31T13:07:10Z")

</div>

> 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](https://github.com/marts/hdf5view), 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 ?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 31, 2024, 1:20pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/9 "2024-01-31T13:20:24Z")

</div>

Sounds good to me

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [January 31, 2024, 1:32pm UTC](https://discourse.paraview.org/t/error-reading-polydata-vtkhdf-file/13834/10 "2024-01-31T13:32:42Z")

</div>

done [https://gitlab.kitware.com/vtk/vtk/-/issues/19238](https://gitlab.kitware.com/vtk/vtk/-/issues/19238)
