marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.05k stars 266 forks source link

Loading TetMesh in v2023.0.5 #977

Closed RobinEnjalbert closed 12 months ago

RobinEnjalbert commented 12 months ago

Hi @marcomusy,

Thanks for the new release, I am currently going through the changes in my personal code base.

I found that is it no longer possible to create a TetMesh like so:

mesh = vedo.Mesh('tetra_mesh_file.vtk')

I liked being able to create any mesh - in this case tetra meshes - from a unique class Mesh.

In the previous version, if the mesh was loaded from a file, the mesh type was checked to see if it is a TetMesh (here in the code). I wonder why this disappeared in the new version ? Do we have to create a TetMesh only from this class ?

marcomusy commented 12 months ago

Hi @RobinEnjalbert yes that was removed because I think it was "too automatic".. polygonal meshes and tet-meshes are very different objects. So in your code it should become mesh = vedo.TetMesh('tetra_mesh_file.vtk').tomesh().

RobinEnjalbert commented 12 months ago

Thanks !