X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=knifeblock.scad;h=7ea6079d580a4221ad95a69e589f6909b885a4ac;hp=4ca20e79a2012ccfc4c9a04a8a2a641780bf6c3f;hb=216f40cedb6ce16f24f1bcad55a8ecf1f2093f02;hpb=51efd75aedf175d4883f14512140bbe740e8699d 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])