Is there any Julia library which wraps the VTK library in such a way that both legacy and new vtk file formats can be read?
The top search item is “ReadVTK.jl”, which supposedly can read the new XML vtk file format, but not the legacy formats - I need to be able to do both.
You can use Python package meshio. I have a Julia wrapper FiniteMesh.jl built on top of it.
And it is correctly understood that even though it is based on Python, I don’t need to install anything directly? Just “using FiniteMesh” and then it should be fine?
Unfortunately does not work for me:
Only VTK 'UNSTRUCTURED_GRID', 'STRUCTURED_POINTS', 'STRUCTURED_GRID', 'RECTILINEAR_GRID' supported (not POLYDATA).
Didn’t think that POLYDATA would be any different
Thanks for the suggestion once again
Okay, then I would suggest the official vtk library for Python vtk · PyPI.
Then you will need to use PyCall or PythonCall.jl.
Doesn’t work either, returns:
ERROR: bad VTK file format (found legacy format; only VTK XML files are currently supported)
So properly due to it being a polydata legacy VTK file, not based on XML
Maybe you can load the file into Visit or Paraview and then ask to save again into the new format?
Yep, perhaps I can make a converter function which does it automatically for me in Paraview. Software I am using outputs legacy VTK format presumably because it was developed in ~2010 and a low priority to update
Thanks for the help everyone