3 // properties of the knives
5 widths = [15.5, 15.8, 19.0];
7 handlelendelta = [-15, 0, 10];
8 locations = [-35, 0, 40];
12 templatescale = 27.2 / 19.6;
14 coverlonglen = 120; // xxx
15 covershortlen = 70; // xxx
26 screwbackdepth = 6.0 - 1.0;
28 screwcsinkdia = 9.8 + 1.0;
33 coverside = coverthick;
36 covertopwingbase = 20;
52 recessblockwidth = peghead + pegstem*3;
53 recessblockheight = peglen + pegstem*1.5;
59 pegdepthproportion = 0.80;
62 side = minsidein + screwcsinkdia + minsideout;
63 totaldepth = front + maxhandledepth + back;
65 minkx = locations[0] - widths[0] /2;
66 maxkx = locations[nknives-1] + widths[nknives-1]/2;
71 holepitch = holesize+holestrut;
73 pegrecess = pegdepthproportion*totaldepth - 0.5*peglen;
75 module ImportTemplate(w,k,t) {
76 fn = str("knifeblock-knives-t",k,t,".dxf");
78 translate([0,0, -w/2])
79 linear_extrude(height=w)
80 scale(templatescale) import(file=fn, convexity=100);
84 ImportTemplate(bladew, k,"bl");
86 ImportTemplate(widths[k], k,"hl");
88 ImportTemplate(widths[k], k,"hl");
93 translate([locations[k],0,0]){
95 translate([-(handlelenbase + handlelendelta[k]),0,0])
101 for (k=[0:nknives-1])
108 cylinder(r=screwdia/2, h=150, $fn=40);
109 translate([0, totaldepth-front - screwbackdepth, 0])
111 cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6);
114 module PegTemplate(){
115 for (mx=[0,1]) for (my=[0,1]) {
116 mirror([mx,0,0]) mirror([0,my,0])
117 polygon([[-0.1, -0.1],
119 [pegstem/2, pegstemheight/2],
120 [peghead/2, pegheight /2],
121 [-0.1, pegheight /2]]);
126 translate([minx,0,0]) child(0);
127 translate([maxx,0,0]) mirror([1,0,0]) child(1);
130 module BlockPegSlot(){
131 translate([recessblockwidth/2, pegrecess - 0.5*peglen, -height]){
132 rotate([-90,0,0]) linear_extrude(height=totaldepth){
139 sidemidx = minsideout + screwcsinkdia/2;
142 hull() mirror([0,0,1]) {
143 translate([minx, 0, 0])
144 cube([maxx-minx, totaldepth-front, height]);
145 for (x=[minx + front/2, maxx - front/2])
146 translate([x, -front/2, 0])
147 cylinder(r=front/2, h=height, $fn=30);
149 for (x=[minx + sidemidx, maxx - sidemidx]) {
150 translate([x, 0, -screwabove])
154 translate([0, yshift * frontbackslop, 0])
156 AtSides() { BlockPegSlot(); BlockPegSlot(); }
160 module BlockPrint(){ ////toplevel
165 module CoverTemplate(){
166 linear_extrude(height=coverthick)
169 [maxx, coverlonglen],
170 [maxx - coverside, coverlonglen],
171 [minx, covershortlen]]);
174 module CoverSide(len){
175 translate([0, 0 ,0]) {
177 linear_extrude(height=coverside)
180 [covertopwing, totaldepth],
181 [covertopwingbase, coverside + coverthick],
182 [len - covertopwingbase, coverside + coverthick],
183 [len - covertopwing, totaldepth],
186 cube([recessblockwidth, recessblockheight, totaldepth]);
191 echo("peg angle slope (must be <1)",
192 (peghead-pegstem)/(pegheight-pegstemheight));
196 linear_extrude(height=peglen-pegslopl) {
198 translate([-dx,-dy,0]) PegTemplate();
199 translate([-dx,+dy,0]) PegTemplate();
200 translate([+dx,+dy,0]) PegTemplate();
201 translate([+dx,-dy,0]) PegTemplate();
207 module CoverPegSlot(coverlen){
208 translate([recessblockwidth/2, 0, -1]){
209 linear_extrude(height= 1 + pegrecess + 0.5*peglen){
217 translate([0, (i+0.5)*holepitch, -1])
218 cylinder(r=holesize/2, h=coverthick+2, $fn=20);
223 intersection_for (dx=[-1,+1]) {
224 intersection_for (dy=[-1,+1]) {
225 translate([dx * holeedge, dy * holeedge, -1])
234 translate([holeoffx * holepitch, holeoffy * holepitch, 0]) {
236 translate([i * sqrt(3) * holepitch, 0, 0]) {
238 translate([sqrt(3)/2 * holepitch, -0.5 * holepitch, 0])
258 AtSides() { CoverSide(covershortlen); CoverSide(coverlonglen); }
260 AtSides() { CoverPegSlot(); CoverPegSlot(); }
264 module CoverAligned(){
265 translate([0,-front,-height])
271 translate([recessblockwidth/2, pegrecess, -height])
275 module Demo(){ ////toplevel
278 color([0,0,1]) CoverAligned();
279 color([1,0,0]) AtSides() { DemoPeg(); DemoPeg(); }
282 module CoverParts(){ ////toplevel
284 translate([0, coverlonglen, pegheight/2]) {
286 translate([-peghead-3, 0,0]) Peg();