Draft: support vtk files generated from Gmsh - #1547
Conversation
Why I'm not confident this is correctA few years ago I made a napari plugin that wraps the meshio library: https://github.com/GenevieveBuckley/napari-meshio/ However, when I do that and try to open the Gmsh .vtk file with the napari plugin:
RuntimeError: All attributes must have the same size, got:
<VertexBuffer size=25532 last_dim=1>: 25532
<VertexBuffer size=19149 last_dim=3>: 19149
<VertexBuffer size=0 last_dim=3>: 0
<VertexBuffer size=25532 last_dim=3>: 25532I know this isn't a napari related project, but it does cast doubt on whether the proposed fix in this branch is actually correct. To figure out if the problem is:
Alternatively, a round trip test inspecting all the vertexes and surface information of the mesh before and after the round trip could also work (but I don't have the .geo code used to generate that example Gmsh .vtk file originally, and might have to create a new example). This might be the limit of the time I have available to work on this, but I wanted to put what I had so far in writing. Perhaps someone else can push it further along. |
Closes issue #1544
Possibly related to GenevieveBuckley/napari-meshio#4 ?
I had a go at addressing issue #1544. I am confident that commit 8c42f167ea2379570bce046548c1ddbcba2bcee0 is correct, but I am not confident about the rest, and whether the overall result is correct.
Details
I used the example file suggested in issue #1544:
This mesh can be displayed in Paraview:

When you checkout this PR branch:
and read in the example Gmsh .vtk file:
You get this summary output:
So everything seems to work ok so far, although I am not sure if this is the expected output.
To confirm whether it's working correctly, I would really like to load the mesh from meshio, into a visualization program to look at it. Then we could see if it looks like the original input or not.