chiark / gitweb /
knifeblock: move minx, maxx (nfc)
[reprap-play.git] / knifeblock.scad
index 3c4204abb0dd7afa9ed494eea06e04d1c3d5daa5..da25c38ded8473efaabddc1e394549f0b5400f00 100644 (file)
@@ -30,6 +30,12 @@ screwabove = 15;
 side = minsidein + screwcsinkdia + minsideout;
 totaldepth = front + maxhandledepth + back;
 
+minkx = locations[0] -         widths[0]        /2;
+maxkx = locations[nknives-1] + widths[nknives-1]/2;
+
+minx = minkx - side;
+maxx = maxkx + side;
+
 module ImportTemplate(w,k,t) {
   fn = str("knifeblock-knives-t",k,t,".dxf");
   echo(fn);
@@ -56,12 +62,8 @@ module DoKnife(k){
 }
 
 module DoKnives(){
-  for (yshift=[-1,1]) {
-    translate([0, yshift * frontbackslop, 0])
-      for (k=[0:nknives-1]) {
-       DoKnife(k);
-      }
-  }
+  for (k=[0:nknives-1])
+    DoKnife(k);
 }
 
 module ScrewHole(){
@@ -74,12 +76,6 @@ module ScrewHole(){
 }
 
 module Block(){
-  minkx = locations[0] -         widths[0]        /2;
-  maxkx = locations[nknives-1] + widths[nknives-1]/2;
-
-  minx = minkx - side;
-  maxx = maxkx + side;
-
   sidemidx = minsideout + screwcsinkdia/2;
 
   difference(){
@@ -94,9 +90,20 @@ module Block(){
       translate([x, 0, -screwabove])
        ScrewHole();
     }
-    DoKnives();
+    for (yshift=[-1,1])
+      translate([0, yshift * frontbackslop, 0])
+       DoKnives();
   }
 }
 
-rotate([0,0,90])
+module BlockPrint(){ ////toplevel
+  rotate([0,0,90])
+    Block();
+}
+
+module Demo(){ ////toplevel
   Block();
+  %DoKnives();
+}
+
+Demo();