SetFactory("OpenCASCADE");

np = newp;

Point(np)    = {0.00375, 0.0, 0.1585, 1.0};
Point(np+1)  = {0.09775, 0.0, 0.1585, 1.0};
Point(np+2)  = {0.09775, 0.0, 0.1595, 1.0};
Point(np+3)  = {0.10450, 0.0, 0.1595, 1.0};
Point(np+4)  = {0.11500, 0.0, 0.1525, 1.0};
Point(np+5)  = {0.15750, 0.0, 0.1525, 1.0};
Point(np+6)  = {0.16450, 0.0, 0.1595, 1.0};
Point(np+7)  = {0.16600, 0.0, 0.1595, 1.0};
Point(np+8)  = {0.16600, 0.0, 0.1585, 1.0};
Point(np+9)  = {0.19900, 0.0, 0.1585, 1.0};
Point(np+10)  = {0.19900, 0.0, 0.0224, 1.0};
Point(np+11) = {0.20894, 0.0, 0.00512, 1.0};
Point(np+12) = {0.23000, 0.0,-0.0070, 1.0};
Point(np+13) = {0.23000, 0.0,-0.0170, 1.0};
Point(np+14) = {0.00375, 0.0,-0.0170, 1.0};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 5};
Line(5) = {5, 6};
Line(6) = {6, 7};
Line(7) = {7, 8};
Line(8) = {8, 9};
Line(9) = {9, 10};
Line(10) = {10, 11};
BSpline(11) = {11, 12, 13};
Line(12) = {13, 14};
Line(13) = {14, 15};
Line(14) = {15, 1};

Curve Loop(1) = {9, 10, 11, 12, 13, 14, 1, 2, 3, 4, 5, 6, 7, 8};
Plane Surface(1) = {1};

Translate {0, 0, -0.1525} {
  Surface{1}; 
}

Extrude {{0, 0, 1}, {0, 0, 0}, 2*Pi} {
  Surface{1}; 
}

Delete {
  Volume{1}; 
}
Delete {
  Surface{1}; 
}
Delete {
  Curve{1:14}; 
}

Delete {
  Surface{8}; 
}

zc = 0.006;
r1 = 0.00375;
r2 = 0.0153;
r3 = 0.025;

np = newp;
Point(np)   = {0.0,0.0, zc, 1.0};
Point(np+1) = {r2 ,0.0, zc, 1.0};
Point(np+2) = {0.0, r2, zc, 1.0};
Point(np+3) = {-r2,0.0, zc, 1.0};
Point(np+4) = {0.0,-r2, zc, 1.0};

np = newp;
Point(np)   = {0.0,0.0, zc, 1.0};
Point(np+1) = {r3 ,0.0, zc, 1.0};
Point(np+2) = {0.0, r3, zc, 1.0};
Point(np+3) = {-r3,0.0, zc, 1.0};
Point(np+4) = {0.0,-r3, zc, 1.0};

Circle(29) = {29, 27, 28};
Circle(30) = {28, 27, 31};
Circle(31) = {31, 27, 30};
Circle(32) = {30, 27, 29};
Circle(33) = {34, 27, 33};
Circle(34) = {33, 27, 36};
Circle(35) = {36, 27, 35};
Circle(36) = {35, 27, 34};
Curve Loop(22) = {22};
Curve Loop(23) = {33, 34, 35, 36};
Plane Surface(16) = {22, 23};
Curve Loop(24) = {33, 34, 35, 36};
Curve Loop(25) = {29, 30, 31, 32};
Plane Surface(17) = {24, 25};
Curve Loop(26) = {29, 30, 31, 32};
Curve Loop(27) = {21};
Plane Surface(18) = {26, 27};

Mesh.CharacteristicLengthExtendFromBoundary = 1;

Merge "background.geo";