chiark / gitweb /
knifeblock: rounded front corners
[reprap-play.git] / knifeblock.scad
1 // -*- C -*-
2
3 // properties of the knives
4 nknives = 3;
5 widths = [15.5, 15.8, 19.0];
6 handlelenbase = 60;
7 handlelendelta = [-10, 0, 0];
8 locations = [-35, 0, 40];
9 bladew = 5; // 2.5
10 maxhandledepth = 43.5;
11
12 // other tuneables
13 side = 5;
14 front = 5;
15 back = 5;
16 height = 50;
17
18 frontbackslop = 0.5;
19
20 screwbackdepth = 16;
21 screwdia = 3.6;
22 screwcsinkdia = 8.7;
23
24 // computed
25 totaldepth = front + maxhandledepth + back;
26
27 module ImportTemplate(w,k,t) {
28   fn = str("knifeblock-knives-t",k,t,".dxf");
29   echo(fn);
30   translate([0,0, -w/2])
31     linear_extrude(height=w)
32     import(file=fn, convexity=100);
33 }
34
35 module Knife(k){
36   ImportTemplate(bladew, k,"bl");
37   hull(){
38     ImportTemplate(widths[k], k,"hl");
39     translate([-100,0,0])
40       ImportTemplate(widths[k], k,"hl");
41   }
42 }
43
44 module DoKnife(k){
45   translate([locations[k],0,0]){
46     rotate([0,90,0])
47       translate([-(handlelenbase + handlelendelta[k]),0,0])
48       Knife(k);
49   }
50 }
51
52 module DoKnives(){
53   for (yshift=[-1,1]) {
54     translate([0, yshift * frontbackslop, 0])
55       for (k=[0:nknives-1]) {
56         DoKnife(k);
57       }
58   }
59 }
60
61 module Block(){
62   minkx = locations[0] -         widths[0]        /2;
63   maxkx = locations[nknives-1] + widths[nknives-1]/2;
64
65   minx = minkx - side;
66   maxx = maxkx + side;
67
68   difference(){
69     hull() mirror([0,0,1]) {
70       translate([minx, 0, 0])
71         cube([maxx-minx, totaldepth-front, height]);
72       for (x=[minx + front/2, maxx - front/2])
73         translate([x, -front/2, 0])
74         cylinder(r=side/2, h=height, $fn=30);
75     }
76     #DoKnives();
77   }
78 }
79
80 Block();