Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Holes in mesh-surface when using lloyd or odt optimization on labeled images
Chronological Thread
- From: Sebastian Bachmann <>
- To:
- Subject: Re: [cgal-discuss] Holes in mesh-surface when using lloyd or odt optimization on labeled images
- Date: Mon, 2 Jun 2025 14:18:22 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-data: A9a23:5w9ZKKCzzff8uhVW/zfnw5YqxClBgxIJ4kV8jS/XYbTApDhwhjIFn DEZUT+PPvrbYmegfdtzaNzn9x5V78SHz95rOVdlrnsFo1Bi+ZOUX4zBRqvTF3rPdZObFBoPA +E2MISowBUcFyeEzvuVGuG96yM6j8lkf5KkYMbcICd9WAR4fykojBNnioYRj5Vh6TSDK1rlV eja/YuGZjdJ5xYuajhJs/zb8ks21BjPkGpwUmIWNagjUGD2zCF94KI3fcmZM3b+S49IKe+2L 86rIGaRows1Vz90Yj+Uuu6Tnn8iGtY+DiDS4pZiYJVOtzAZzsAEPgnXA9JHAatfo23hc9mcU 7yhv7ToIesiFvWkdOjwz3C0usyxVEFL0OavHJSxjSCc50/hU3Lo39BBNngJIs5Hpcp7BEsS1 tVNfVjhbjjb7w636Le6RuZlnMhlNsTsLMUWphmMzxmAUqhgENacE+OTvocwMDQY3qiiGd7ea s4dbhJ1YRPQJRRTUrsSIMtnw7b53CimL1W0rnqKm7pn2mLr3DVtzZzsMoXUX/auG/lsyxPwS mXupjqnXk9y2Mak4TGK+3bpiu7Ulj7gQ6oJBbig/7hrhkeSzyodEnUruUCTpPi1hUekV5RFJ ksEvCMyxUQvyKC1ZtvafxS8vFurhCcjRJkPTME27SvR6YOBtm51GVM4ZjJGbdUnsuo/Sjory kKFkrvV6dpH4Of9pZW1pu/8kN+iBRX5O1PucgcoYGM4DzTLpYA/gRvVQpB5HamlyNTpcd0R/ 9xohHNn71nwpZdVv0lewbwgq27Em3QxZlRpjjg7p0r8hu+DWKarZpaz9X/Q5utaIYCSQz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wJlkNatAavnwEkUU WvlepokAS5779lueFPK3nrp74j4ed7WJdsNvxyQmh3EgqBbMpU03vYNgCNmPyr6sxhHg6Yji gdy2JihoIWdA2Bs8K2wGBIeLDDyd4Ua5nCljKpTmNqXw5H6HphlHWZuPtOgRvapHTQO8PX/Y l/RTntt7CjLX+OERVz6ig8utX/EHpG1OmvCIXAYyY4nXxyBPAlEhxhSWjwmn5k/HwTsxcr7c U4/6CpCgzyw4hZK1O9sMAHyF2nFowL9IDc5TJyYBABb6REE7lufYqn8pqpjWjpV+JGstlnHM muAewFBFn0EQGSBBlzsN6Oio8PN9PjeD/b0fJ6sKf2e7OdZUfmP35em1IBrqi2NOsu4NX5nF /Qn20BHUBiR/uzDljIfDSULxXqlhyGzvhq76mt+spLmmBwKcAfu6YSGEbcUK9ho61a/nfXbX 9M=
- Ironport-sdr: 683d9691_iOUeOfV03KA93Cqp5DO7RW0VdeNyYo1H3EMIAgRUVHdgQXN RetU+hFDL4FzZE8oghxxgD4gefXE3ujQP6VgQCA==
Hello,
Yes, I was using exactly that code, but it is depending on the random number generator. I had to run it several times until such a hole would appear. I tried again now, and it took me 6 attempts.
I have uploaded a new version where I patched initialize_triangulation_from_labeled_image to use a specific random seed. In my case, 1234 triggered the problem.
I'm using Debian Bookworm.
Best,
Sebastian
Am 19.05.2025 um 09:00 schrieb Sebastien Loriot ( via cgal-discuss Mailing List):
Hello,
when running you minimal example I don't have the "holes" you are
having. I'm also using CGAL 6.0.1. What platform are you on?
Are you really using that example or a modified version?
Best,
Sebastien.
On 4/28/25 10:54, Sebastian Bachmann ( via cgal-discuss Mailing List) wrote:Hello!
Anyone has an idea what could cause that?
In like 95% of meshes I create I do not have that problem, but once in a while this turns up and is annoying...
It seems to be more often the case, when more than two labels are used (i.e, 0, 1 and 2 and not just 0 and 1).
Anything that I could test will definitely help me :)
Best,
Sebastian
Am 18.02.2025 um 09:06 schrieb Sebastian Bachmann ( via cgal-discuss Mailing List):Hi!
Sure, here is an example: https://files.reox.at/.mesh/
You may have to run it several times until such a hole appears, as no optimization is present. However, you can make them appear much easier by changing the line with refine_mesh_3 to:
CGAL::refine_mesh_3(c3t3, domain, criteria, CGAL::parameters::odt());
ODT seems to be more prone than Lloyd.
I uploaded two surface.off files as well, where this can be seen (surface.off is without odt/lloyd and the second run, surface_odt.off is with ODT active).
Best,
Sebastian
Am 17.02.2025 um 11:34 schrieb Jane Tournois:
Hello,
can you please post some code and data so that we can try to reproduce your issue?
Best,
Jane
Le 07/02/2025 à 16:30, Sebastian Bachmann ( via cgal- discuss Mailing List) a écrit :Hi!
I send this mail to the list yesterday, but apparently it was not posted - but I also did not get a rejection mail? I suspect that attachments are not allowed and get silently dropped?
So here it is again with a link instead, sorry if it is now posted twice!
I extended the example code from mesh_3D_image_with_custom_initialization.cpp to mesh a multi-label 3D image, i.e., I have for example 3 voxel values: 0 (background), 1 (some part), and 2 (some other part).
This works reasonable well, but if I go down with the cell size, I get weird artifacts in the surface of the mesh: at some random places, "holes" appear (see screenshot here: https:// files.reox.at/.mesh/ screenshot.png).
I tried to track down the problem and it can be triggered by using lloyd or odt optimization. When either of these are used, such holes appear in my mesh (much much more in odt) - if I switch them off, these holes are usually gone. But I found also images were such holes appear in certain configurations, even without llyod or odt active.
There, I can influence these holes by choosing a larger relative_error_bound in create_labeled_image_mesh_domain (my default is 1e-7) or by generating a new mesh, as there is some randomness in initialize_triangulation_from_labeled_image (in my code, I specified a seed for the PRNG and thus can reliably trigger it by choosing a specific seed).
Interestingly, it seems to appear more often when more than two labels are used. Thus, in a binary image (only 0 and 1), this does not happen. For example, if I take the same image with 3 labels and replace all 2's by 1's, I get a much better mesh.
Is there anything I may have missed to implement, for example during the creation of the label domain? I can try to track down the problem even more, but don't know at the moment where to look next and thus would appreciate some guidance!
Best,
Sebastian
- Re: [cgal-discuss] Holes in mesh-surface when using lloyd or odt optimization on labeled images, Sebastian Bachmann, 06/02/2025
Archive powered by MHonArc 2.6.19+.