Closed XushanLu closed 3 years ago
Hi - sorry for the late reply, I can read your file as an unstructured grid, are you sure it's a tet mesh?
from vedo import *
# Create a TetMesh object form the vtk file
# tet_sgi = TetMesh('data/test_best_cond.vtu')
tet_sgi = UGrid('data/test_best_cond.vtu')
rec_cond = tet_sgi.tomesh().lineWidth(5).lineColor('w')
show(rec_cond, axes=True, bg='bb')
Sorry, I missed your reply!
Well, I now realize that it is not a tetmesh. It is simply just a bunch of nodes connected into triangles. Does that matter?
Yep, when you are loading it with TetMesh()
it tries to force it to be a tet mesh and this triangulation step seems to be failing (i'm not exactly sure why though)
Is there anything in vedo that can deal with just triangulations?
Yes there is a tetralize()
function, which might turn useful.
I finally realized what I was looking for was UGrid instead of TetMesh. Also, that tetralize function does not work because it complains that I am passing in a vtkVolume object. I am happy again with what I am able to plot with vedo. Thanks!
Hi @marcomusy,
Here I am again asking for help.
I encountered a strange vtk error while trying to read in a vtu file and then convert that into a mesh object in vedo. Here is the simple reproducible script:
And here is the data file: test_best_cond.vtu.zip
I think the error was raised when I tried to convert tet_sgi to a mesh object:
I am not sure what may be causing this and I apologize first if you find my way of doing things strange. I am so used to deal with vtu files and we have a bunch of tools that can be used to generate and manipulate vtu files. Having said that, this can easily be a problem with the vtu file format since this time I manually created the file.
This can also be a vtk bug but I am not sure. I tried to look into the vtk codes but could not really go too far: https://github.com/Kitware/VTK/blob/master/Common/Core/vtkLookupTable.cxx (line 165).
Or, is this something related to vedo?
Thanks very much for your help!