VTK XML format and data type specific variants

Does anyone know why do separate VTK-XML file extensions exist? For Legacy VTK files, we have .vtk which suffices to write all supported VTK data types. For VTK-XML, we have different variants .vtp for poly-data, .vtu for unstructured grid etc. Any reason why that was done? It would be easier to just have .vtx (and maybe .pvtkx, the parallel variant) file extension that supports all known VTK dataset types. Is there something I am missing?

For vastly different data types, such as mesh and image, using a different file extension makes a lot of sense.

For example, I want to use a different default viewer for meshes and images, but file association is based on file extension.

Using different file extensions also allows simple, early filtering. Most applications only support certain type of VTK files (surface mesh, volumetric mesh, or image) you don’t want to allow them to select (or even worse, upload) files and then display an error message that sorry, I cannot work with this kind of vtk files.

We often have problems when users report problems with .vtk files, as we don’t know what kind of data they have, and they don’t know what is the difference between a surface mesh, an unstructured grid, and a structured grid. There is no such problems with .vtX files.

1 Like