X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=knifeblock.scad;h=603336a9ff432d196aca79156c14a7286bc43713;hb=ce58de89f72cb0668884f75bfd6718e2a093df60;hp=1133e1cffbc106b3d3275bf9c68f96ab3383c6a3;hpb=f89c049a0a2ffb07b75f093e542e4712399db629;p=reprap-play.git diff --git a/knifeblock.scad b/knifeblock.scad index 1133e1c..603336a 100644 --- a/knifeblock.scad +++ b/knifeblock.scad @@ -5,7 +5,7 @@ nknives = 3; widths = [15.5, 15.8, 19.0]; handlelenbase = 75; handlelendelta = [-15, 0, 10]; -locations = [-35, 0, 40]; +locations = [-35, 0, 37]; bladew = 5; // 2.5 maxhandledepth = 45; @@ -23,6 +23,8 @@ minsideout = 4; frontbackslop = 0.25; +knifewidthslop = 2.0; + screwbackdepth = 6.0 - 1.0; screwdia = 4.0 + 0.5; screwcsinkdia = 9.8 + 1.0; @@ -40,8 +42,8 @@ holesize = 12.5; holestrut = 7; holeedge = 4; -holeoffx = 0.45; -holeoffy = 0.25; +holeoffx = 0.33; +holeoffy = 0.23; pegstem = 3.5; peghead = 10; @@ -59,11 +61,14 @@ pegslopl = 0.5; pegdepthproportion = 0.80; // computed + +function width(k) = widths[k] + knifewidthslop; + side = minsidein + screwcsinkdia + minsideout; totaldepth = front + maxhandledepth + back; -minkx = locations[0] - widths[0] /2; -maxkx = locations[nknives-1] + widths[nknives-1]/2; +minkx = locations[0] - width(0) /2; +maxkx = locations[nknives-1] + width(nknives-1)/2; minx = minkx - side; maxx = maxkx + side; @@ -83,9 +88,9 @@ module ImportTemplate(w,k,t) { module Knife(k){ ImportTemplate(bladew, k,"bl"); hull(){ - ImportTemplate(widths[k], k,"hl"); + ImportTemplate(width(k), k,"hl"); translate([-100,0,0]) - ImportTemplate(widths[k], k,"hl"); + ImportTemplate(width(k), k,"hl"); } } @@ -128,7 +133,7 @@ module AtSides(){ } module BlockPegSlot(){ - translate([recessblockwidth/2, pegrecess - 0.5*peglen, -height]){ + translate([recessblockwidth/2, pegrecess - peglen, -height]){ rotate([-90,0,0]) linear_extrude(height=totaldepth){ PegTemplate(peghead/2 * 1.2); } @@ -163,9 +168,9 @@ module CoverTemplate(){ linear_extrude(height=coverthick) polygon([[minx, 0], [maxx, 0], - [maxx, coverlonglen], - [maxx - coverside, coverlonglen], - [minx, covershortlen]]); + [maxx, coverlonglen+0.1], + [maxx - coverside, coverlonglen+0.1], + [minx, covershortlen+0.1]]); } module CoverSide(len){ @@ -209,34 +214,43 @@ module CoverPegSlot(coverlen){ } } -module HoleRow(){ - for (i=[0:10]) { - translate([0, (i+0.5)*holepitch, -1]) - cylinder(r=holesize/2, h=coverthick+2, $fn=20); - } -} - module HolesScope(){ intersection_for (dx=[-1,+1]) { intersection_for (dy=[-1,+1]) { - translate([dx * holeedge, dy * holeedge, -1]) - scale([1,1,2]) + translate([dx * holeedge, dy * holeedge, -5]) + scale([1,1,10]) CoverTemplate(); } } } -module Holes(){ - intersection(){ - translate([holeoffx * holepitch, holeoffy * holepitch, 0]) { - for (i=[-10:10]) { - translate([i * sqrt(3) * holepitch, 0, 0]) { - HoleRow(); - translate([sqrt(3)/2 * holepitch, -0.5 * holepitch, 0]) - HoleRow(); - } +module HexGrid(imin,imax,jmin,jmax) { + for (i=[imin:imax]) { + for (j=[jmin:jmax]) { + translate([(j * sqrt(3) + holeoffx) * holepitch, + (i + 0.5 + holeoffy) * holepitch, + 0]) { + child(); + translate([sqrt(3)/2 * holepitch, -0.5 * holepitch, 0]) + child(); } } + } +} + +module Hole(){ + cylinder(r=holesize/2, h=40, $fn=40); +} + +module Holes(){ + imax = ceil(coverlonglen / holepitch); + echo("Holes Y count ", imax); + jmin = ceil((maxx-minx)/(sqrt(3)*holepitch)); + echo("Holes X count 2 x", jmin); + intersection(){ + translate([0, 0, -20]) + HexGrid(0,imax,-jmin,2) + Hole(); HolesScope(); } } @@ -276,12 +290,15 @@ module Demo(){ ////toplevel color([1,0,0]) AtSides() { DemoPeg(); DemoPeg(); } } +module Pegs(){ ////toplevel + Peg(); + translate([-peghead-3, 0,0]) Peg(); +} + module CoverParts(){ ////toplevel Cover(); - translate([0, coverlonglen, pegheight/2]) { - Peg(); - translate([-peghead-3, 0,0]) Peg(); - } + translate([0, coverlonglen, pegheight/2-pegslopv]) + Pegs(); } //Block(); @@ -290,3 +307,6 @@ module CoverParts(){ ////toplevel //CoverParts(); //Peg(); //Cover(); +//Holes(); +//%CoverTemplate(); +//Pegs();