scad/lib/Icosahedron.scad

23 lines
947 B
OpenSCAD
Raw Permalink Normal View History

2024-06-24 15:56:57 +02:00
/*****************************************************************
* Icosahedron By Adam Anderson
*
* This module allows for the creation of an icosahedron scaled up
* by a factor determined by the module parameter.
* The coordinates for the vertices were taken from
* http://www.sacred-geometry.es/?q=en/content/phi-sacred-solids
*************************************************************/
module icosahedron(a = 2) {
phi = a * ((1 + sqrt(5)) / 2);
polyhedron(
points = [
[0,-phi, a], [0, phi, a], [0, phi, -a], [0, -phi, -a], [a, 0, phi], [-a, 0, phi], [-a, 0, -phi],
[a, 0, -phi], [phi, a, 0], [-phi, a, 0], [-phi, -a, 0], [phi, -a, 0]
],
faces = [
[0,5,4], [0,4,11], [11,4,8], [11,8,7], [4,5,1], [4,1,8], [8,1,2], [8,2,7], [1,5,9], [1,9,2], [2,9,6], [2,6,7], [9,5,10], [9,10,6], [6,10,3], [6,3,7], [10,5,0], [10,0,3], [3,0,11], [3,11,7]
]
);
}