3 // properties of the knives
5 widths = [15.5, 15.8, 19.0];
7 handlelendelta = [-15, 0, 10];
8 locations = [-35, 0, 37];
12 templatescale = 27.2 / 19.6;
14 coverlonglen = 120; // xxx
15 covershortlen = 70; // xxx
28 screwbackdepth = 6.0 - 1.0;
30 screwcsinkdia = 9.8 + 1.0;
35 coverside = coverthick;
38 covertopwingbase = 20;
49 indentoutersize = holesize + 2.15;
50 indentinnersize = indentoutersize - indentdepth * 3.0;
58 recessblockwidth = peghead + pegstem*3;
59 recessblockheight = peglen/2 + pegstem*1.5;
65 pegdepthproportion = 0.80;
69 function width(k) = widths[k] + knifewidthslop;
71 side = minsidein + screwcsinkdia + minsideout;
72 totaldepth = front + maxhandledepth + back;
74 minkx = locations[0] - width(0) /2;
75 maxkx = locations[nknives-1] + width(nknives-1)/2;
80 holepitch = holesize+holestrut;
82 pegrecess = pegdepthproportion*totaldepth - 0.5*peglen;
84 module ImportTemplate(w,k,t) {
85 fn = str("knifeblock-knives-t",k,t,".dxf");
87 translate([0,0, -w/2])
88 linear_extrude(height=w)
89 scale(templatescale) import(file=fn, convexity=100);
93 ImportTemplate(bladew, k,"bl");
95 ImportTemplate(width(k), k,"hl");
97 ImportTemplate(width(k), k,"hl");
102 translate([locations[k],0,0]){
104 translate([-(handlelenbase + handlelendelta[k]),0,0])
110 for (k=[0:nknives-1])
117 cylinder(r=screwdia/2, h=150, $fn=40);
118 translate([0, totaldepth-front - screwbackdepth, 0])
120 cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6);
123 module PegTemplate(apex){
124 for (mx=[0,1]) for (my=[0,1]) {
125 mirror([mx,0,0]) mirror([0,my,0])
126 polygon([[-0.1, -0.1],
128 [pegstem/2, pegstemheight/2],
129 [peghead/2, pegheight /2],
130 [-0.1, pegheight /2 + apex]]);
135 translate([minx,0,0]) child(0);
136 translate([maxx,0,0]) mirror([1,0,0]) child(1);
139 module BlockPegSlot(){
140 translate([recessblockwidth/2, pegrecess - peglen, -height]){
141 rotate([-90,0,0]) linear_extrude(height=totaldepth){
142 PegTemplate(peghead/2 * 1.2);
147 module DecorativeIndents(){
148 translate([0, -front, 0])
150 HexGrid(-height, 0, minx,maxx) {
152 translate([0, 0, -indentdepth])
153 cylinder(r=indentinnersize/2, h=indentdepth, $fn=40);
154 cylinder(r=indentoutersize/2, h=indentdepth, $fn=40);
160 sidemidx = minsideout + screwcsinkdia/2;
164 translate([minx, -front, 0])
165 cube([maxx-minx, totaldepth, height]);
167 for (x=[minx + sidemidx, maxx - sidemidx]) {
168 translate([x, 0, -screwabove])
172 translate([0, yshift * frontbackslop, 0])
174 AtSides() { BlockPegSlot(); BlockPegSlot(); }
179 module BlockPrint(){ ////toplevel
184 module CoverTemplate(){
185 linear_extrude(height=coverthick)
188 [maxx, coverlonglen+0.1],
189 [maxx - coverside, coverlonglen+0.1],
190 [minx, covershortlen+0.1]]);
193 module CoverSide(len){
194 translate([0, 0 ,0]) {
196 linear_extrude(height=coverside)
199 [covertopwing, totaldepth],
200 [covertopwingbase, coverside + coverthick],
201 [len - covertopwingbase, coverside + coverthick],
202 [len - covertopwing, totaldepth],
205 cube([recessblockwidth, recessblockheight, totaldepth]);
210 echo("peg angle slope (must be <1)",
211 (peghead-pegstem)/(pegheight-pegstemheight));
215 linear_extrude(height=peglen-pegslopl) {
217 translate([-dx,-dy,0]) PegTemplate(0);
218 translate([-dx,+dy,0]) PegTemplate(0);
219 translate([+dx,+dy,0]) PegTemplate(0);
220 translate([+dx,-dy,0]) PegTemplate(0);
226 module CoverPegSlot(coverlen){
227 translate([recessblockwidth/2, 0, -1]){
228 linear_extrude(height= 1 + pegrecess + 0.5*peglen){
235 intersection_for (dx=[-1,+1]) {
236 intersection_for (dy=[-1,+1]) {
237 translate([dx * holeedge, dy * holeedge, -5])
244 module HexGrid(xa,xb,ya,yb) {
245 imin = floor(xa / holepitch);
246 imax = ceil(xb / holepitch);
247 jmin = floor(ya / (sqrt(3)*holepitch));
248 jmax = ceil(yb / (sqrt(3)*holepitch));
249 echo("HexGrid ",imin,imax,jmin,jmax);
250 for (i=[imin:imax]) {
251 for (j=[jmin:jmax]) {
252 translate([(j * sqrt(3) + holeoffx) * holepitch,
253 (i + 0.5 + holeoffy) * holepitch,
256 translate([sqrt(3)/2 * holepitch, -0.5 * holepitch, 0])
264 cylinder(r=holesize/2, h=40, $fn=40);
269 translate([0, 0, -20])
270 HexGrid(0, coverlonglen, minx, maxx)
287 AtSides() { CoverSide(covershortlen); CoverSide(coverlonglen); }
289 AtSides() { CoverPegSlot(); CoverPegSlot(); }
293 module CoverAligned(){
294 translate([0,-front,-height])
300 translate([recessblockwidth/2, pegrecess, -height])
304 module Demo(){ ////toplevel
307 color([0,0,1]) CoverAligned();
308 color([1,0,0]) AtSides() { DemoPeg(); DemoPeg(); }
311 module Pegs(){ ////toplevel
313 translate([-peghead-3, 0,0]) Peg();
316 module CoverParts(){ ////toplevel
318 translate([0, coverlonglen, pegheight/2-pegslopv])
322 module FrontDemo(){ ////toplevel
323 color([1,0,1]) Block();
324 color([1,0,1]) CoverAligned();
325 color([0,0,0]) DoKnives();
328 module BlockFrontTest(){ ////toplevel
331 translate([minx-10, -front-10, -height-10]) {