$fn=128; straal=50; phi=360*$t; rotate ([0,0,phi]) { Boog (straal); translate ([0.5*straal*sqrt(3),-straal/2,0]) rotate ([0,0,120]) Boog (straal); translate ([0.5*straal*sqrt(3),straal/2,0]) rotate ([0,0,240]) Boog (straal); }; // rode cirkel color ([1,0,0,1]) difference() { cylinder (0.3,straal+0.85,straal+0.85); translate ([0,0,-1]) cylinder (2,straal+0.25,straal+0.25); }; // animatie van het raam in de twaalf fasen van een enkele omwenteling if (phi>=0&&phi<30) { vert=straal*sin(phi+30)-straal/2; hor=0; echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=30&&phi<60) { vert=straal*sin(phi+30)-straal/2; hor=-straal+straal*cos(phi-30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=60&&phi<90) { vert=straal/2; hor=-straal+straal*cos(phi-30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=90&&phi<120) { vert=straal/2; hor=straal*cos(phi+30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=120&&phi<150) { vert=straal*sin(phi-30)-straal/2; hor=straal*cos(phi+30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=150&&phi<180) { vert=straal*sin(phi-30)-straal/2; hor=-straal; echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=180&&phi<210) { vert=straal*sin(phi+30)+straal/2; hor=-straal; echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=210&&phi<240) { vert=straal*sin(phi+30)+straal/2; hor=straal*cos(phi-30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=240&&phi<270) { vert=-straal/2; hor=straal*cos(phi-30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=270&&phi<300) { vert=-straal/2; hor=-straal+straal*cos(phi+30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=300&&phi<330) { vert=straal*sin(phi-30)+straal/2; hor=-straal+straal*cos(phi+30); echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference } if (phi>=330&&phi<360) { vert=straal*sin(phi-30)+straal/2; hor=0; echo("vert=",vert,"hor=",hor); translate ([hor,vert,0]) color ([0,0.6,0,1]) difference() { translate ([straal/2,0,0]) cube ([straal+8,straal+8,2],true); translate ([straal/2,0,0]) cube ([straal,straal,4],true); }; // einde difference }; module Boog (straal) { rotate ([0,0,-30]) rotate_extrude (angle=60,convexity=10) translate ([straal-0.25,0,0]) square ([0.5,1.1]); color ("grey") rotate ([0,0,-30]) translate ([0,-0.1,0]) cube ([straal,0.2,1]); }; // einde module Boog