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