Buildmesh from meshL with a hole

Dear all,

I would like to reconstruct a 2D from a meshL obtained with extract(). TO illustrate my problems I give a small example.

I have a 2D mesh of a square with a hole (ThBinder)

I have a 2D mesh of a sphere (ThParticle)

Then, I extract the four external border of ThBinder;

int[int] ll = [1,2,3,4];
meshL ThL0= extract(ThBinder, label=ll);

and the border of the sphere:

meshL ThL1 = extract(ThParticle);

And combine the two mesh and rebuild the 2D mesh as:

meshL ThL2 = ThL0 + ThL1;
ThBinder = buildmesh(ThL2);

And finally I get:

However, what I would like, is a mesh with a hole inside.

I have tried to change the orientation of ThL1 with a movemesh() or during the extract(), but I have always the same results.

would anyone know how to do this ? (my code in attachment).

Thank you in advance,

Best regards,

Loïc

MWE_meshing_Loic.edp (1.3 KB)

Dear Loic,
you should be able to do at end
ThBinder=trunc(ThBinder,ThBinder(x,y).region==1);