mm = 1e-3;

z1 = 62*mm;
z2 = 90*mm;
ir = 40*mm;
or = 58.5*mm;

lc = 4*mm;

Lstm = 70*mm;
Dstm = 46*mm;

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

// STM-Body
/*
Point(10) = {Lstm,0,0,lc};
Point(20) = {Lstm,Dstm/2,0,lc};
Point(30) = {0,Dstm/2,0,lc};


Point(21) = {Lstm,-Dstm/2,0,lc};
Point(31) = {0,-Dstm/2,0,lc};
*/

// Coil 1

Point(40) = {ir,z1,0,lc};
//Point(50) = {ir,z2,0,lc};
Point(60) = {or,z1,0,lc};
//Point(70) = {or,z2,0,lc};

// Coil 2

Point(41) = {ir,-z1,0,lc};
//Point(51) = {ir,-z2,0,lc};
Point(61) = {or,-z1,0,lc};
//Point(71) = {or,-z2,0,lc};


Point(80) = {4*or,0,0,lc*6};
Point(81) = {0,4*or,0,lc*6};

Point(82) = {0,2*or,0,lc*4};
Point(83) = {2*or,0,0,lc*4};

Point(84) = {0,-4*or,0,lc*6};
Point(85) = {0,-2*or,0,lc*4};


Line(1) = {40,60};
Line(2) = {41,61};
Extrude Line {1, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {2, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {3, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {11, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {7, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {19, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};


Extrude Surface {6, {0.0,0.0185,0.0}};
Extrude Surface {14, {0.0,0.0185,0.0}};
Extrude Surface {18, {0.0,0.0185,0.0}};
Extrude Surface {10, {0.0,-0.0185,0.0}};
Extrude Surface {22, {0.0,-0.0185,0.0}};
Extrude Surface {26, {0.0,-0.0185,0.0}};

Circle(159) = {85,1,83};
Circle(160) = {84,1,80};
Circle(161) = {83,1,82};
Circle(162) = {80,1,81};
Line(163) = {84,85};
Line(164) = {85,82};
Line(165) = {82,81};
Extrude Line {161, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {166, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {169, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {162, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {175, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {178, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {159, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {184, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {187, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {160, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {193, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {196, {0.0,1.0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
/* Geometry of the Body
Point(150) = {0.065,0,0,lc};
Point(151) = {0.065,0.018,0,lc};
Point(152) = {-0.075,0.018,0,lc};
Point(153) = {-0.075,0,0,lc};
Point(154) = {-0.075,0.023,0,lc};
Point(155) = {0.065,0.023,0,lc};

Line(202) = {155,154};
Line(203) = {151,152};
Extrude Line {203, {1,0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {204, {1,0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {208, {1,0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {202, {1,0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {216, {1,0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Extrude Line {220, {1,0,0.0}, {0.0,0.0,0.0}, 2*Pi/3};
Line Loop(228) = {225,217,221};
Line Loop(229) = {205,209,213};
Plane Surface(230) = {228,229};
Line Loop(231) = {218,222,226};
Line Loop(232) = {206,210,214};
Plane Surface(233) = {231,232};
Surface Loop(234) = {219,227,223,-233,-215,-211,-207,230};
Volume(235) = {234};
*/
Surface Loop(236) = {171,174,168,186,192,189};
Surface Loop(237) = {14,6,18,-83,-39,-61,-70,-48,-92,-91,-69,-47};
Surface Loop(238) = {136,114,158,149,-26,-22,-10,105,127,113,157,135};
//Volume(239) = {236,237,234,238}; //Volume of the Body
Volume(239) = {236,237,238};
Surface Loop(240) = {177,180,183,201,198,195};
Volume(241) = {240,236};

Physical Volume(1000) = {1,2,3,4,5,6};	// Coils
//Physical Volume(2000) = {235};		// Body
Physical Volume(3000) = {239};		// Air
Physical Volume(4000) = {241};		// AirInf
Physical Surface(5000)= {240};		// Boundary
