wildmeshing / fTetWild

Fast Tetrahedral Meshing in the Wild
https://yixin-hu.github.io/ftetwild.pdf
Mozilla Public License 2.0
380 stars 76 forks source link

output seems error when input an multi-material surface mesh(diffirent material share an interior face) #69

Open xmyhhh opened 3 months ago

xmyhhh commented 3 months ago

hi~ thanks for sharing your work However , I meet some trouble when trying with my mesh

The mesh input I used is a multi-layered geologic body, as shown in the image below, which has five layers in total, stacked like a hamburger (meaning five materials from top to bottom, shareing four inner surface).

image

for surface outside, I adjust the normal to point the outside domain, for shareing surface inside, I adjust the normal to point the mesh center reversed as shown in the image below

image

The problem is, there is some tet is missing inside my input mesh and some pop outside my input mesh,as shown in the image below(green are my input mesh edge and blue are output mesh edge)

1706868297351 1706868919796

the command I use is "FloatTetwild_bin.exe --input domain_merge.off --output domain_merge_out.mesh" I also attach my input file here for debug purpose if someone need! download link

xmyhhh commented 3 months ago

After a few days of study, I found a problem related to the "winding number".

  1. The reason for the missing tet is the threshold of the "winding number" (default is 0.5), and if the "winding number" of the tet's barycenter is less than the threshold, this tet will be removed!

  2. The reason for the wrong external tet is that the "winding number" of the external points may be positive when the mesh has inner surfaces! (winding number of inner surfaces cannot be counteracted! also see Jacobson's paper "Robust Inside-Outside Segmentation Using Generalized Winding Numbers" figure 8 middle)

show as figure

image

I think for multi-material mesh, the calculation of the "winding number" should be careful! Rather than using a threshold rudely