Skip to content

Instantly share code, notes, and snippets.

@GilesBathgate
Last active April 21, 2017 23:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GilesBathgate/cb0bde17fa81045337e8 to your computer and use it in GitHub Desktop.
Save GilesBathgate/cb0bde17fa81045337e8 to your computer and use it in GitHub Desktop.
nozzle_dia=0.4;
layer_height=0.3;
function pi() = 3.141592;
function width(d,h) = h-(pi()*((h*h)-(d*d)))/(4*h);
function arc(r,t) = 0.5*(t+sqrt((t*t)+4*(r*r)));
function polyhole(r,n,t) = arc(r,t)/cos(180/n);
function sides(d,t) = ceil(180 / acos((d-t)/d));
module hole(d,h)
{
n=sides(d,0.1);
t=width(nozzle_dia,layer_height);
pr=polyhole(d/2,n,t);
echo(d,n,pr*2);
translate([0,0,-1])cylinder(r=pr,h=h+2,$fn=n);
}
module main() {
difference() {
linear_extrude(5) {
hull(){
rotate([0,0,-46.5])
translate([5,2])
square([0.001,168]);
rotate([0,0,-43.5])
translate([-5,2])
square([0.001,168]);
}
}
rotate([0,0,-45])
for(i=[1:0.5:10])
translate([0,i*(i+6),0])hole(i,5);
}
}
translate([10,10,0])main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment