chiark / gitweb /
knifeblock: add knifewidthslop
[reprap-play.git] / knifeblock.scad
index 08a0d1a4c43dd34b40b3daa5abcf9a3d8d2d74dd..f57808da24865152854f6027ab0dc87e3b6af864 100644 (file)
@@ -23,6 +23,8 @@ minsideout = 4;
 
 frontbackslop = 0.25;
 
+knifewidthslop = 1.6;
+
 screwbackdepth = 6.0 - 1.0;
 screwdia =       4.0 + 0.5;
 screwcsinkdia =  9.8 + 1.0;
@@ -59,11 +61,14 @@ pegslopl = 0.5;
 pegdepthproportion = 0.80;
 
 // computed
+
+function width(k) = widths[k] + knifewidthslop;
+
 side = minsidein + screwcsinkdia + minsideout;
 totaldepth = front + maxhandledepth + back;
 
-minkx = locations[0] -         widths[0]        /2;
-maxkx = locations[nknives-1] + widths[nknives-1]/2;
+minkx = locations[0] -         width(0)        /2;
+maxkx = locations[nknives-1] + width(nknives-1)/2;
 
 minx = minkx - side;
 maxx = maxkx + side;
@@ -83,9 +88,9 @@ module ImportTemplate(w,k,t) {
 module Knife(k){
   ImportTemplate(bladew, k,"bl");
   hull(){
-    ImportTemplate(widths[k], k,"hl");
+    ImportTemplate(width(k), k,"hl");
     translate([-100,0,0])
-      ImportTemplate(widths[k], k,"hl");
+      ImportTemplate(width(k), k,"hl");
   }
 }
 
@@ -111,14 +116,14 @@ module ScrewHole(){
     cylinder(r=screwcsinkdia/2 / (sqrt(3)/2), h=100, $fn=6);
 }
 
-module PegTemplate(){
+module PegTemplate(apex){
   for (mx=[0,1]) for (my=[0,1]) {
       mirror([mx,0,0]) mirror([0,my,0])
        polygon([[-0.1,      -0.1],
                 [pegstem/2, -0.1],
                 [pegstem/2, pegstemheight/2],
                 [peghead/2, pegheight    /2],
-                [-0.1,      pegheight    /2]]);
+                [-0.1,      pegheight    /2 + apex]]);
     }
 }
 
@@ -130,7 +135,7 @@ module AtSides(){
 module BlockPegSlot(){
   translate([recessblockwidth/2, pegrecess - 0.5*peglen, -height]){
     rotate([-90,0,0]) linear_extrude(height=totaldepth){
-      PegTemplate();
+      PegTemplate(peghead/2 * 1.2);
     }
   }
 }
@@ -192,10 +197,10 @@ module Peg(){
   rotate([90,0,0]) {
     linear_extrude(height=peglen-pegslopl) {
       intersection(){
-       translate([-dx,-dy,0]) PegTemplate();
-       translate([-dx,+dy,0]) PegTemplate();
-       translate([+dx,+dy,0]) PegTemplate();
-       translate([+dx,-dy,0]) PegTemplate();
+       translate([-dx,-dy,0]) PegTemplate(0);
+       translate([-dx,+dy,0]) PegTemplate(0);
+       translate([+dx,+dy,0]) PegTemplate(0);
+       translate([+dx,-dy,0]) PegTemplate(0);
       }
     }
   }
@@ -204,7 +209,7 @@ module Peg(){
 module CoverPegSlot(coverlen){
   translate([recessblockwidth/2, 0, -1]){
     linear_extrude(height= 1 + pegrecess + 0.5*peglen){
-      PegTemplate();
+      PegTemplate(0);
     }
   }
 }