From f1d12e9ebedd163c27c05abbe2be40e6ae8ed33b Mon Sep 17 00:00:00 2001 From: Elmom Date: Thu, 3 Mar 2011 15:37:30 +0200 Subject: [PATCH] Added polyholes.scad from Nophead --- polyholes.scad | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 polyholes.scad diff --git a/polyholes.scad b/polyholes.scad new file mode 100644 index 0000000..003efa4 --- /dev/null +++ b/polyholes.scad @@ -0,0 +1,25 @@ +// Copyright 2011 Nophead (of RepRap fame) + +// Using this holes should come out approximately right when printed +module polyhole(h, d) { + n = max(round(2 * d),3); + rotate([0,0,180]) + cylinder(h = h, r = (d / 2) / cos (180 / n), $fn = n); +} + +module test_polyhole(){ +difference() { + cube(size = [100,27,3]); + union() { + for(i = [1:10]) { + translate([(i * i + i)/2 + 3 * i , 8,-1]) + polyhole(h = 5, d = i); + + assign(d = i + 0.5) + translate([(d * d + d)/2 + 3 * d, 19,-1]) + polyhole(h = 5, d = d); + } + } +} +} +