depth=3; circDiam=25; thickness=3; slitWidth=1; //max 1/3 of thickness smRing=1; //add a small ring? 0=no, 1=yes //---------------------- circRad=circDiam/2; if (smRing==0){ bigCircle(); } if (smRing==1){ difference(){ union(){ bigCircle(); translate([circRad*1.5-thickness,0,0]) tube(depth,circRad/2,thickness); } translate([circRad-thickness/2,0,depth/2]) box(thickness*2,thickness,depth); } } module bigCircle(){ difference(){ tube(depth,circRad,thickness); circSlit(); vertSlit(); } } module circSlit(){ difference(){ tube(depth,circRad-thickness/2+slitWidth/2,slitWidth); translate([circRad/2,0,depth/2]) box(circRad,circDiam,depth); } } module vertSlit(){ translate([-slitWidth/2,circRad-thickness/4,depth/2]) box(slitWidth,thickness/2,depth); translate([-slitWidth/2,-circRad+thickness*3/4+slitWidth/2,depth/2]) box(slitWidth,thickness/2,depth); } //---------------------- module box(w,h,d) { scale ([w,h,d]) cube(1, true); } module roundedBox(w,h,d,f){ difference(){ box(w,h,d); translate([-w/2,h/2,0]) cube(w/(f/2),true); translate([w/2,h/2,0]) cube(w/(f/2),true); translate([-w/2,-h/2,0]) cube(w/(f/2),true); translate([w/2,-h/2,0]) cube(w/(f/2),true); } translate([-w/2+w/f,h/2-w/f,-d/2]) cylinder(d,w/f, w/f); translate([w/2-w/f,h/2-w/f,-d/2]) cylinder(d,w/f, w/f); translate([-w/2+w/f,-h/2+w/f,-d/2]) cylinder(d,w/f, w/f); translate([w/2-w/f,-h/2+w/f,-d/2]) cylinder(d,w/f, w/f); } module cone(height, radius) { cylinder(height, radius, 0); } module oval(w,h,d) { scale ([w/100, h/100, 1]) cylinder(d, 50, 50); } module tube(height, radius, wall) { difference(){ cylinder(height, radius, radius); cylinder(height, radius-wall, radius-wall); } } module ovalTube(w,h,d,wall) { difference(){ scale ([w/100, h/100, 1]) cylinder(d, 50, 50); scale ([w/100, h/100, 1]) cylinder(d, 50-wall, 50-wall); } } module hexagon(height, depth) { boxWidth=height/1.75; union(){ box(boxWidth, height, depth); rotate([0,0,60]) box(boxWidth, height, depth); rotate([0,0,-60]) box(boxWidth, height, depth); } } module octagon(height, depth) { intersection(){ box(height, height, depth); rotate([0,0,45]) box(height, height, depth); } } module dodecagon(height, depth) { intersection(){ hexagon(height, depth); rotate([0,0,90]) hexagon(height, depth); } } module hexagram(height, depth) { boxWidth=height/1.75; intersection(){ box(height, boxWidth, depth); rotate([0,0,60]) box(height, boxWidth, depth); } intersection(){ box(height, boxWidth, depth); rotate([0,0,-60]) box(height, boxWidth, depth); } intersection(){ rotate([0,0,60]) box(height, boxWidth, depth); rotate([0,0,-60]) box(height, boxWidth, depth); } } module rightTriangle(adjacent, opposite, depth) { difference(){ translate([-adjacent/2,opposite/2,0]) box(adjacent, opposite, depth); translate([-adjacent,0,0]){ rotate([0,0,atan(opposite/adjacent)]) dislocateBox(adjacent*2, opposite, depth); } } } module equiTriangle(side, depth) { difference(){ translate([-side/2,side/2,0]) box(side, side, depth); rotate([0,0,30]) dislocateBox(side*2, side, depth); translate([-side,0,0]){ rotate([0,0,60]) dislocateBox(side*2, side, depth); } } } module 12ptStar(height, depth) { starNum=3; starAngle=360/starNum; for (s=[1:starNum]){ rotate([0, 0, s*starAngle]) box(height, height, depth); } } //----------------------- //MOVES THE ROTATION AXIS OF A BOX FROM ITS CENTER TO THE LEFT BOTTOM CORNER module dislocateBox(xBox, yBox, zBox){ translate([xBox/2,yBox,0]){ difference(){ box(xBox, yBox*2, zBox+1); translate([-xBox,0,0]) box(xBox, yBox*2, zBox+1); } } }