chiark / gitweb /
knifeblock: move yshift out of DoKnives
[reprap-play.git] / knifeblock.scad
index 76001c75acc56696c318b454d38c6bf569fe317b..12450f169472307687367c6add0427c4d304778f 100644 (file)
@@ -3,19 +3,31 @@
 // properties of the knives
 nknives = 3;
 widths = [15.5, 15.8, 19.0];
-handlelenbase = 60;
-handlelendelta = [-10, 0, 0];
+handlelenbase = 75;
+handlelendelta = [-15, 0, 10];
 locations = [-35, 0, 40];
 bladew = 5; // 2.5
-maxhandledepth = 43.5;
+maxhandledepth = 45;
+
+templatescale = 27.2 / 19.6;
 
 // other tuneables
-side = 5;
 front = 5;
 back = 5;
 height = 50;
+minsidein = 4;
+minsideout = 4;
+
+frontbackslop = 0.25;
+
+screwbackdepth = 6.0 - 1.0;
+screwdia =       4.0 + 0.5;
+screwcsinkdia =  9.8 + 1.0;
+
+screwabove = 15;
 
 // computed
+side = minsidein + screwcsinkdia + minsideout;
 totaldepth = front + maxhandledepth + back;
 
 module ImportTemplate(w,k,t) {
@@ -23,7 +35,7 @@ module ImportTemplate(w,k,t) {
   echo(fn);
   translate([0,0, -w/2])
     linear_extrude(height=w)
-    import(file=fn, convexity=100);
+    scale(templatescale) import(file=fn, convexity=100);
 }
 
 module Knife(k){
@@ -48,6 +60,15 @@ module DoKnives(){
     DoKnife(k);
 }
 
+module ScrewHole(){
+  translate([0,-50,0])
+    rotate([-90,0,0])
+    cylinder(r=screwdia/2, h=150, $fn=40);
+  translate([0, totaldepth-front - screwbackdepth, 0])
+    rotate([90,0,0])
+    cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6);
+}
+
 module Block(){
   minkx = locations[0] -         widths[0]        /2;
   maxkx = locations[nknives-1] + widths[nknives-1]/2;
@@ -55,12 +76,25 @@ module Block(){
   minx = minkx - side;
   maxx = maxkx + side;
 
+  sidemidx = minsideout + screwcsinkdia/2;
+
   difference(){
-    translate([minx, -front, 0])
-      mirror([0,0,1])
-      cube([maxx-minx, totaldepth, height]);
-    #DoKnives();
+    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=front/2, h=height, $fn=30);
+    }
+    for (x=[minx + sidemidx, maxx - sidemidx]) {
+      translate([x, 0, -screwabove])
+       ScrewHole();
+    }
+    for (yshift=[-1,1])
+      translate([0, yshift * frontbackslop, 0])
+       DoKnives();
   }
 }
 
-Block();
+rotate([0,0,90])
+  Block();