chiark / gitweb /
knifeblock: rounded front corners
[reprap-play.git] / knifeblock.scad
index 1339ded465c9f6cbac02ba08ae8e43b25b1b8c6c..31e3654ec317224bf6045752fffa6e8662f0709a 100644 (file)
@@ -1,18 +1,80 @@
 // -*- C -*-
-//import(file="t.dxf");
 
-module ImportTemplate(l) {
-  import(file=str("knifeblock-knives-l",l,".dxf"), convexity=3);
+// properties of the knives
+nknives = 3;
+widths = [15.5, 15.8, 19.0];
+handlelenbase = 60;
+handlelendelta = [-10, 0, 0];
+locations = [-35, 0, 40];
+bladew = 5; // 2.5
+maxhandledepth = 43.5;
+
+// other tuneables
+side = 5;
+front = 5;
+back = 5;
+height = 50;
+
+frontbackslop = 0.5;
+
+screwbackdepth = 16;
+screwdia = 3.6;
+screwcsinkdia = 8.7;
+
+// computed
+totaldepth = front + maxhandledepth + back;
+
+module ImportTemplate(w,k,t) {
+  fn = str("knifeblock-knives-t",k,t,".dxf");
+  echo(fn);
+  translate([0,0, -w/2])
+    linear_extrude(height=w)
+    import(file=fn, convexity=100);
+}
+
+module Knife(k){
+  ImportTemplate(bladew, k,"bl");
+  hull(){
+    ImportTemplate(widths[k], k,"hl");
+    translate([-100,0,0])
+      ImportTemplate(widths[k], k,"hl");
+  }
 }
 
-module Knife(ix){
-  translate([0,50*ix,0]){
-    ImportTemplate(ix+1);
-    translate([0,0,10])
-      ImportTemplate(ix+4);
+module DoKnife(k){
+  translate([locations[k],0,0]){
+    rotate([0,90,0])
+      translate([-(handlelenbase + handlelendelta[k]),0,0])
+      Knife(k);
+  }
+}
+
+module DoKnives(){
+  for (yshift=[-1,1]) {
+    translate([0, yshift * frontbackslop, 0])
+      for (k=[0:nknives-1]) {
+       DoKnife(k);
+      }
+  }
+}
+
+module Block(){
+  minkx = locations[0] -         widths[0]        /2;
+  maxkx = locations[nknives-1] + widths[nknives-1]/2;
+
+  minx = minkx - side;
+  maxx = maxkx + side;
+
+  difference(){
+    hull() mirror([0,0,1]) {
+      translate([minx, 0, 0])
+       cube([maxx-minx, totaldepth-front, height]);
+      for (x=[minx + front/2, maxx - front/2])
+       translate([x, -front/2, 0])
+       cylinder(r=side/2, h=height, $fn=30);
+    }
+    #DoKnives();
   }
 }
 
-Knife(0);
-Knife(1);
-Knife(2);
+Block();