huxingyi / isotropicremesher

Isotropic Remeshing of Triangulated Surface
MIT License
82 stars 9 forks source link

Too small triangle facets created after remeshing #2

Open yvanblanchard opened 1 year ago

yvanblanchard commented 1 year ago

Hello, I have a simple test case, and after remeshing (with smaller target edge length), I get some small triangle facets (with bad aspect). I expected to get uniform edge legnth in the resulting mesh.

Before: image

After remeshing: image

Initial edge length: 3.5mm (about) Target edge length: 2mm Nb iterations: 5

yvanblanchard commented 1 year ago

remeshing-test.zip

huxingyi commented 1 year ago

Thanks for the feedback, currently, boundary vertex are fixed, so it will not looking good on boundary vertex connected edges, need improve on this case.

yvanblanchard commented 1 year ago

Ok thank you. Yes, indeed I can get a good result with MeshLab remesher filter. I hope your lib could do something similar.

yvanblanchard commented 1 year ago

Do you plan to do the appropriate code changes ? Or could you please indicate how to achieve that (where in the code). Thanks

huxingyi commented 1 year ago

The code change should be related every place access of oppositeHalfedge, a null check is needed to see if it's boundary. Currently all the boundary vertex are been featured, that means all cases ignored the boundary vertex. Let me check if it's an easy fix, if it is, I should be able to commit the change in a few days.

huxingyi commented 1 year ago

Did a quick fix, should be better than before. Will do more experiment if I got time.

yvanblanchard commented 1 year ago

Thank you very much !

xiaolong7 commented 1 year ago

Hello, I did a test on a surface mesh with a boundary. If the initial mesh is sparse and remeshed to have more triangles, the library works well, as follows. It looks like the boundary vertices are not fixed in this case and the surface boundary changes a bit after remeshing, compared with the original surface boundary. Initial sparse mesh: sparse_initial Final mesh: sparse_final

If the initial mesh is dense and remeshed to have fewer triangles, the boundary elements are not good, as shown below. Do you have any idea why that happened? It looks like the boundary vertices are fixed in this case and the original surface boundary is preserved after remeshing. Initial dense mesh: dense_initial Final mesh: dense_final

Are the boundary vertices always fixed in the current implementation? Is it possible to provide an option to the user to choose whether the original boundary vertices are fixed or not during the remeshing process?

If I would like to preserve the original surface boundary as much as possible, can the current library can achieve this property during remeshing? I appreciate your time and help.

test.zip

huxingyi commented 1 year ago

Should have a proper handling for the bounday edge resizing before the whole remesh process which is currently missing.

Possible TODO:

xiaolong7 commented 1 year ago

Should have a proper handling for the bounday edge resizing before the whole remesh process which is currently missing.

Possible TODO:

  • Break long edge of bounday to target edge size (Currently implemented, and should be fine)
  • Stich short edges of boundary to make the edge size reach the target edge size (Missing feature)
  • Fix all the boundary edges (Which is broken after my last commit: 21b1441, should disable movement of all the boundary vertices)

Thank you very much for your prompt reply and suggestions. If possible, could you please help to implement the stitching feature?

huxingyi commented 1 year ago

I am not sure if I will do it in the near future but I can give some insights on how to do that at the moment:

xiaolong7 commented 1 year ago

Thank you for your suggestions. What if two boundary edges with length smaller than the target edge length but they are not colinear (straight)? Just leave them as they are? or do you have any other strategies to deal with them?

huxingyi commented 1 year ago

I would suggest based on some angle priority to pick which one to collapse, so that we can keep most of the features of the boundary when we are averaging the edge size of the boundary.

xiaolong7 commented 1 year ago

Thank you for your suggestion!