SetFactory("OpenCASCADE");
Mesh.CharacteristicLengthExtendFromBoundary = 1;
Geometry.OCCAutoFix = 0;

np = newp;
lc = 0.1;
dz = 0.1525;

Point(np)    = {0.00000, 0.0, 0.1585-dz, lc};
Point(np+1)  = {0.00375, 0.0, 0.1585-dz, lc};
Point(np+2)  = {0.01530, 0.0, 0.1585-dz, lc};
Point(np+3)  = {0.02500, 0.0, 0.1585-dz, lc};
Point(np+4)  = {0.10150, 0.0, 0.1585-dz, lc};
Point(np+5)  = {0.10150, 0.0, 0.1595-dz, lc};
Point(np+6)  = {0.10450, 0.0, 0.1595-dz, lc};
Point(np+7)  = {0.11150, 0.0, 0.1525-dz, lc};
Point(np+8)  = {0.15750, 0.0, 0.1525-dz, lc};
Point(np+9)  = {0.16450, 0.0, 0.1595-dz, lc};
Point(np+10) = {0.17000, 0.0, 0.1595-dz, lc};
Point(np+11) = {0.17000, 0.0, 0.1585-dz, lc};
Point(np+12) = {0.19900, 0.0, 0.1585-dz, lc};
Point(np+13) = {0.19900, 0.0, 0.0224-dz, lc};
Point(np+14) = {0.2050, 0.0,0.0077-dz, lc};
Point(np+15) = {0.23000, 0.0,-0.0070-dz, lc};
Point(np+16) = {0.473877357, 0.0,-0.1595, lc};
Point(np+17) = {0.00000, 0.0,0.5000, lc};
Point(np+18) = {0.00000, 0.0,0.0000, lc};

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};
Line(11) = {11, 12};
Line(12) = {12, 13};
Line(13) = {13, 14};

BSpline(14) = {14, 15, 16};
Line(15) = {16, 17};
Circle(16) = {17, 19, 18};
Line(17) = {18, 1};
Curve Loop(1) = {1:17};
Plane Surface(1) = {1};

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

Delete {
  Surface{1}; Curve{1:17};
}

Merge "D:\VICINI\[001]-PROGETTI\[002]-PICPLUS\[002]-GMSH\[003]-UTILITIES\[007]-FRUSTUM\frustum_HT20K.geo";

Physical Surface("Far Field", 1000) = {16,17};
Physical Surface("Thruster body", 1001) = {13:15};
Physical Surface("Ceramic", 1002) = {9:11,5:7};
Physical Surface("Inner pole", 1003) = {4};
Physical Surface("Outer pole", 1008) = {12};
Physical Surface("Keeper", 1004) = {2};
Physical Surface("Keeper hole", 1005) = {1};
Physical Surface("Inner hole", 1006) = {3};
Physical Surface("Thruster", 1007) = {8};
Physical Volume("Volume", 1100) = {1};

Transfinite Curve {19} = 13 Using Progression 1;
Transfinite Curve {20} = 15 Using Progression 1;
Transfinite Curve {18} = 10 Using Progression 1;

Box(2) = {-0.5, -0.5, 0.494, 1, 1, 0.2};

BooleanDifference{ Volume{1}; Delete; }{ Volume{2}; Delete; }

Transfinite Curve {1} = 13 Using Progression 1;

Cone(2) = {0, 0, 0.01, 0, 0, 0.4, 0.00375, 0.1, 2*Pi};

Delete {
  Volume{2}; 
}
Delete {
  Surface{19}; Surface{20}; 
}

Surface{18} In Volume{1};

Transfinite Curve {26} = 13 Using Progression 1;


