VTK supports dataset attributes defined in vtkDataSetAttributes that can be used to mark certain point and cell arrays as “special” arrays, such as Scalars, Normals, Global ids, etc.
Currently, the VTKHDF specification does not support marking arrays as such. We propose an addition to the VTKHDF format to support this VTK feature.
VTK DataSet Attributes will be marked as a string HDF5 attribute called “Attribute” on the HDF5 Dataset for the array.
From h5py, you could easily add an VTK attribute to an array this way:
file["VTKHDF/PointData/Normals"].attrs["Attribute"] = "Scalars"
We make the assumption that an array can only have a single attribute attached to it. We raise an error when multiple arrays of the same type (Point or Cell) share the same attribute.
Possible attributes will be (case insensitive): SCALARS, VECTORS, NORMALS, TCOORDS, TENSORS, GLOBALIDS, PEDIGREEIDS, EDGEFLAG, TANGENTS, RATIONALWEIGHTS, HIGHERORDERDEGREES, PROCESSIDS.
Related VTK issue: Issue: https://gitlab.kitware.com/vtk/vtk/-/issues/19192