SetFactory("OpenCASCADE");
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  UPPER SURFACE OF THE VEHICLE
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// ---------------------------------------------------------------
// OGIVE (Tangent ogive formula with R = 31.75mm and L = 228.6mm)
// ---------------------------------------------------------------
//
sf = 0.001;
//
Point(1) = {0, 0, 0};
Point(2) = {57.15*sf,  0, 14.0416983389*sf};
Point(3) = {114.3*sf,  0, 23.9262317081*sf};
Point(4) = {171.45*sf, 0, 29.8009149998*sf};
Point(5) = {228.6*sf,  0, 31.75*sf};
//
Spline(1) = {1, 2, 3, 4, 5};
//
// ---------------------------------------------------------------
// FUSELAGE with wing root
// ---------------------------------------------------------------
//
Point(6) = {291.069988526*sf, 0, 31.75*sf};
Point(8) = {381*sf, 0, 31.75*sf};
Point(9) = {470.930011474*sf, 0, 31.75*sf};
Point(10) = {635*sf, 0, 31.75*sf};
//
Line(2) = {5, 6};
Line(3) = {6, 8};
Line(4) = {8, 9};
Line(5) = {9, 10};
//
Extrude {{1, 0, 0}, {0, 0, 0}, -Pi/2} {Curve{1}; Curve{2}; Curve{5};}
Extrude {{1, 0, 0}, {0, 0, 0}, -Pi/2} {Curve{3}; Curve{4};}
//
Point(18) = {381*sf, 0, -1122*sf};
Point(19) = {470.930011474*sf, 0, 0};
Point(20) = {291.069988526*sf, 0, 0};
//
Circle(19) = {19, 18, 20};
Extrude {0, 40*sf, 0} { Curve{19}; }
//
BooleanDifference{ Surface{4}; Surface{5}; Delete; }{ Surface{6}; Delete; }
Recursive Delete { Surface{6}; Surface{10}; Surface{8}; Point{18}; }
Coherence;
//
// ---------------------------------------------------------------
// BICONVEX WING
// ---------------------------------------------------------------
//
Point(31) = {381*sf, 143.891*sf, -423*sf};
Point(32) = {414.909*sf, 143.891*sf, 0};
Point(33) = {347.091*sf, 143.891*sf, 0};
Point(34) = {381*sf, 143.891*sf, 1.3569491372*sf};
//
Circle(36) = {32, 31, 34};
Circle(37) = {34, 31, 33};
Recursive Delete { Point{31}; }
//
Line(38) = {32, 28};
Line(39) = {34, 24};
Line(40) = {33, 26};
//
Curve Loop(2) = {35, -39, -36, 38};
Surface(10) = {2};
Curve Loop(4) = {33, -40, -37, 39};
Surface(11) = {4};
//
// ---------------------------------------------------------------
// MESHING DEFINITIONS
// ---------------------------------------------------------------
//
Transfinite Curve {29, 28, 24, 25, 7} = 25 Using Progression 1;
Transfinite Curve {30, 31} = 10 Using Progression 1;
Transfinite Curve {34, 35, 32, 33} = 15 Using Progression 1;
Transfinite Curve {26, 27} = 7 Using Progression 1;
Transfinite Curve {1, 8} = 35 Using Progression 1.05;
//
Transfinite Surface {3, 9, 7, 2, 1};
Recombine Surface {3, 9, 7, 2, 1};
////+
Transfinite Curve {36, 37} = 15 Using Progression 1;
//+
Transfinite Curve {38, 39, 40} = 45 Using Progression 1;
//+
Transfinite Surface {10};
//+
Transfinite Surface {11};
//+
Recombine Surface {10, 11};
