// tracker solaire
lc = 1.;


//mm=0.001;
mm=1;
x0=2750.*mm;
x1=4705.*mm;
x2=5500.*mm;
x3=7000.*mm;
ya=100.*mm;
y0=400.*mm;
y1=600.*mm;
y2=1400.*mm;
y3=1700.*mm;
y4=2000.*mm;
y5=2850.*mm;
y6=3150.*mm;
z0=50.*mm;
z1=400.*mm;
z2=500.*mm;
z3=700.*mm;
z4=900.*mm;
r0=70.*mm/2.;
r1=160.*mm/2.;






// ----------------------------------------------Surface 1

Point(1)={0.,y0,z4,lc};
Point(2)={0.,y6,z4,lc};
Point(7)={0.,y6,z1,lc};
yz0=y5+(y6-y5)*z0/z1;
Point(8)={0.,yz0,z0,lc};
Point(9)={0.,y5,0.,lc};
Point(10)={0.,y4,0.,lc};
Point(11)={0.,y3,z1,lc};
Point(12)={0.,y2,0.,lc};
Point(13)={0.,y1,0.,lc};


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



Line loop(1)={1,2,3,4,5,6,7,8,9};
Plane Surface(1)= {1};
Transfinite Line {1}=6;
Transfinite Line {2}=6;
Transfinite Line {3}= 3;
Transfinite Line {4}= 3;

Transfinite Line {5}=6;
Transfinite Line {6}= 2;
Transfinite Line {7}= 3;
Transfinite Line {8}= 3;

Transfinite Line {9}= 10;



Physical Surface(3001) = {1};

// ---------------------------------------- surface 3

Point(27)={0.,0.,0.,lc};
Point(28)={x0,0.,0.,lc};
Point(29)={x0,ya,0.,lc};
Point(30)={0.,ya,0,lc};
Line(27)={27,28};
Line(28)={28,29};
Line(29)={29,30};
Line(30)={30,27};
Line loop(3)={27,28,29,30};
Plane Surface(3)= {3};
Transfinite Line {27}=10;
Transfinite Line {28}= 2;
Transfinite Line {29}=10;
Transfinite Line {30}= 2;
Physical Surface(3003) = {3};


// ---------------------------------------- surface 5


//Point(30)={0.,ya,0,lc};
//Point(29)={x0,ya,0.,lc};
Point(35)={x0,y0,z4,lc};
//Point(1)={0.,y0,z4,lc};


Line(35)={30,29};
Line(36)={29,35};
Line(37)={35,1};
Line(38)={1,30};
Line loop(5)={35,36,37,38};
Plane Surface(5)= {5};
Transfinite Line {35}=10;
Transfinite Line {36}=6;
Transfinite Line {37}=10;
Transfinite Line {38}=6;
Physical Surface(3005) = {5};



// ---------------------------------------- surface 7

//Point(30)={0.,ya,0,lc};
//Point(29)={x0,ya,0.,lc};
Point(37)={x0,y1,0.,lc};
//Point(13)={0.,y1,0.,lc};
Line(43)={30,29};
Line(44)={29,37};
Line(45)={37,13};
Line(46)={13,30};
Line loop(7)={43,44,45,46};
Plane Surface(7)= {7};
Transfinite Line {43}=10;
Transfinite Line {44}=6;
Transfinite Line {45}=10;
Transfinite Line {46}=6;
Physical Surface(3007) = {7};




// ---------------------------------------- surface 9


//Point(1)={0.,y0,z4,lc};
//Point(35)={x0,y0,z4,lc};
//Line(37)={35,1};
//Point(13)={0.,y1,0.,lc};


Line(47)={1,35};
Line(48)={35,37};
Line(49)={37,13};
Line(50)={13,1};
Line loop(9)={47,48,49,50};
Plane Surface(9)= {9};
Transfinite Line {47}=10;
Transfinite Line {48}=6;
Transfinite Line {49}=10;
Transfinite Line {50}=6;
Physical Surface(3009) = {9};

// ---------------------------------------- surface 10

// ---------------------------------------- surface 11

//Point(13)={0.,y1,0.,lc};
//Point(37)={x0,y1,0.,lc};
Point(38)={x0,y2,0.,lc};
//Point(12)={0.,y2,0.,lc};
Line(51)={13,37};
Line(52)={37,38};
Line(53)={38,12};
Line(54)={12,13};
Line loop(11)={51,52,53,54};
Plane Surface(11)= {11};
Transfinite Line {51}=10;
Transfinite Line {52}=6;
Transfinite Line {53}=10;
Transfinite Line {54}=6;
Physical Surface(3011) = {11};

// ---------------------------------------- surface 12

// ---------------------------------------- surface 13

//Line(1)={1,13};
//Point(30)={0.,ya,0,lc};
//Point(13)={0.,y1,0.,lc};
Line(55)={1,30};
Line(56)={30,13};
Line(57)={13,1};
Line loop(13)={55,56,50};
Plane Surface(13)= {13};
Transfinite Line {55}=6;
Transfinite Line {56}=6;
Transfinite Line {57}=6;
Physical Surface(3013) = {13};


// ---------------------------------------- surface 14

// ---------------------------------------- surface 15

//Point(12)={0.,y2,0.,lc};
//Point(38)={x0,y2,0.,lc};
Point(39)={x0,y3,z1,lc};
//Point(11)={0.,y3,z1,lc};
Line(58)={12,38};
Line(59)={38,39};
Line(60)={39,11};
Line(61)={11,12};
Line loop(15)={58,59,60,61};
Plane Surface(15)= {15};
Transfinite Line {58}=10;
Transfinite Line {59}= 3;
Transfinite Line {60}=10;
Transfinite Line {61}= 3;
Physical Surface(3015) = {15};

// ---------------------------------------- surface 16


// ---------------------------------------- surface 17



//Point(11)={0.,y3,z1,lc};
//Point(39)={x0,y3,z1,lc};
Point(40)={x0,y4,0.,lc};
//Point(10)={0.,y4,0.,lc};
Line(62)={11,39};
Line(63)={39,40};
Line(64)={40,10};
Line(65)={10,11};
Line loop(17)={62,63,64,65};
Plane Surface(17)= {17};
Transfinite Line {62}=10;
Transfinite Line {63}= 3;
Transfinite Line {64}=10;
Transfinite Line {65}= 3;
Physical Surface(3017) = {17};


// ---------------------------------------- surface 18

// ---------------------------------------- surface 19

//Point(10)={0.,y4,0.,lc};
//Point(40)={x0,y4,0.,lc};
Point(41)={x0,y5,0.,lc};
//Point(9)={0.,y5,0.,lc};



Line(66)={10,40};
Line(67)={40,41};
Line(68)={41,9};
Line(69)={9,10};
Line loop(19)={66,67,68,69};
Plane Surface(19)= {19};
Transfinite Line {66}=10;
Transfinite Line {67}=6;
Transfinite Line {68}=10;
Transfinite Line {69}=6;
Physical Surface(3019) = {19};

// ---------------------------------------- surface 20


// ---------------------------------------- surface 21


//Point(9)={0.,y5,0.,lc};
//Point(41)={x0,y5,0.,lc};
Point(42)={x0,yz0,z0,lc};
//Point(8)={0.,yz0,z0,lc};
Line(70)={9,41};
Line(71)={41,42};
Line(72)={42,8};
Line(73)={8,9};
Line loop(21)={70,71,72,73};
Plane Surface(21)= {21};
Transfinite Line {70}=10;
Transfinite Line {71}= 2;
Transfinite Line {72}=9;
Transfinite Line {73}= 2;
Physical Surface(3021) = {21};

// ---------------------------------------- surface 22


// ---------------------------------------- surface 23

//Point(8)={0.,yz0,z0,lc};
//Point(42)={x0,yz0,z0,lc};
Point(43)={x0,y6,z1,lc};
//Point(7)={0.,y6,z1,lc};

Line(74)={8,42};
Line(75)={42,43};
Line(76)={43,7};
Line(77)={7,8};
Line loop(23)={74,75,76,77};
Plane Surface(23)= {23};
Transfinite Line {74}=9;
Transfinite Line {75}= 3;
Transfinite Line {76}=9;
Transfinite Line {77}= 3;
Physical Surface(3023) = {23};




// ---------------------------------------------Surface 2
Point(14)={0.,2.*y6-y0,z4,lc};
//Point(2)={0.,y6,z4,lc};
//Point(7)={0.,y6,z1,lc};
yz0=y5+(y6-y5)*z0/z1;
Point(17)={0.,2.*y6-yz0,z0,lc};
Point(18)={0.,2.*y6-y5,0.,lc};
Point(19)={0.,2.*y6-y4,0.,lc};
Point(20)={0.,2.*y6-y3,z1,lc};
Point(21)={0.,2.*y6-y2,0.,lc};
Point(22)={0.,2.*y6-y1,0.,lc};


Line(10)={14,2};
Line(11)={2,7};
Line(12)={7,17};
Line(13)={17,18};
Line(14)={18,19};
Line(15)={19,20};
Line(16)={20,21};
Line(17)={21,22};
Line(18)={22,14};



Line loop(2)={10,11,12,13,14,15,16,17,18};
Plane Surface(2)= {2};
Transfinite Line {18}=6;
Transfinite Line {17}=6;
Transfinite Line {16}= 3;
Transfinite Line {15}= 3;

Transfinite Line {14}=6;
Transfinite Line {13}= 2;
Transfinite Line {12}= 3;
Transfinite Line {11}= 3;

Transfinite Line {10}= 10;



Physical Surface(3002) = {2};


// ---------------------------------------- surface 4
Point(31)={0.,2.*y6-ya,0.,lc};
Point(32)={x0,2.*y6-ya,0.,lc};
Point(33)={x0,2.*y6,0.,lc};
Point(34)={0.,2.*y6,0,lc};
Line(31)={31,32};
Line(32)={32,33};
Line(33)={33,34};
Line(34)={34,31};
Line loop(4)={31,32,33,34};
Plane Surface(4)= {4};
Transfinite Line {31}=10;
Transfinite Line {32}= 2;
Transfinite Line {33}=10;
Transfinite Line {34}= 2;
Physical Surface(3004) = {4};


// ---------------------------------------- surface 6

//Point(14)={0.,2.*y6-y0,z4,lc};
Point(23)={x0,2*y6-y0,z4,lc};
//Point(32)={x0,2.*y6-ya,0.,lc};
//Point(31)={0.,2.*y6-ya,0.,lc};

Line(39)={14,23};
Line(40)={23,32};
Line(41)={32,31};
Line(42)={31,14};
Line loop(6)={39,40,41,42};
Plane Surface(6)= {6};
Transfinite Line {39}=10;
Transfinite Line {40}=6;
Transfinite Line {41}=10;
Transfinite Line {42}=6;
Physical Surface(3006) = {6};


// ---------------------------------------- surface 8
//Point(22)={0.,2.*y6-y1,0.,lc};
Point(24)={x0,2.*y6-y1,0.,lc};
//Point(23)={x0,2*y6-y0,z4,lc};
//Point(14)={0.,2.*y6-y0,z4,lc};


Line(80)={22,24};
Line(81)={24,23};
Line(82)={23,14};
Line(83)={14,22};
Line loop(8)={80,81,82,83};
Plane Surface(8)= {8};
Transfinite Line {80}=10;
Transfinite Line {81}=6;
Transfinite Line {82}=10;
Transfinite Line {83}=6;
Physical Surface(3008) = {8};


// ---------------------------------------- surface 10

//Point(22)={0.,2.*y6-y1,0.,lc};
//Point(24)={x0,2.*y6-y1,0.,lc};
//Point(32)={x0,2.*y6-ya,0.,lc};
//Point(31)={0.,2.*y6-ya,0.,lc};


Line(84)={22,24};
Line(85)={24,32};
Line(86)={32,31};
Line(87)={31,22};
Line loop(10)={84,85,86,87};
Plane Surface(10)= {10};
Transfinite Line {84}=10;
Transfinite Line {85}=6;
Transfinite Line {86}=10;
Transfinite Line {87}=6;
Physical Surface(3010) = {10};

// ---------------------------------------- surface 12
//Point(19)={0.,2.*y6-y4,0.,lc};
//Point(21)={0.,2.*y6-y2,0.,lc};
Point(50)={x0,2.*y6-y2,0.,lc};
//Point(24)={x0,2.*y6-y1,0.,lc};
//Point(22)={0.,2.*y6-y1,0.,lc};
//Point(21)={0.,2.*y6-y2,0.,lc};


Line(88)={21,50};
Line(89)={50,24};
Line(90)={24,22};
Line(91)={22,21};
Line loop(12)={88,89,90,91};
Plane Surface(12)= {12};
Transfinite Line {88}=10;
Transfinite Line {89}=6;
Transfinite Line {90}=10;
Transfinite Line {91}=6;
Physical Surface(3012) = {12};

// ---------------------------------------- surface 14

//Point(14)={0.,2.*y6-y0,z4,lc};
//Point(31)={0.,2.*y6-ya,0.,lc};
//Point(22)={0.,2.*y6-y1,0.,lc};


Line(92)={14,22};
Line(93)={22,31};
Line(94)={31,14};




Line loop(14)={92,93,94};
Plane Surface(14)= {14};
Transfinite Line {92}=6;
Transfinite Line {93}=6;
Transfinite Line {94}=6;
Physical Surface(3014) = {14};


// ---------------------------------------- surface 16
//Point(19)={0.,2.*y6-y4,0.,lc};
Point(52)={x0,2.*y6-y4,0.,lc};
Point(51)={x0,2.*y6-y3,z1,lc};
//Point(20)={0.,2.*y6-y3,z1,lc};
Line(99)={19,52};
Line(100)={52,51};
Line(101)={51,20};
Line(102)={20,19};
Line loop(16)={99,100,101,102};
Plane Surface(16)= {16};
Transfinite Line {99}=10;
Transfinite Line {100}= 3;
Transfinite Line {101}=10;
Transfinite Line {102}= 3;
Physical Surface(3016) = {16};

// ---------------------------------------- surface 18
//Point(20)={0.,2.*y6-y3,z1,lc};
//Point(51)={x0,2.*y6-y3,z1,lc}
//Point(50)={x0,2.*y6-y2,0.,lc};
//Point(21)={0.,2.*y6-y2,0.,lc};
Line(95)={20,51};
Line(96)={51,50};
Line(97)={50,21};
Line(98)={21,20};
Line loop(18)={95,96,97,98};
Plane Surface(18)= {18};
Transfinite Line {95}=10;
Transfinite Line {96}= 3;
Transfinite Line {97}=10;
Transfinite Line {98}= 3;
Physical Surface(3018) = {18};


// ---------------------------------------- surface 20



//Point(18)={0.,2.*y6-y5,0.,lc};
Point(53)={x0,2.*y6-y5,0.,lc};
//Point(52)={x0,2.*y6-y4,0.,lc};
//Point(19)={0.,2.*y6-y4,0.,lc};


Line(103)={18,53};
Line(104)={53,52};
Line(105)={52,19};
Line(106)={19,18};
Line loop(20)={103,104,105,106};
Plane Surface(20)= {20};
Transfinite Line {103}=10;
Transfinite Line {104}=6;
Transfinite Line {105}=10;
Transfinite Line {106}=6;
Physical Surface(3020) = {20};

// ---------------------------------------- surface 22
//Point(17)={0.,2.*y6-yz0,z0,lc};
Point(54)={x0,2.*y6-yz0,z0,lc};
//Point(53)={x0,2.*y6-y5,0.,lc};
//Point(18)={0.,2.*y6-y5,0.,lc};

Line(107)={17,54};
Line(108)={54,53};
Line(109)={53,18};
Line(110)={18,17};
Line loop(22)={107,108,109,110};
Plane Surface(22)= {22};
Transfinite Line {107}=9;
Transfinite Line {108}= 2;
Transfinite Line {109}=10;
Transfinite Line {110}= 2;
Physical Surface(3022) = {22};





// ---------------------------------------- surface 24
//Point(7)={0.,y6,z1,lc};
//Point(43)={x0,y6,z1,lc};
//Point(54)={x0,2.*y6-yz0,z0,lc};
//Point(17)={0.,2.*y6-yz0,z0,lc};

Line(111)={7,43};
Line(112)={43,54};
Line(113)={54,17};
Line(114)={17,7};
Line loop(24)={111,112,113,114};
Plane Surface(24)= {24};
Transfinite Line {111}=10;
Transfinite Line {112}= 3;
Transfinite Line {113}=9;
Transfinite Line {114}= 3;
//Physical Surface(3024) = {24};






// ---------------------------------------- surface 25

//Point(11)={0.,y3,z1,lc};
//Point(12)={0.,y2,0.,lc};
//Point(10)={0.,y4,0.,lc};



Line(115)={11,12};
Line(116)={12,10};
Line(117)={10,11};

Line loop(25)={115,116,117};
Plane Surface(25)= {25};
Transfinite Line {115}=6;
Transfinite Line {116}=6;
Transfinite Line {117}=6;

Physical Surface(3025) = {25};

// ---------------------------------------------Surface 26

//Point(20)={0.,2.*y6-y3,z1,lc};
//Point(19)={0.,2.*y6-y4,0.,lc};
//Point(21)={0.,2.*y6-y2,0.,lc};


Line(118)={20,19};
Line(119)={19,21};
Line(120)={21,20};

Line loop(26)={118,119,120};
Plane Surface(26)= {26};
Transfinite Line {118}=6;
Transfinite Line {119}=6;
Transfinite Line {120}=6;

Physical Surface(3026) = {26};


// ---------------------------------------------Surface 27

//Point(7)={0.,y6,z1,lc};
//Point(8)={0.,yz0,z0,lc};
//Point(17)={0.,2.*y6-yz0,z0,lc};

Line(121)={7,8};
Line(122)={8,17};
Line(123)={17,7};

Line loop(27)={77,122,123};
Plane Surface(27)= {27};
Transfinite Line {121}= 3;
Transfinite Line {122}= 5;
Transfinite Line {123}= 3;

//Physical Surface(3027) = {27};


// ---------------------------------------------Surface 28


//Point(8)={0.,yz0,z0,lc};
//Point(9)={0.,y5,0.,lc};
//Point(18)={0.,2.*y6-y5,0.,lc};
//Point(17)={0.,2.*y6-yz0,z0,lc};

Line(124)={8,9};
Line(125)={9,18};
Line(126)={18,17};
Line(127)={17,8};

Line loop(28)={73,125,126,127};
Plane Surface(28)= {28};
Transfinite Line {124}= 1;
Transfinite Line {125}=6;
Transfinite Line {126}= 1;
Transfinite Line {127}= 5;
Physical Surface(3028) = {28};


// ---------------------------------------------Surface 29

//Point(12)={0.,y2,0.,lc};
//Point(38)={x0,y2,0.,lc};
//Point(40)={x0,y4,0.,lc};
//Point(10)={0.,y4,0.,lc};

Line(128)={12,38};
Line(129)={38,40};
Line(130)={40,10};
Line(131)={10,12};

Line loop(29)={58,129,64,131};
Plane Surface(29)= {29};
Transfinite Line {128}=10;
Transfinite Line {129}=6;
Transfinite Line {130}=10;
Transfinite Line {131}=6;
Physical Surface(3029) = {29};


// ---------------------------------------------Surface 30

//Point(21)={0.,2.*y6-y2,0.,lc};
//Point(19)={0.,2.*y6-y4,0.,lc};
//Point(52)={x0,2.*y6-y4,0.,lc};
//Point(50)={x0,2.*y6-y2,0.,lc};


Line(132)={21,19};
Line(133)={19,52};
Line(134)={52,50};
Line(135)={50,21};

Line loop(30)={132,133,134,135};
Plane Surface(30)= {30};
Transfinite Line {132}=6;
Transfinite Line {133}=10;
Transfinite Line {134}=6;
Transfinite Line {135}=10;
Physical Surface(3030) = {30};



// ---------------------------------------------Surface 31

//Point(9)={0.,y5,0.,lc};
//Point(18)={0.,2.*y6-y5,0.,lc};
//Point(53)={x0,2.*y6-y5,0.,lc};
//Point(41)={x0,y5,0.,lc};
Line(136)={9,18};
Line(137)={18,53};
Line(138)={53,41};
Line(139)={41,9};

Line loop(31)={136,137,138,68};
Plane Surface(31)= {31};
Transfinite Line {136}=6;
Transfinite Line {137}=10;
Transfinite Line {138}=6;
Transfinite Line {139}=10;
Physical Surface(3031) = {31};







Physical Line(2000) = {40,81,96,100,112,75,63,59,48,36};

 



//-optimize[_netgen]
//-order 2     -optimize_lloyd   -optimize _netgen
//rm tracker.msh   &&   gmsh  tracker.geo -2      -order 2     -o tracker.msh  
//-algo string  -refine 

//    Select mesh algorithm (meshadapt, del2d, front2d, delquad, del3d, front3d, mmg3d, pack) -algo meshadapt

//rm tracker.msh   &&   gmsh  tracker.geo -2      -order 2     -o tracker.msh  
 


