chiark / gitweb /
screw-recess-test: mid of new tests
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Feb 2015 22:16:23 +0000 (22:16 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Feb 2015 22:16:23 +0000 (22:16 +0000)
screw-recess-test.scad

index 50bcd5aee114c3390b032bf0f88dd2cad97455e4..e3dab4e2340c969e979bd932d6503c58f054a646 100644 (file)
@@ -4,7 +4,19 @@ cubez = 12;
 
 shaftz = cubez;
 
-tests = [[4 + 0.5,  10 + 1.0]];
+//        shaftdia  recessdia
+tests = [[2 + 0.5,   6 + 1.0,   0,  0 ],
+        [3 + 0.5,   9 + 1.0,   0, 10 ],
+        [4 + 0.5,  10 + 1.0,   0, 25 ],
+        [5 + 0.5,  10 + 1.0,  15,  5 ],
+        [6 + 0.5,  12 + 1.0,  15, 20 ]];
+
+last_test = tests[len(tests)-1];
+
+blockminx = -5;
+blockminy = -5;
+blockmaxx = 25;
+blockmaxy = 20;
 
 cubexy = 20;
 
@@ -40,18 +52,36 @@ module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
   }
 }
 
+module Block(){
+  translate([blockminx, blockmaxx, 0])
+    cube([blockmaxx-blockminx, blockmaxy-blockminy, cubez]);
+}
+
 module Test(){
   difference(){
-    translate([-cubexy/2, -cubexy/2, 0])
-      cube([cubexy,cubexy,cubez]);
+    Block();
+    union(){
+      for (t = tests) {
+       RecessedScrewCutout(t[0],t[1], shaftz+1);
+      }
+    }
   }
 }
 
-module Hole(){
-    RecessedScrewCutout(tests[0][0],
-                       tests[0][1],
-                       shaftz+1);
+module Holes(){
+  for (t = tests) {
+    translate([t[2], t[3], 0])
+      RecessedScrewCutout(t[0],t[1], shaftz+1);
+  }
+}
+
+module Demo(){
+  Block();
+  %Holes();
 }
 
+Demo();
+
 //Test();
-Hole();
+//Hole();
+//Holes();