huxingyi / isotropicremesher

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

fix boundary vertices without introducing additional vertices #4

Open xiaolong7 opened 1 year ago

xiaolong7 commented 1 year ago

Hi, this is not an issue of the code but a question that I hope you could help to point me to the right direction. I want to have a final mesh that has exactly the same boundary vertices as in the original mesh without any additional or missing vertices on the boundary. I am wondering if it is possible to achieve this by just making edits on few lines of the code? It would be great if that's possible and if you could point me to the part of code that needs to be edited. Thank you for your time and help!

huxingyi commented 1 year ago

Add the following check

https://github.com/huxingyi/isotropicremesher/blob/d4674ce63288d7a55a70735181049895aebc3bf7/src/isotropicremesher.cpp#L195

before breaking the edge

https://github.com/huxingyi/isotropicremesher/blob/d4674ce63288d7a55a70735181049895aebc3bf7/src/isotropicremesher.cpp#L164

xiaolong7 commented 1 year ago

Add the following check

https://github.com/huxingyi/isotropicremesher/blob/d4674ce63288d7a55a70735181049895aebc3bf7/src/isotropicremesher.cpp#L195

before breaking the edge

https://github.com/huxingyi/isotropicremesher/blob/d4674ce63288d7a55a70735181049895aebc3bf7/src/isotropicremesher.cpp#L164

Thank you for your suggestion! I have made the following change according to my understanding of your suggestion, but there are still some additional vertices on the boundary of the final mesh. Does the change I made follow your suggestion? image

xiaolong7 commented 1 year ago

It works after I changed the condition to if (!halfedge->startVertex->_isBoundary && !nextHalfedge->startVertex->_isBoundary). Thank you!

huxingyi commented 1 year ago

You are right, the boundary vertices are not featured before the long edge splits, so should use the boundary check directly.