chiark / gitweb /
knifeblock: rotate
[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 - 5;
11
12 // other tuneables
13 front = 5;
14 back = 8;
15 height = 50;
16 minsidein = 4;
17 minsideout = 4;
18
19 frontbackslop = 0.5;
20
21 screwbackdepth = 6.0 - 1.0;
22 screwdia =       4.0 + 0.5;
23 screwcsinkdia =  9.8 + 1.0;
24
25 screwabove = 15;
26
27 // computed
28 side = minsidein + screwcsinkdia + minsideout;
29 totaldepth = front + maxhandledepth + back;
30
31 module ImportTemplate(w,k,t) {
32   fn = str("knifeblock-knives-t",k,t,".dxf");
33   echo(fn);
34   translate([0,0, -w/2])
35     linear_extrude(height=w)
36     import(file=fn, convexity=100);
37 }
38
39 module Knife(k){
40   ImportTemplate(bladew, k,"bl");
41   hull(){
42     ImportTemplate(widths[k], k,"hl");
43     translate([-100,0,0])
44       ImportTemplate(widths[k], k,"hl");
45   }
46 }
47
48 module DoKnife(k){
49   translate([locations[k],0,0]){
50     rotate([0,90,0])
51       translate([-(handlelenbase + handlelendelta[k]),0,0])
52       Knife(k);
53   }
54 }
55
56 module DoKnives(){
57   for (yshift=[-1,1]) {
58     translate([0, yshift * frontbackslop, 0])
59       for (k=[0:nknives-1]) {
60         DoKnife(k);
61       }
62   }
63 }
64
65 module ScrewHole(){
66   translate([0,-50,0])
67     rotate([-90,0,0])
68     cylinder(r=screwdia/2, h=150, $fn=40);
69   translate([0, totaldepth-front - screwbackdepth, 0])
70     rotate([90,0,0])
71     cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6);
72 }
73
74 module Block(){
75   minkx = locations[0] -         widths[0]        /2;
76   maxkx = locations[nknives-1] + widths[nknives-1]/2;
77
78   minx = minkx - side;
79   maxx = maxkx + side;
80
81   sidemidx = minsideout + screwcsinkdia/2;
82
83   difference(){
84     hull() mirror([0,0,1]) {
85       translate([minx, 0, 0])
86         cube([maxx-minx, totaldepth-front, height]);
87       for (x=[minx + front/2, maxx - front/2])
88         translate([x, -front/2, 0])
89         cylinder(r=front/2, h=height, $fn=30);
90     }
91     for (x=[minx + sidemidx, maxx - sidemidx]) {
92       translate([x, 0, -screwabove])
93         ScrewHole();
94     }
95     DoKnives();
96   }
97 }
98
99 rotate([0,0,90])
100   Block();