meshio
meshio copied to clipboard
vtp support attempt
Starting from the vtu implementation I am working through adding vtp support.
Current status: WIP starting with reading, currently I am arbitrarily add the cell types that mimics the vtu description, but does not yet handle the triangle strips.
Suggestions or things to make it better are welcome.
hopefully can resolve #527
I have done some ad hoc testing and was able to read a .vtp file with only triangle strips and get out a .vtu that looks correct. I was also able to go from .vtp with vertex, lines, triangle strips to a vtp wiith vertices, lines, and polygons, but the .vtu output appears garbled.
I will need to read the development guide about adding tests and getting everything else up to snuff, but currently content with progress made.
Found my logic mistakes in the reader and wrong indentation in the writer. It appears to be working for me now. Still need to add some tests.
adding simple tests, need to rethink the polys section. should I read the polys section and then separate them into triangles, quads, and polygons?
the current implementation merges triangles, quads, and polygons into polygons on write. The read process specifies the cell types into the same triangles, quads, and polygons.
Currently meshio doesn't support triangle strips, and I am not sure there is a reason to do so. this means that on read triangle strips get converted to triangles, which become polygons on write to vtp.
This means that any cell dell data from triangle strips gets duplicated for the decomposed triangle strips.
I forgot to commit the test files. they made need a little tweaking as I simply used the vtu files and applied the extract surface mesh in paraview and exported the vtp files. they all have uint64 headers, so 00_raw_binary.vtp
and 01_raw_binary_int64.vtp
might be redundant.
@nschloe Would it make more sense to derive a new package that contains format extensions rather than include it in meshio?
does anyone have any thoughts or feedback on this effort?
meshio has support for polygons, so I'd say it makes sense to have it in meshio.
Thank you for the input. tests appear to be passing now. More tests might be good and/or making better binary files tests.
Currently I have the reader generating a warning when it finds strips, not sure if that is what makes sense, but certainly better than silence.
What are the codecov checks checking?
Coverage
Can you attach the test files here so I can download them, please?
@nschloe any feedback on this?
Sorry, too much work right now.
Thank you for the update. A kofi is coming your way as soon as I remember how to do it.
I rebased, squashed, and included some matching changes from the vtu reader/writer. tests passed locally for me.
@nschloe would mind running the workflow to see if it passes?
I added more tests to bump up the code coverage.
Hey not sure if this is a welcome bump but I was just wondering what the status of a possible VTP writer. I'm using VTK in Anaconda and the AVS-UCD read function is broken right now AFAIK so I'd like to switch to this but need VTP.
I know python and have LOTS of UCD, VTK, and VTP files to test things with, so if I can help, maybe throw me a bone or I'll try to see how I can help when I get a bit more free time next week?