// Characteristic lengths

lc_nosetip		= 0.200000;
lc_nose1sttransition	= 0.200000;
lc_noseupperstraight	= 0.200000;
lc_nose2ndtransition	= 0.200000;
lc_noselowerstraight	= 0.200000;
lc_nosetobodytransition	= 0.200000;
lc_boundingbox		= 2.000000;

// These are the defaults.
Mesh.MshFileVersion = 2;
Mesh.Algorithm = 1;

// ***********************************************************************************
//
// Points
//
// ***********************************************************************************

// Nose tip
Point(1) = {0.000000,  0.200000,  0.000000,  lc_nosetip};
Point(2) = {0.000000,  0.100000,  -0.173205,  lc_nosetip};
Point(3) = {0.000000,  -0.100000,  -0.173205,  lc_nosetip};
Point(4) = {0.000000,  -0.200000,  -0.000000,  lc_nosetip};
Point(5) = {0.000000,  -0.100000,  0.173205,  lc_nosetip};
Point(6) = {0.000000,  0.100000,  0.173205,  lc_nosetip};
Point(7) = {0.000000,  0.000000,  0.000000,  lc_nosetip};

// Nose 1st transition
Point(8) = {0.000000,  0.200000,  0.000000,  lc_nose1sttransition};
Point(9) = {0.071250,  0.328287,  0.000000,  lc_nose1sttransition};
Point(10) = {0.142500,  0.437542,  0.000000,  lc_nose1sttransition};
Point(11) = {0.213750,  0.521776,  0.000000,  lc_nose1sttransition};
Point(12) = {0.285000,  0.575000,  0.000000,  lc_nose1sttransition};
Point(13) = {0.000000,  0.100000,  -0.173205,  lc_nose1sttransition};
Point(14) = {0.071250,  0.164143,  -0.284305,  lc_nose1sttransition};
Point(15) = {0.142500,  0.218771,  -0.378923,  lc_nose1sttransition};
Point(16) = {0.213750,  0.260888,  -0.451872,  lc_nose1sttransition};
Point(17) = {0.285000,  0.287500,  -0.497965,  lc_nose1sttransition};
Point(18) = {0.000000,  -0.100000,  -0.173205,  lc_nose1sttransition};
Point(19) = {0.071250,  -0.164143,  -0.284305,  lc_nose1sttransition};
Point(20) = {0.142500,  -0.218771,  -0.378923,  lc_nose1sttransition};
Point(21) = {0.213750,  -0.260888,  -0.451872,  lc_nose1sttransition};
Point(22) = {0.285000,  -0.287500,  -0.497965,  lc_nose1sttransition};
Point(23) = {0.000000,  -0.200000,  -0.000000,  lc_nose1sttransition};
Point(24) = {0.071250,  -0.328287,  -0.000000,  lc_nose1sttransition};
Point(25) = {0.142500,  -0.437542,  -0.000000,  lc_nose1sttransition};
Point(26) = {0.213750,  -0.521776,  -0.000000,  lc_nose1sttransition};
Point(27) = {0.285000,  -0.575000,  -0.000000,  lc_nose1sttransition};
Point(28) = {0.000000,  -0.100000,  0.173205,  lc_nose1sttransition};
Point(29) = {0.071250,  -0.164143,  0.284305,  lc_nose1sttransition};
Point(30) = {0.142500,  -0.218771,  0.378923,  lc_nose1sttransition};
Point(31) = {0.213750,  -0.260888,  0.451872,  lc_nose1sttransition};
Point(32) = {0.285000,  -0.287500,  0.497965,  lc_nose1sttransition};
Point(33) = {0.000000,  0.100000,  0.173205,  lc_nose1sttransition};
Point(34) = {0.071250,  0.164143,  0.284305,  lc_nose1sttransition};
Point(35) = {0.142500,  0.218771,  0.378923,  lc_nose1sttransition};
Point(36) = {0.213750,  0.260888,  0.451872,  lc_nose1sttransition};
Point(37) = {0.285000,  0.287500,  0.497965,  lc_nose1sttransition};
Point(38) = {0.000000,  0.000000,  0.000000,  lc_nose1sttransition};
Point(39) = {0.285000,  0.000000,  0.000000,  lc_nose1sttransition};

// Nose upper straight
Point(40) = {0.285000,  0.575000,  0.000000,  lc_noseupperstraight};
Point(41) = {0.285000,  0.287500,  -0.497965,  lc_noseupperstraight};
Point(42) = {0.285000,  -0.287500,  -0.497965,  lc_noseupperstraight};
Point(43) = {0.285000,  -0.575000,  -0.000000,  lc_noseupperstraight};
Point(44) = {0.285000,  -0.287500,  0.497965,  lc_noseupperstraight};
Point(45) = {0.285000,  0.287500,  0.497965,  lc_noseupperstraight};
Point(46) = {1.700000,  1.282500,  0.000000,  lc_noseupperstraight};
Point(47) = {1.700000,  0.641250,  -1.110678,  lc_noseupperstraight};
Point(48) = {1.700000,  -0.641250,  -1.110678,  lc_noseupperstraight};
Point(49) = {1.700000,  -1.282500,  -0.000000,  lc_noseupperstraight};
Point(50) = {1.700000,  -0.641250,  1.110678,  lc_noseupperstraight};
Point(51) = {1.700000,  0.641250,  1.110678,  lc_noseupperstraight};
Point(52) = {0.285000,  0.000000,  0.000000,  lc_noseupperstraight};
Point(53) = {1.700000,  0.000000,  0.000000,  lc_noseupperstraight};

// Nose 2nd transition
Point(54) = {1.700000,  1.282500,  0.000000,  lc_nose2ndtransition};
Point(55) = {1.728750,  1.295300,  0.000000,  lc_nose2ndtransition};
Point(56) = {1.757500,  1.304904,  0.000000,  lc_nose2ndtransition};
Point(57) = {1.786250,  1.311431,  0.000000,  lc_nose2ndtransition};
Point(58) = {1.815000,  1.315000,  0.000000,  lc_nose2ndtransition};
Point(59) = {1.700000,  0.641250,  -1.110678,  lc_nose2ndtransition};
Point(60) = {1.728750,  0.647650,  -1.121762,  lc_nose2ndtransition};
Point(61) = {1.757500,  0.652452,  -1.130080,  lc_nose2ndtransition};
Point(62) = {1.786250,  0.655716,  -1.135733,  lc_nose2ndtransition};
Point(63) = {1.815000,  0.657500,  -1.138823,  lc_nose2ndtransition};
Point(64) = {1.700000,  -0.641250,  -1.110678,  lc_nose2ndtransition};
Point(65) = {1.728750,  -0.647650,  -1.121762,  lc_nose2ndtransition};
Point(66) = {1.757500,  -0.652452,  -1.130080,  lc_nose2ndtransition};
Point(67) = {1.786250,  -0.655716,  -1.135733,  lc_nose2ndtransition};
Point(68) = {1.815000,  -0.657500,  -1.138823,  lc_nose2ndtransition};
Point(69) = {1.700000,  -1.282500,  -0.000000,  lc_nose2ndtransition};
Point(70) = {1.728750,  -1.295300,  -0.000000,  lc_nose2ndtransition};
Point(71) = {1.757500,  -1.304904,  -0.000000,  lc_nose2ndtransition};
Point(72) = {1.786250,  -1.311431,  -0.000000,  lc_nose2ndtransition};
Point(73) = {1.815000,  -1.315000,  -0.000000,  lc_nose2ndtransition};
Point(74) = {1.700000,  -0.641250,  1.110678,  lc_nose2ndtransition};
Point(75) = {1.728750,  -0.647650,  1.121762,  lc_nose2ndtransition};
Point(76) = {1.757500,  -0.652452,  1.130080,  lc_nose2ndtransition};
Point(77) = {1.786250,  -0.655716,  1.135733,  lc_nose2ndtransition};
Point(78) = {1.815000,  -0.657500,  1.138823,  lc_nose2ndtransition};
Point(79) = {1.700000,  0.641250,  1.110678,  lc_nose2ndtransition};
Point(80) = {1.728750,  0.647650,  1.121762,  lc_nose2ndtransition};
Point(81) = {1.757500,  0.652452,  1.130080,  lc_nose2ndtransition};
Point(82) = {1.786250,  0.655716,  1.135733,  lc_nose2ndtransition};
Point(83) = {1.815000,  0.657500,  1.138823,  lc_nose2ndtransition};
Point(84) = {1.700000,  0.000000,  0.000000,  lc_nose2ndtransition};
Point(85) = {1.815000,  0.000000,  0.000000,  lc_nose2ndtransition};

// Nose lower straight
Point(86) = {1.815000,  1.315000,  0.000000,  lc_noselowerstraight};
Point(87) = {1.815000,  0.657500,  -1.138823,  lc_noselowerstraight};
Point(88) = {1.815000,  -0.657500,  -1.138823,  lc_noselowerstraight};
Point(89) = {1.815000,  -1.315000,  -0.000000,  lc_noselowerstraight};
Point(90) = {1.815000,  -0.657500,  1.138823,  lc_noselowerstraight};
Point(91) = {1.815000,  0.657500,  1.138823,  lc_noselowerstraight};
Point(92) = {2.500000,  1.365702,  0.000000,  lc_noselowerstraight};
Point(93) = {2.500000,  0.682851,  -1.182732,  lc_noselowerstraight};
Point(94) = {2.500000,  -0.682851,  -1.182732,  lc_noselowerstraight};
Point(95) = {2.500000,  -1.365702,  -0.000000,  lc_noselowerstraight};
Point(96) = {2.500000,  -0.682851,  1.182732,  lc_noselowerstraight};
Point(97) = {2.500000,  0.682851,  1.182732,  lc_noselowerstraight};
Point(98) = {1.815000,  0.000000,  0.000000,  lc_noselowerstraight};
Point(99) = {2.500000,  0.000000,  0.000000,  lc_noselowerstraight};

// Bounding box
Point(496) = {-5.000000,  -15.000000,  -15.000000,  lc_boundingbox};
Point(497) = {35.000000,  -15.000000,  -15.000000,  lc_boundingbox};
Point(498) = {35.000000,  -15.000000,  15.000000,  lc_boundingbox};
Point(499) = {-5.000000,  -15.000000,  15.000000,  lc_boundingbox};
Point(500) = {-5.000000,  15.000000,  -15.000000,  lc_boundingbox};
Point(501) = {35.000000,  15.000000,  -15.000000,  lc_boundingbox};
Point(502) = {35.000000,  15.000000,  15.000000,  lc_boundingbox};
Point(503) = {-5.000000,  15.000000,  15.000000,  lc_boundingbox};

// ***********************************************************************************
//
// Elementary entities.
//
// ***********************************************************************************

// Nose tip
Circle(1) = {1, 7, 2};
Circle(2) = {2, 7, 3};
Circle(3) = {3, 7, 4};
Circle(4) = {4, 7, 5};
Circle(5) = {5, 7, 6};
Circle(6) = {6, 7, 1};
Line Loop(7) = { 1, 2, 3, 4, 5, 6};
Plane Surface(8) = { 7};
Physical Surface(9) = { 8};

// Nose 1st transition
Spline(10) = {8, 9, 10, 11, 12};
Spline(11) = {13, 14, 15, 16, 17};
Spline(12) = {18, 19, 20, 21, 22};
Spline(13) = {23, 24, 25, 26, 27};
Spline(14) = {28, 29, 30, 31, 32};
Spline(15) = {33, 34, 35, 36, 37};
Circle(16) = {8, 38, 13};
Circle(17) = {13, 38, 18};
Circle(18) = {18, 38, 23};
Circle(19) = {23, 38, 28};
Circle(20) = {28, 38, 33};
Circle(21) = {33, 38, 8};
Circle(22) = {12, 39, 17};
Circle(23) = {17, 39, 22};
Circle(24) = {22, 39, 27};
Circle(25) = {27, 39, 32};
Circle(26) = {32, 39, 37};
Circle(27) = {37, 39, 12};
Line Loop(28) = { 10, 22, -11, -16};
Line Loop(29) = { 11, 23, -12, -17};
Line Loop(30) = { 12, 24, -13, -18};
Line Loop(31) = { 13, 25, -14, -19};
Line Loop(32) = { 14, 26, -15, -20};
Line Loop(33) = { 15, 27, -10, -21};
Ruled Surface(34) = { 28};
Ruled Surface(35) = { 29};
Ruled Surface(36) = { 30};
Ruled Surface(37) = { 31};
Ruled Surface(38) = { 32};
Ruled Surface(39) = { 33};
Physical Surface(40) = { 34, 35, 36, 37, 38, 39};

// Nose upper straight
Line(41) = {40, 46};
Line(42) = {41, 47};
Line(43) = {42, 48};
Line(44) = {43, 49};
Line(45) = {44, 50};
Line(46) = {45, 51};
Circle(47) = {40, 52, 41};
Circle(48) = {41, 52, 42};
Circle(49) = {42, 52, 43};
Circle(50) = {43, 52, 44};
Circle(51) = {44, 52, 45};
Circle(52) = {45, 52, 40};
Circle(53) = {46, 53, 47};
Circle(54) = {47, 53, 48};
Circle(55) = {48, 53, 49};
Circle(56) = {49, 53, 50};
Circle(57) = {50, 53, 51};
Circle(58) = {51, 53, 46};
Line Loop(59) = { 41, 53, -42, -47};
Line Loop(60) = { 42, 54, -43, -48};
Line Loop(61) = { 43, 55, -44, -49};
Line Loop(62) = { 44, 56, -45, -50};
Line Loop(63) = { 45, 57, -46, -51};
Line Loop(64) = { 46, 58, -41, -52};
Ruled Surface(65) = { 59};
Ruled Surface(66) = { 60};
Ruled Surface(67) = { 61};
Ruled Surface(68) = { 62};
Ruled Surface(69) = { 63};
Ruled Surface(70) = { 64};
Physical Surface(71) = { 65, 66, 67, 68, 69, 70};

// Nose 2nd transition
Spline(72) = {54, 55, 56, 57, 58};
Spline(73) = {59, 60, 61, 62, 63};
Spline(74) = {64, 65, 66, 67, 68};
Spline(75) = {69, 70, 71, 72, 73};
Spline(76) = {74, 75, 76, 77, 78};
Spline(77) = {79, 80, 81, 82, 83};
Circle(78) = {54, 84, 59};
Circle(79) = {59, 84, 64};
Circle(80) = {64, 84, 69};
Circle(81) = {69, 84, 74};
Circle(82) = {74, 84, 79};
Circle(83) = {79, 84, 54};
Circle(84) = {58, 85, 63};
Circle(85) = {63, 85, 68};
Circle(86) = {68, 85, 73};
Circle(87) = {73, 85, 78};
Circle(88) = {78, 85, 83};
Circle(89) = {83, 85, 58};
Line Loop(90) = { 72, 84, -73, -78};
Line Loop(91) = { 73, 85, -74, -79};
Line Loop(92) = { 74, 86, -75, -80};
Line Loop(93) = { 75, 87, -76, -81};
Line Loop(94) = { 76, 88, -77, -82};
Line Loop(95) = { 77, 89, -72, -83};
Ruled Surface(96) = { 90};
Ruled Surface(97) = { 91};
Ruled Surface(98) = { 92};
Ruled Surface(99) = { 93};
Ruled Surface(100) = { 94};
Ruled Surface(101) = { 95};
Physical Surface(102) = { 96, 97, 98, 99, 100, 101};

// Nose lower straight
Line(103) = {86, 92};
Line(104) = {87, 93};
Line(105) = {88, 94};
Line(106) = {89, 95};
Line(107) = {90, 96};
Line(108) = {91, 97};
Circle(109) = {86, 98, 87};
Circle(110) = {87, 98, 88};
Circle(111) = {88, 98, 89};
Circle(112) = {89, 98, 90};
Circle(113) = {90, 98, 91};
Circle(114) = {91, 98, 86};
Circle(115) = {92, 99, 93};
Circle(116) = {93, 99, 94};
Circle(117) = {94, 99, 95};
Circle(118) = {95, 99, 96};
Circle(119) = {96, 99, 97};
Circle(120) = {97, 99, 92};
Line Loop(121) = { 103, 115, -104, -109};
Line Loop(122) = { 104, 116, -105, -110};
Line Loop(123) = { 105, 117, -106, -111};
Line Loop(124) = { 106, 118, -107, -112};
Line Loop(125) = { 107, 119, -108, -113};
Line Loop(126) = { 108, 120, -103, -114};
Ruled Surface(127) = { 121};
Ruled Surface(128) = { 122};
Ruled Surface(129) = { 123};
Ruled Surface(130) = { 124};
Ruled Surface(131) = { 125};
Ruled Surface(132) = { 126};
Physical Surface(133) = { 127, 128, 129, 130, 131, 132};

// Terminate hole with flat circular plane

Line Loop(134) = {115,116,117,118,119,120};
Plane Surface(135) = {134};

// Define the surface loop of the internal hole.
Surface Loop(1) = { -8, -34, -35, -36, -37, -38, -39, -65, -66, -67, -68, -69, -70, -96, -97, -98, -99, -100, -101, -127, -128, -129, -130, -131, -132, 135};

// Bounding box
Line(289) = {496, 497};
Line(290) = {497, 498};
Line(291) = {498, 499};
Line(292) = {499, 496};
Line(293) = {496, 500};
Line(294) = {499, 503};
Line(295) = {497, 501};
Line(296) = {498, 502};
Line(297) = {500, 501};
Line(298) = {501, 502};
Line(299) = {502, 503};
Line(300) = {503, 500};
Line Loop(301) = { 289, 290, 291, 292};
Plane Surface(302) = { 301};
Line Loop(303) = { 291, 294, -299, -296};
Plane Surface(304) = { 303};
Line Loop(305) = { 297, 298, 299, 300};
Plane Surface(306) = { 305};
Line Loop(307) = { 297, -295, -289, 293};
Plane Surface(308) = { 307};
Line Loop(309) = { 290, 296, -298, -295};
Plane Surface(310) = { 309};
Line Loop(311) = { 294, 300, -293, -292};
Plane Surface(312) = { 311};
Surface Loop(2) = { 302, 304, 306, 308, 310, 312};
Physical Surface(313) = { 302, 304, 306, 308, 310, 312};

// Define volume as bounding box minus hole.
Volume(1) = {2, 1};
