/* Geometria basica para represa */

// Parametros globales geometria

// Anchos en [m]
B1 = 100;
B2 =  60;
B3 = 100;
B4 = 120;
B5 =  20;
B6 = 120;
B7 = 100;
B8 =  60;
B9 = 100;

Btot = B1 + B2 + B3;

//Largos en [m]
L1 = 120;
L2 = 6;
L3 = 120;

Ltot = L1 + L2 + L3;


//Altos en [m]
h1 = 76;
h2 = 10;

htot = h1 + h2;

// Tamaño de elementos 
tam = 200;  


//Puntos
Point(1) = {-Btot/2 + B1, 0, 0, tam};
Point(2) = {-Btot/2 + B1 + B2, 0, 0, tam};
Point(3) = {-Btot/2 + B4, L1, -(L1 + L2/2)*h2/Ltot, tam};
Point(4) = {-Btot/2 + B4 + B5, L1, -(L1 + L2/2)*h2/Ltot, tam};
Point(5) = {-Btot/2 + B4, L1+L2, -(L1 + L2/2)*h2/Ltot, tam};
Point(6) = {-Btot/2 + B4 + B5, L1+L2, -(L1 + L2/2)*h2/Ltot, tam};
Point(7) = {-Btot/2 + B7, Ltot, -h2, tam};
Point(8) = {-Btot/2 + B7 + B8, Ltot, -h2, tam};
Point(9) = {-Btot/2, L1, h1, tam};
Point(10) = {-Btot/2 + B4 + B5 + B6, L1, h1, tam};
Point(11) = {-Btot/2, L1+L2, h1, tam};
Point(12) = {-Btot/2 + B4 + B5 + B6, L1+L2, h1, tam};


//Lineas
l01 = newl; Line(l01) = {1, 2};
l02 = newl; Line(l02) = {2, 4};
l03 = newl; Line(l03) = {4, 3};
l04 = newl; Line(l04) = {3, 1};

l05 = newl; Line(l05) = {3, 5};
l06 = newl; Line(l06) = {5, 6};
l07 = newl; Line(l07) = {6, 4};

l08 = newl; Line(l08) = {5, 7};
l09 = newl; Line(l09) = {7, 8};
l10 = newl; Line(l10) = {8, 6};

l11 = newl; Line(l11) = {2, 10};
l12 = newl; Line(l12) = {10, 12};
l13 = newl; Line(l13) = {12, 8};

l14 = newl; Line(l14) = {1, 9};
l15 = newl; Line(l15) = {9, 11};
l16 = newl; Line(l16) = {11, 7};

l17 = newl; Line(l17) = {9, 10};
l18 = newl; Line(l18) = {11, 12};

l19 = newl; Line(l19) = {9, 3};
l20 = newl; Line(l20) = {11, 5};
l21 = newl; Line(l21) = {10, 4};
l22 = newl; Line(l22) = {12, 6};

Line Loop(23) = {1, 2, 3, 4};
Plane Surface(24) = {23};
Line Loop(25) = {11, 21, -2};
Plane Surface(26) = {25};
Line Loop(27) = {12, 22, 7, -21};
Plane Surface(28) = {27};
Line Loop(29) = {22, -10, -13};
Plane Surface(30) = {29};
Line Loop(31) = {6, -10, -9, -8};
Plane Surface(32) = {31};
Line Loop(33) = {6, 7, 3, 5};
Plane Surface(34) = {33};
Line Loop(35) = {4, 14, 19};
Plane Surface(36) = {35};
Line Loop(37) = {19, 5, -20, -15};
Plane Surface(38) = {37};
Line Loop(39) = {20, 8, -16};
Plane Surface(40) = {39};
Line Loop(41) = {14, 17, -11, -1};
Plane Surface(42) = {41};
Line Loop(43) = {17, 12, -18, -15};
Plane Surface(44) = {43};
Line Loop(45) = {18, 13, -9, -16};
Plane Surface(46) = {45};

Surface Loop(47) = {26, 42, 36, 24, 34, 32, 30, 28, 44, 46, 40, 38};
Volume(48) = {47};
