[Gmsh] Extrude creates bottom surface with inward-pointing normal

Mark Stock mstock at umich.edu
Fri Oct 19 22:19:45 CEST 2012


I am investigating BREP meshes of extruded shapes, and I find that the
Extrude command create a mesh with the bottom triangles' normals
pointing inward. Is this normal behavior? If so, how do I flip the
normals of the bottom triangles such that the whole surface has
consistent direction?

r1 = 10.0;      // inner radius
r2 = 20.0;      // outer radius
del = 1.0;      // this is triangle resolution
dist = 5.0;     // extrusion distance

Mesh.CharacteristicLengthMax = del;

Point(1) = {0, 0, 0};

Point(2) = {r1, 0, 0};
Point(3) = {0, r1, 0};
Point(4) = {-r1, 0, 0};
Point(5) = {0, -r1, 0};

Point(6) = {r2, 0, 0};
Point(7) = {0, r2, 0};
Point(8) = {-r2, 0, 0};
Point(9) = {0, -r2, 0};

Circle(1) = {2, 1, 3};
Circle(2) = {3, 1, 4};
Circle(3) = {4, 1, 5};
Circle(4) = {5, 1, 2};

Circle(5) = {6, 1, 7};
Circle(6) = {7, 1, 8};
Circle(7) = {8, 1, 9};
Circle(8) = {9, 1, 6};

Line Loop(9) = {5,6,7,8};       // outer loop
Line Loop(10) = {1,2,3,4};      // hole

Plane Surface(11) = {9,10};

Extrude {0, 0, dist} {Surface{11};}

This is an "O" shape, extruded to make a donut/torus. The top and
sides have consistent normal, but the bottom is backwards. Any
suggestions to fix this would be appreciated.

Mark