Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Create a coarse surface mesh produces areas of very small elements

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Create a coarse surface mesh produces areas of very small elements


Chronological Thread 
  • From: Sebastian Bachmann <>
  • To:
  • Subject: Re: [cgal-discuss] Create a coarse surface mesh produces areas of very small elements
  • Date: Wed, 24 May 2023 15:33:18 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-data: A9a23:SxpmjaPPmceYXDbvrR3ok8FynXyQoLVcMsEvi/4bfWQNrUpzhWcPz 2ZJWmmDMv2PN2fwedtwOojgoBwEu8XSx4A3SXM5pCpnJ55ogZqcVI7Bdi8cHAvLc5adFBo/h yk6QoOdRCzhZiaE/n9BCpC48T8mk/vgqoPUUIbsIjp2SRJvVBAvgBdin/9RqoNziLBVOSvU0 T/Ji5OZYAfNNwJcaDpOsPre8k8355wehRtB1rAATaAT1LPhvyJNZH4vDfnZB2f1RIBSAtm7S 47rpF1u1j6xE78FU7tJo56jGqE4aua60Tum1hK6b5Ofbi1q/UTe5EqU2M00Mi+7gx3R9zx4J U4kWZaYEW/FNYWU8AgRvoUx/4iT8sSq9ZeeSUVTv/B/wGXMUlzsx9AyC3suLIdb/uBOE0NT5 aIhfWVlghCr34pawZq+S+Vjj94vatPmO5NZs20IITPxVKl4B8GFHPWMvIQAtNszrpgm8fL2Z 8cdbT1HdhnHc1tGJj/7DbpnxLb02CikKmMwRFS9qvcl6lTUxwdNjJfMKd7JYcCKWpxWgRPNz o7B1z+lUk9KbYL3JSC+2nmjj+uKkSLgU58JD5Wj5/tyiRuSwHYSAVsYTzOGTeKRj0+yVNtFJ woO9y0+66EunKC2cjXjdxeZh36Am0IbYcJBGa4+7jif6LfEvT/MUwDoUQV9QNAhscY3Qxkj2 VmIg87lCFRTXFu9GSr1GlC8/WraBMQFEYMRTXJdF1pUuLEPtKli0kOWFr6PBYbv1oWdJN3m/ 9ydhAQ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l c8z9sZKVKDLHyoxoao6Noqk6YotWC20fFJlf/Uw054KTEf9eS6z0wegM0qeWN1ADN2U/F6aC /5BHNNuVRO/3yOwsD0wWK4ACJ5vvfsT/NFZUKjaFW0HlLq+rzRSr5Pb8BbltlIrW9lDlcUcK JvbUjC/TlyrmnpfnlHSoPl+OmaXZccOYCv+1ruX9NolOo0isuY2V20PyZqx4muoNTV48yKuv A/sY7Hcy8pgw99Om6ruCqByOBWmG+jsVein8BGBjPoWVInhafzxjgIyrkXrGy90PrFLAtR+q umrge7NhUjAuO47bnDdl5y/DJJ23MSVXtQGAvKveTMe1WGHVdT36hQOx3GgJNYb2JlB782gX E2jZNH2adcRXMxHyWZIbzRFVSwQELnzcryqsBbVQy5g0fTB+VevwBKbGX7VgaVzcy4ENJTkB knutvG+oNlExGiJ6NnoGNk+a6KU4ne6MUflSzE1nSOVCXnui0/qVn7Ki0878T+SYpWbOJ+S3 H8GLyQSsDyotabYithF22C3Utv7E14l6dQNkokhFxKaRtx04KPq7QjQDHneNqxprw==
  • Ironport-hdrordr: A9a23:HxRljqCfAjyjJbLlHem755DYdb4zR+YMi2TDpHofdfUzSL39qy nOpoV/6faaslsssR0b+exofZPwI080lqQY3WByB92ftWDd0QPCEGgh1+rfKlbbak7DH4Bmu5 tdTw==
  • Ironport-phdr: A9a23:hcokzBdkj04XmUulB+AcEiXqlGM+x9XLVj580XLHo4xHfqnrxZn+J kuXvawr0AWUG96Etrka0aL/iOPJZy8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T 4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglWhDexe71/I Re2oAnet8Qan5ZpJ7osxBfOvnZHdONayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU 7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4 ql3RBP0jioMKjg0+3zVhMNtlq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w5jqBJJqXDMCQJrvS/usVjMUr/Xuc QiUQ1he4j+WH6TSGQiH5QJotXXKRtqrOnWTI1EDwNJyAhCBbh864khcTHAhk5g1Gxr/jtTma 1t87ysN60TQrxpAxetyO1/lX2DP4g60IGRRKtDXPF9d6QdM4F3QOMqV47doHi1WyZamqRSEN m2RYwkg5YQhQEGDFxbqIuv2jTEv2/KVAfr4JuecON1mSMRbVvuHzIijlJFr+CbKP9ndZhFf
  • Ironport-sdr: 646e1220_2/GXduGl7JqNuQRKFsxI5TEH+/XNa+JC1sVkkpTH5pjr5Of MVROgySCXO19Nztuu/jcUN7Tn0MEKXwF/MF26ew==

Thanks for the hint, this seems to be indeed the problem!
Calling the script now several times reduces the chances that this happens, however after a few trials I got to a random placement which had again small elements.
I have to read the code a bit to understand how the points are constructed, but I think that is do-able!

Thanks for the quick help!

Best,
Sebastian

On 24.05.2023 14:57, Andreas Fabri wrote:
Have a look at this section

https://doc.cgal.org/latest/Mesh_3/index.html#title30


On 5/24/2023 2:56 PM, Andreas Fabri wrote:
Hello,

Our meshing experts don't work today.   My guess is that it has to do with the initialization
of the mesh generation process.   From a point P inside the volume we shoot rays and
the intersection points of the rays with the surface are inserted. When the point P
is close to the surface you may get two intersection points close on the surface.

Andreas


On 5/24/2023 2:51 PM, Sebastian Bachmann ( via cgal-discuss Mailing List) wrote:
Hi!

This is an image of a set of 20 and I can see this behaviour on 4 of them. On 420.inr it does not happen and the mesh looks good.
The code was compiled against 5.4 (1050401000).

If I look at the imges, I can not see any voxels standing out at the position - at least not more than on other places, where it works fine.
At least from the image, I cannot make out any particular feature that would cause that.

Is there any way to debug this and see what's going on?

Best,
Sebastian

On 24.05.2023 14:34, Sebastien Loriot ( via cgal-discuss Mailing List) wrote:
Do you observe this behavior on all images or only a specific one?
For example, when using 420.inr do you have such an issue?

What could case such an over refinement (provided you are not using master version of CGAL) is if the mesher is trying to respect some
topological criteria (a very tiny handle for example, but that would be surprising in an image).

Best,

Sebastien.

On 5/24/23 14:14, Sebastian Bachmann ( via cgal-discuss Mailing List) wrote:
Hi everyone,

I have an image from which I want to create a coarse surface mesh.
The code I use for that is based upon the example mesh_3D_image_with_features.cpp, however it is adopted to then extract the surface and write an OFF file: https://gist.github.com/reox/0df1f446f0ff9d46e0688b60e8e858b8

As you can see, the Mesh_criteria is set to a really coarse mesh. The input image (attached) I use has a voxel size of around 0.5mm and represents a proximal femur.
Now, for some reason, I get extremely fine triangle elements in certain places (see attached image).

I find that peculiar, as the facet_distance is already quite large, and I thought that this might be the main issue here. I remembered, that also the relative_error_bound in the create_labeled_image_mesh_domain can have an influence, but reducing this rather creates a "spiky" mesh than removing those small elements. (Eventually when it is set to 0.1, the small elements vanish, but then the vertices are all over the place and not on the isosurface anymore...)

Is there anything I missed here, maybe did I use wrong parameters? Or is there another way how I could produce such coarse meshes?

Best,
Sebastian






Archive powered by MHonArc 2.6.19+.

Top of Page