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=53654e58afb241dbf841cd7214c5efd95753852a;hb=216f40cedb6ce16f24f1bcad55a8ecf1f2093f02;hpb=144b5cc39ec1e9fba5330018388a43a1fb9fad6d diff --git a/knifeblock.scad b/knifeblock.scad index 53654e5..7ea6079 100644 --- a/knifeblock.scad +++ b/knifeblock.scad @@ -3,20 +3,27 @@ // properties of the knives nknives = 3; widths = [15.5, 15.8, 19.0]; -handlelenbase = 60; -handlelendelta = [-10, 0, 0]; -locations = [-35, 0, 40]; +handlelenbase = 75; +handlelendelta = [-15, 0, 10]; +locations = [-35, 0, 37]; bladew = 5; // 2.5 -maxhandledepth = 43.5 - 5; +maxhandledepth = 45; + +templatescale = 27.2 / 19.6; + +coverlonglen = 120; // xxx +covershortlen = 70; // xxx // other tuneables front = 5; -back = 8; +back = 5; height = 50; minsidein = 4; minsideout = 4; -frontbackslop = 0.5; +frontbackslop = 0.25; + +knifewidthslop = 2.0; screwbackdepth = 6.0 - 1.0; screwdia = 4.0 + 0.5; @@ -24,24 +31,66 @@ screwcsinkdia = 9.8 + 1.0; screwabove = 15; +coverthick = 2.4; +coverside = coverthick; + +covertopwing = 15; +covertopwingbase = 20; +coveredge = 3; + +holesize = 12.5; +holestrut = 7; +holeedge = 4; + +holeoffx = 0.33; +holeoffy = 0.23; + +pegstem = 3.5; +peghead = 10; +pegstemheight = 2; +pegheight = 9; +peglen = 12; + +recessblockwidth = peghead + pegstem*3; +recessblockheight = peglen/2 + pegstem*1.5; + +pegsloph = 0.5; +pegslopv = 0.5; +pegslopl = 0.5; + +pegdepthproportion = 0.80; + // computed + +function width(k) = widths[k] + knifewidthslop; + side = minsidein + screwcsinkdia + minsideout; totaldepth = front + maxhandledepth + back; +minkx = locations[0] - width(0) /2; +maxkx = locations[nknives-1] + width(nknives-1)/2; + +minx = minkx - side; +maxx = maxkx + side; + +holepitch = holesize+holestrut; + +pegrecess = pegdepthproportion*totaldepth - 0.5*peglen; + module ImportTemplate(w,k,t) { fn = str("knifeblock-knives-t",k,t,".dxf"); echo(fn); translate([0,0, -w/2]) linear_extrude(height=w) - import(file=fn, convexity=100); + scale(templatescale) import(file=fn, convexity=100); } 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"); } } @@ -54,12 +103,8 @@ module DoKnife(k){ } module DoKnives(){ - for (yshift=[-1,1]) { - translate([0, yshift * frontbackslop, 0]) - for (k=[0:nknives-1]) { - DoKnife(k); - } - } + for (k=[0:nknives-1]) + DoKnife(k); } module ScrewHole(){ @@ -71,30 +116,186 @@ module ScrewHole(){ cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6); } -module Block(){ - minkx = locations[0] - widths[0] /2; - maxkx = locations[nknives-1] + widths[nknives-1]/2; +module PegTemplate(apex){ + for (mx=[0,1]) for (my=[0,1]) { + mirror([mx,0,0]) mirror([0,my,0]) + polygon([[-0.1, -0.1], + [pegstem/2, -0.1], + [pegstem/2, pegstemheight/2], + [peghead/2, pegheight /2], + [-0.1, pegheight /2 + apex]]); + } +} + +module AtSides(){ + translate([minx,0,0]) child(0); + translate([maxx,0,0]) mirror([1,0,0]) child(1); +} - minx = minkx - side; - maxx = maxkx + side; +module BlockPegSlot(){ + translate([recessblockwidth/2, pegrecess - 0.5*peglen, -height]){ + rotate([-90,0,0]) linear_extrude(height=totaldepth){ + PegTemplate(peghead/2 * 1.2); + } + } +} +module Block(){ sidemidx = minsideout + screwcsinkdia/2; difference(){ - hull() mirror([0,0,1]) { - translate([minx, 0, 0]) - cube([maxx-minx, totaldepth-front, height]); - for (x=[minx + front/2, maxx - front/2]) - translate([x, -front/2, 0]) - cylinder(r=front/2, h=height, $fn=30); + mirror([0,0,1]) { + translate([minx, -front, 0]) + cube([maxx-minx, totaldepth, height]); } for (x=[minx + sidemidx, maxx - sidemidx]) { translate([x, 0, -screwabove]) ScrewHole(); } - DoKnives(); + for (yshift=[-1,1]) + translate([0, yshift * frontbackslop, 0]) + DoKnives(); + AtSides() { BlockPegSlot(); BlockPegSlot(); } + } +} + +module BlockPrint(){ ////toplevel + rotate([0,0,90]) + Block(); +} + +module CoverTemplate(){ + linear_extrude(height=coverthick) + polygon([[minx, 0], + [maxx, 0], + [maxx, coverlonglen], + [maxx - coverside, coverlonglen], + [minx, covershortlen]]); +} + +module CoverSide(len){ + translate([0, 0 ,0]) { + rotate([90,0,90]) + linear_extrude(height=coverside) + polygon([[0, 0], + [0, totaldepth], + [covertopwing, totaldepth], + [covertopwingbase, coverside + coverthick], + [len - covertopwingbase, coverside + coverthick], + [len - covertopwing, totaldepth], + [len, totaldepth], + [len, 0]]); + cube([recessblockwidth, recessblockheight, totaldepth]); + } +} + +module Peg(){ + echo("peg angle slope (must be <1)", + (peghead-pegstem)/(pegheight-pegstemheight)); + dx = pegsloph; + dy = pegslopv; + rotate([90,0,0]) { + linear_extrude(height=peglen-pegslopl) { + intersection(){ + translate([-dx,-dy,0]) PegTemplate(0); + translate([-dx,+dy,0]) PegTemplate(0); + translate([+dx,+dy,0]) PegTemplate(0); + translate([+dx,-dy,0]) PegTemplate(0); + } + } + } +} + +module CoverPegSlot(coverlen){ + translate([recessblockwidth/2, 0, -1]){ + linear_extrude(height= 1 + pegrecess + 0.5*peglen){ + PegTemplate(0); + } + } +} + +module HoleRow(){ + 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); + } +} + +module HolesScope(){ + intersection_for (dx=[-1,+1]) { + intersection_for (dy=[-1,+1]) { + translate([dx * holeedge, dy * holeedge, -5]) + scale([1,1,10]) + CoverTemplate(); + } + } +} + +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=[-imin:2]) { + translate([i * sqrt(3) * holepitch, 0, 0]) { + HoleRow(); + translate([sqrt(3)/2 * holepitch, -0.5 * holepitch, 0]) + HoleRow(); + } + } + } + HolesScope(); + } +} + +module CoverCover(){ + difference(){ + CoverTemplate(); + Holes(); + } +} + +module Cover(){ + difference(){ + union(){ + CoverCover(); + AtSides() { CoverSide(covershortlen); CoverSide(coverlonglen); } + } + AtSides() { CoverPegSlot(); CoverPegSlot(); } + } +} + +module CoverAligned(){ + translate([0,-front,-height]) + rotate([-90,0,0]) + Cover(); +} + +module DemoPeg(){ + translate([recessblockwidth/2, pegrecess, -height]) + Peg(); +} + +module Demo(){ ////toplevel + %Block(); + DoKnives(); + color([0,0,1]) CoverAligned(); + color([1,0,0]) AtSides() { DemoPeg(); DemoPeg(); } +} + +module CoverParts(){ ////toplevel + Cover(); + translate([0, coverlonglen, pegheight/2]) { + Peg(); + translate([-peghead-3, 0,0]) Peg(); } } -rotate([0,0,90]) - Block(); +//Block(); +//Demo(); +//Cover(); +//CoverParts(); +//Peg(); +//Cover();