BrunoLevy / geogram

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

surface boundary shrinkage after remeshing #29

Closed xiaolong7 closed 2 years ago

xiaolong7 commented 2 years ago

Hello, I tried the isotropic remeshing algorithm (tri_size_adapt=0, tri_shape_adapt=0) on a surface mesh with boundary and found that the surface boundary shrinks after remeshing, as shown in the below screenshot. Do you have any idea why that happened? Is there any way to preserve the original surface boundary as much as possible? Thank you!

image

BrunoLevy commented 2 years ago

Yes, it is due to the remeshing method that I'm using (Voronoi Parallel Linear Enumeration), that places the points in such a way that it optimizes the sampling of the shape (w.r.t. a certain measure of optimality), and this optimal sampling does not necessarily have the points on the surface.

To mitigate this, it is necessary to reproject the points onto the initial surface. It will be supported in v1.8.2. A release candidate will be pushed soon (within a couple of weeks the latest)

xiaolong7 commented 2 years ago

Yes, it is due to the remeshing method that I'm using (Voronoi Parallel Linear Enumeration), that places the points in such a way that it optimizes the sampling of the shape (w.r.t. a certain measure of optimality), and this optimal sampling does not necessarily have the points on the surface.

To mitigate this, it is necessary to reproject the points onto the initial surface. It will be supported in v1.8.2. A release candidate will be pushed soon (within a couple of weeks the latest)

Got it. Thank you!

BrunoLevy commented 2 years ago

On its way, see this thread. We'll see whether this works (and now we have non-regression tests to make sure I'm not going to break anything). If it works it will be in v1.8.2.

BrunoLevy commented 2 years ago

image Nearly there it seems !!

BrunoLevy commented 2 years ago

Pushed it ! Would you test and tell me ?

xiaolong7 commented 2 years ago

Pushed it ! Would you test and tell me ?

I tried it and it has improved a lot! Thanks a lot! image