chiark / gitweb /
knifeblock: wip block
[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 // computed
19 totaldepth = front + maxhandledepth + back;
20
21 module ImportTemplate(w,k,t) {
22   fn = str("knifeblock-knives-t",k,t,".dxf");
23   echo(fn);
24   translate([0,0, -w/2])
25     linear_extrude(height=w)
26     import(file=fn, convexity=100);
27 }
28
29 module Knife(k){
30   ImportTemplate(bladew, k,"bl");
31   hull(){
32     ImportTemplate(widths[k], k,"hl");
33     translate([-100,0,0])
34       ImportTemplate(widths[k], k,"hl");
35   }
36 }
37
38 module DoKnife(k){
39   translate([locations[k],0,0]){
40     rotate([0,90,0])
41       translate([-(handlelenbase + handlelendelta[k]),0,0])
42       Knife(k);
43   }
44 }
45
46 module DoKnives(){
47   for (k=[0:nknives-1])
48     DoKnife(k);
49 }
50
51 module Block(){
52   minkx = locations[0] -         widths[0]        /2;
53   maxkx = locations[nknives-1] + widths[nknives-1]/2;
54
55   minx = minkx - side;
56   maxx = maxkx + side;
57
58   difference(){
59     translate([minx, -front, 0])
60       mirror([0,0,1])
61       cube([maxx-minx, totaldepth, height]);
62     #DoKnives();
63   }
64 }
65
66 Block();