Hi @GLuek
I’m not sure. Potentially there could be a bug in the check_tetrahedra.py or somewhere else. Visually, the 2 figures look like they are scaled by a factor of 10. If the black lines meet somewhere inside or on the surface of the tetrahedron, then the ratio should be calculated as 1. This is since the 6 element edges should have there element node volumes sum up to the volume calculated from the 4 nodes
Are the Gmsh algorithms deterministic, and always write out the elements in the same order?
It is possible that meshing algorithms have problems with numerical precision, if you use mesh lengths that are too big or too small. For example, this one is Windows specific:
https://onelab.info/pipermail/gmsh/2007/002408.html
I would recommend reading and writing files with full precision, which it appears that you are already doing.
Use mesh lengths that don’t cause issues. For example, if the meshing algorithm has some hard coded bias against numbers like 1e-10, or 1e-15, then consider using lengths on the order of 1 or .1 and then scaling at the end.
Are the STL, gmsh, and Tetgen files each written out in full precision? Looking at your repo, they seem ok to me.
That is a really cool idea using STL, which I have never attempted before. Can you add the contacts before sending them to Tetgen?
Are you able to change the characteristic lengths in Tetgen so that the more tetrahedra are being used?
I can send you a tetgen input file that can create a good 3d block. However, it may depend on sizes you choose.
I am about ready to share with you an old tetgen example I used in a publication. I hope to have it up in a few hours, but it appears that my calculation of actual tetrahedral volume is giving weird results on macOS, but not Linux. I need to check if this is occuring on windows as well.