BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.87k stars 128 forks source link

size adaptation #35

Closed xiaolong7 closed 2 years ago

xiaolong7 commented 2 years ago

Hello, I tried the size adaption (from 0 to 1) of the remeshing algorithm while setting the anisotropy parameter as 0. When the size adaptation approaches 1, the resulting mesh has some strange dense distribution of triangles in some region, highlighted by the red circle in the below screenshot. The background color indicates the surface curvature. The curvature in the highlighted region is similar to the surrounding in the horizontal direction but has very dense mesh distribution. Do you have any idea why this happened or suggestions about how to mitigate it? Thank you!

image

BrunoLevy commented 2 years ago

Hi, would you share your input mesh ?

xiaolong7 commented 2 years ago

Hi, would you share your input mesh ?

Here it is. Thank you for looking into it. I have tried setting the target number of points after remeshing as 2600 or 5000 with tri_size_adapt=1, tri_shape_adapt=0, and default values for other parameters. Both gave something similar o that shown in the above figure in some region close to the boundary. test.zip

xiaolong7 commented 2 years ago

Hi, if I understand it correctly, the size adaptation in the remehshing algorithm right now considers the curvature of the surface. Is it possible for the size adaptation to also consider the curvature of surface boundary (non-closed surface), such as the below example of a surface mesh? image

BrunoLevy commented 2 years ago

Pushed a "quick an dirty fix": image (will not solve the problem in all cases though). The problem comes from the way I am estimating Local Feature Size, uzing poles (a subset of Voronoi vertices), and sometimes one of the poles is very near the surface, making the mesh much denser around this spurious pole. For now I have just limited the magnitude of the sizing field. This will require deeper investigations ...

BrunoLevy commented 2 years ago

Regarding the second question (sizing field adapted to the border), you can use remesh_smooth() with your own sizing field, for instance, something like what's described in this article

xiaolong7 commented 2 years ago

Pushed a "quick an dirty fix": image (will not solve the problem in all cases though). The problem comes from the way I am estimating Local Feature Size, uzing poles (a subset of Voronoi vertices), and sometimes one of the poles is very near the surface, making the mesh much denser around this spurious pole. For now I have just limited the magnitude of the sizing field. This will require deeper investigations ...

Thank you for looking into it and your suggestion!