meshio icon indicating copy to clipboard operation
meshio copied to clipboard

vtp support attempt

Open kayarre opened this issue 2 years ago • 19 comments

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

kayarre avatar Sep 17 '21 17:09 kayarre

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.

kurtsansom avatar Sep 21 '21 13:09 kurtsansom

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.

kayarre avatar Sep 22 '21 04:09 kayarre

adding simple tests, need to rethink the polys section. should I read the polys section and then separate them into triangles, quads, and polygons?

kayarre avatar Sep 22 '21 05:09 kayarre

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.

kayarre avatar Sep 28 '21 12:09 kayarre

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.

kayarre avatar Oct 04 '21 21:10 kayarre

@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?

kayarre avatar Oct 15 '21 00:10 kayarre

meshio has support for polygons, so I'd say it makes sense to have it in meshio.

nschloe avatar Oct 15 '21 09:10 nschloe

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.

kayarre avatar Oct 17 '21 02:10 kayarre

What are the codecov checks checking?

kayarre avatar Oct 17 '21 17:10 kayarre

Coverage

nschloe avatar Oct 17 '21 18:10 nschloe

Can you attach the test files here so I can download them, please?

nschloe avatar Oct 17 '21 18:10 nschloe

Apologies for taking so long to respond.

vtp_testfiles.tar.gz

kayarre avatar Oct 29 '21 20:10 kayarre

@nschloe any feedback on this?

kayarre avatar Dec 02 '21 17:12 kayarre

Sorry, too much work right now.

nschloe avatar Dec 02 '21 17:12 nschloe

Thank you for the update. A kofi is coming your way as soon as I remember how to do it.

kayarre avatar Dec 02 '21 17:12 kayarre

I rebased, squashed, and included some matching changes from the vtu reader/writer. tests passed locally for me.

kayarre avatar Dec 21 '21 16:12 kayarre

@nschloe would mind running the workflow to see if it passes?

kayarre avatar Dec 28 '21 19:12 kayarre

I added more tests to bump up the code coverage.

kayarre avatar Feb 02 '22 16:02 kayarre

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?

kshunterco avatar Feb 23 '23 00:02 kshunterco