From 216f40cedb6ce16f24f1bcad55a8ecf1f2093f02 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 1 Jan 2015 16:45:45 +0000 Subject: [PATCH] knifeblock: Fewer holes --- knifeblock.scad | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/knifeblock.scad b/knifeblock.scad index 4ca20e7..7ea6079 100644 --- a/knifeblock.scad +++ b/knifeblock.scad @@ -215,7 +215,9 @@ module CoverPegSlot(coverlen){ } module HoleRow(){ - for (i=[0:10]) { + imax = ceil(coverlonglen / holepitch); + echo("Holes Y count ", imax); + for (i=[0:imax]) { translate([0, (i+0.5)*holepitch, -20]) cylinder(r=holesize/2, h=40, $fn=20); } @@ -232,9 +234,11 @@ module HolesScope(){ } module Holes(){ + imin = ceil((maxx-minx)/(sqrt(3)*holepitch)); + echo("Holes X count 2 x", imin); intersection(){ translate([holeoffx * holepitch, holeoffy * holepitch, 0]) { - for (i=[-10:10]) { + for (i=[-imin:2]) { translate([i * sqrt(3) * holepitch, 0, 0]) { HoleRow(); translate([sqrt(3)/2 * holepitch, -0.5 * holepitch, 0]) -- 2.30.2