Dodecaedro

Dodecaedro

 

// Dodecaedro

module dodecaedro(aresta=1){

// Aresta

a=aresta;

// Cálculo da altura da figura (tramos inferior e superior máis tramo intermedio)

// Tramo intermedio (coincidente coa magnitude da proxección horizontal das arestas radiais na planta da figura)

h1=(a/2)/cos(18);

//Tramos superior e inferior (coincidentes coa magnitude da proxección horizontal das arestas perimetrais na planta da figura)

h2=(a/2)/sin(36);

// Altura total.

h=h1+2*h2;

// Cotas

c1=(-1/2)*h;
c2=(-1/2)*h1;
c3=(1/2)*h1;
c4=(1/2)*h;

// Distancia entre a proxección horixontal do vértices situados nas cotas c2 e c1 e a proxección horizontal do centro da esfera na que se circunscribe a figura.

d=h1+h2;

// Construción da figura


polyhedron(

points=[

[h2,0,c1], //0
[(1/2)*h1,h2*cos(18),c1], //1
[-h2*cos(36),(1/2)*a,c1], //2
[-h2*cos(36),(-1/2)*a,c1], //3
[(1/2)*h1,-h2*cos(18),c1], //4

[d,0,c2], //5
[(1/2)*h2,d*cos(18),c2], //6
[-d*cos(36),d*sin(36),c2], //7
[-d*cos(36),-d*sin(36),c2], //8
[(1/2)*h2,-d*cos(18),c2], //9

[-d,0,c3], //10
[(-1/2)*h2,-d*cos(18),c3], //11
[d*cos(36),-d*sin(36),c3], //12
[d*cos(36),d*sin(36),c3], //13
[(-1/2)*h2,d*cos(18),c3], //14

[-h2,0,c4], //15
[(-1/2)*h1,-h2*cos(18),c4], //16
[h2*cos(36),(-1/2)*a,c4], //17
[h2*cos(36),(1/2)*a,c4], //18
[(-1/2)*h1,h2*cos(18),c4] //19

],

triangles=[

[0,1,2], [0,2,3], [0,3,4],

[0,5,13], [0,13,1], [1,13,6],
[1,6,14], [1,14,2], [2,14,7],
[2,7,10], [2,10,3], [3,10,8],
[3,8,11], [3,11,4], [4,11,9],
[4,9,12], [4,12,0], [0,12,5],

[8,10,15], [8,15,16], [8,16,11],
[9,11,16],[9,16,17],[9,17,12],
[5,12,17],[5,17,18],[5,18,13],
[6,13,18],[6,18,19],[6,19,14],
[7,14,19],[7,19,15],[7,15,10],

[15,17,16],[15,18,17],[15,19,18]

]

);

}

//Usamos o módulo

dodecaedro();