/* makes Christmas stars from pentagrams if mark = 1 simple star if mark = 2 star with flattened faces hole for hanging added pcm December 2013 */ //mark = 1; //mark = 2; mark = 1; difference() { if (mark==1) pentagram_solid_x2(60,0,10); else if (mark==2) pentagram_solid_x2(60,15,10); translate([40,0,0]) cylinder(r=1.5,h=20,$fn=24,center=true); } module pentagram_solid_x2(l1,l2,t) { /* l1 and l2 are the lengths of the sides of the enclosing pentagons l2 top and bottom, l1 middle they are centered at the origin t is half the thickness of the construct pcm December 2013 */ rr1 = sqrt((l1*l1)/(2-2*cos(72))); rr2 = sqrt((l2*l2)/(2-2*cos(72))); gr = (1 + sqrt(5.))/2; h = 1/gr; g = 1 - h; polyhedron ( points =[ [ rr1,0 ,0], [h*rr1+g*cos(144)*rr1,g*sin(144)*rr1,0], [ cos(72)*rr1,sin(72)*rr1,0], [h*cos(72)*rr1+g*cos(216)*rr1,h*sin(72)*rr1+g*sin(216)*rr1,0], [ cos(144)*rr1,sin(144)*rr1,0], [h*cos(144)*rr1+g*cos(288)*rr1,h*sin(144)*rr1+g*sin(288)*rr1,0], [ cos(216)*rr1,sin(216)*rr1,0], [h*cos(216)*rr1+g*rr1,h*sin(216)*rr1,0], [ cos(288)*rr1,sin(288)*rr1,0], [h*cos(288)*rr1+g*cos(72)*rr1,h*sin(288)*rr1+g*sin(72)*rr1,0], [ rr2,0 ,t], [h*rr2+g*cos(144)*rr2,g*sin(144)*rr2,t], [ cos(72)*rr2,sin(72)*rr2,t], [h*cos(72)*rr2+g*cos(216)*rr2,h*sin(72)*rr2+g*sin(216)*rr2,t], [ cos(144)*rr2,sin(144)*rr2,t], [h*cos(144)*rr2+g*cos(288)*rr2,h*sin(144)*rr2+g*sin(288)*rr2,t], [ cos(216)*rr2,sin(216)*rr2,t], [h*cos(216)*rr2+g*rr2,h*sin(216)*rr2,t], [ cos(288)*rr2,sin(288)*rr2,t], [h*cos(288)*rr2+g*cos(72)*rr2,h*sin(288)*rr2+g*sin(72)*rr2,t], [ rr2,0 ,-t], [h*rr2+g*cos(144)*rr2,g*sin(144)*rr2,-t], [ cos(72)*rr2,sin(72)*rr2,-t], [h*cos(72)*rr2+g*cos(216)*rr2,h*sin(72)*rr2+g*sin(216)*rr2,-t], [ cos(144)*rr2,sin(144)*rr2,-t], [h*cos(144)*rr2+g*cos(288)*rr2,h*sin(144)*rr2+g*sin(288)*rr2,-t], [ cos(216)*rr2,sin(216)*rr2,-t], [h*cos(216)*rr2+g*rr2,h*sin(216)*rr2,-t], [ cos(288)*rr2,sin(288)*rr2,-t], [h*cos(288)*rr2+g*cos(72)*rr2,h*sin(288)*rr2+g*sin(72)*rr2,-t], ], triangles = [ [20,21,29],[21,22,23], [23,24,25],[25,26,27], [27,28,29],[21,23,25], [29,21,25],[25,27,29], [10,19,11],[11,13,12], [13,15,14],[15,17,16], [17,19,18],[11,15,13], [19,15,11],[15,19,17], [0,9,10],[19,10,9], [1,0,11],[10,11,0], [2,1,12],[11,12,1], [3,2,12],[12,13,3], [4,3,14],[13,14,3], [5,4,15],[14,15,4], [6,5,16],[15,16,5], [7,6,17],[16,17,6], [8,7,18],[17,18,7], [9,8,19],[18,19,8], [0,20,9],[20,29,9], [0,1,21],[21,20,0], [1,2,22],[22,21,1], [2,3,22],[23,22,3], [3,4,24],[24,23,3], [4,5,25],[25,24,4], [5,6,26],[26,25,5], [6,7,27],[27,26,6], [7,8,28],[28,27,7], [8,9,29],[29,28,8], ]); }