# [Gmsh] Gaps and overlaps when using extrude command

Jeremy Theler jeremy at seamplex.com
Fri Aug 14 13:21:12 CEST 2020

```Add
Coherence;
and you'll be fine.

On Fri, 2020-08-14 at 10:43 +0000, Bart Deschoolmeester wrote:
> Hi,
> I am a beginner.
> While working on a larger 3D project I noticed some gaps and
> overlaps.
> I plan to simulate the heat transfer.
> I assume gaps and overlaps are to be avoided to get a good
> simulation. Correct?
>
> I tracked down the origin of the gaps and overlaps and it seems to be
> the extrude command causing the trouble.
> The file below draws a rectangle with a round hole in the middle. In
> the hole a ring (annulus) is drawn.
> If I create the ring with the BooleanDifference command (difference
> of two circles): all works fine. All triangles line up perfectly
> around the contact line of ring and hole.
> If I create the ring with the Extrude command, things don’t line up.
>
> Of course I could opt for the booleandifference command for this
> problem but:
>
> I cannot use this booleandifference solution in my 3D problemI can
> imagine these holes and overlaps also being produced in other curved
> contact surfaces.
>
> Is this a bug in GMSH or the be expected in more elaborate meshes?
> How can it be resolved?
>
> Thank you!
>
> Bart
>
>
> KanR = DefineNumber[ 0.1, Name "Parameters/KanR" ];
> KanMeshsize = DefineNumber[ 0.05, Name "Parameters/KanMeshsize" ];
> Rectangle(1) = {-2.5, -2.5, 0, 5, 5, 0};
> Circle(5) = {0, 0, 0, KanR, 0, 2*Pi};
> Curve Loop(2) = {5};
> Plane Surface(2) = {2};
> BooleanDifference{ Surface{1}; Delete; }{ Surface{2}; Delete; }
> Point(15) = {0, KanR, 0};
> Point(16) = {0, KanR-0.05, 0};
> Line(20) = {15, 16};
> Extrude {{0, 0, 1}, {0, 0, 0}, 2*Pi} {
>   Curve{20};
> }
> Field[1] = Distance;
> //+
> Field[1].EdgesList = {5};
> //+
> Field[1].NNodesByEdge = 50;
> //+
> Field[2] = Threshold;
> //+
> Field[2].DistMax = 2.5;
> //+
> Field[2].DistMin = 0;
> //+
> Field[2].IField = 1;
> //+
> Field[2].LcMax = 0.25;
> //+
> Field[2].LcMin = KanMeshsize ;
>
>
> Background Field = 2;
>
> Mesh.CharacteristicLengthExtendFromBoundary = 0;
> Mesh.CharacteristicLengthFromPoints = 0;
> Mesh.CharacteristicLengthFromCurvature = 0;
>
>
>
>
>
>
>
> _______________________________________________gmsh mailing
> listgmsh at onelab.info
> http://onelab.info/mailman/listinfo/gmsh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20200814/87a87af5/attachment-0001.html>
```