chiark / gitweb /
air-hockey-puck: wip
[reprap-play.git] / mic-table-clamp.scad
index 1c459b09bd7caf302bab4abdd202327ac7044ee1..b88e8d160566795562000f5d7b8933737594e2e7 100644 (file)
@@ -12,13 +12,17 @@ include <camera-mount.scad>
 positive_dia = inch * 3/8. - 0.375;
 positive_l = inch * 1/2.;
 
 positive_dia = inch * 3/8. - 0.375;
 positive_l = inch * 1/2.;
 
+positive_blank_dia = 8.12;
+blank_l = 17;
+blank_taper = 1.0;
+
 stem_l = 40;
 stem_dia = 12;
 stem_th = 3;
 stem_ceil = 2;
 stem_base_th  = 4;
 stem_base_dia = 25;
 stem_l = 40;
 stem_dia = 12;
 stem_th = 3;
 stem_ceil = 2;
 stem_base_th  = 4;
 stem_base_dia = 25;
-stem_inner_l = 30;
+stem_inner_l = 15;
 
 thread_nom = 8;
 thread_pitch = 1.25;
 
 thread_nom = 8;
 thread_pitch = 1.25;
@@ -30,7 +34,7 @@ clamp_bot_th = 10;
 clamp_bot_tooth_h = 2.5;
 clamp_bot_tooth_d  = 10;
 clamp_bot_collar = 20;
 clamp_bot_tooth_h = 2.5;
 clamp_bot_tooth_d  = 10;
 clamp_bot_collar = 20;
-clamp_bot_collar_th = 4.0;
+clamp_bot_collar_th = 3.0;
 clamp_reg_sz1 = 3;
 clamp_reg_sz2 = 5;
 clamp_w = 15;
 clamp_reg_sz1 = 3;
 clamp_reg_sz2 = 5;
 clamp_w = 15;
@@ -38,7 +42,7 @@ clamp_max_table_th = 35;
 
 clamp_hole_dia = thread_nom + 0.30;
 
 
 clamp_hole_dia = thread_nom + 0.30;
 
-clamp_reg_clear_x = 6;
+clamp_reg_clear_x = 2.5;
 clamp_reg_clear_y = 0.75; // each side
 clamp_reg_extra_x = 4;
 
 clamp_reg_clear_y = 0.75; // each side
 clamp_reg_extra_x = 4;
 
@@ -51,17 +55,18 @@ wingnut_wing_xrad = 8;
 wingnut_wing_xh = 5;
 wingnut_wing_th = 3;
 
 wingnut_wing_xh = 5;
 wingnut_wing_th = 3;
 
-$test= true;
-///$test= false;
+//$test= true;
+$test= false;
 
 
-//$fa= 3;
-//$fs= 0.2;
+$fa= 3;
+$fs= 0.2;
 
 // calculated
 
 wingnut_cnr = wingnut_wing_th/2 -0.1;
 
 
 // calculated
 
 wingnut_cnr = wingnut_wing_th/2 -0.1;
 
-clamp_reg_bot_x_min = stem_base_dia/2 + clamp_reg_clear_x - clamp_reg_sz2;
+clamp_reg_bot_x_min = -stem_base_dia/2 -clamp_reg_clear_x -clamp_reg_sz2;
+clamp_collar_r = thread_nom/2 + clamp_bot_collar_th;
 
 module OurThread(l){
   translate([0,0,-0.01])
 
 module OurThread(l){
   translate([0,0,-0.01])
@@ -70,11 +75,9 @@ module OurThread(l){
                  test=$test, length=l);
 }
 
                  test=$test, length=l);
 }
 
-module Stem(){ ////toplevel
+module StemWith(){
   translate([0,0, stem_l -0.1])
   translate([0,0, stem_l -0.1])
-    english_thread(diameter=positive_dia/inch, threads_per_inch=16,
-                  leadin=1, test=$test,
-                  length= (positive_l + 0.1) / inch);
+    children();
 
   difference(){
     union(){
 
   difference(){
     union(){
@@ -86,6 +89,27 @@ module Stem(){ ////toplevel
     }
     OurThread(stem_inner_l);
   }
     }
     OurThread(stem_inner_l);
   }
+}  
+
+module Stem(){ ////toplevel
+  StemWith()
+    english_thread(diameter=positive_dia/inch, threads_per_inch=16,
+                  leadin=1, test=$test,
+                  length= (positive_l + 0.1) / inch);
+}
+
+module StemBlankPart(){
+  hull(){
+    cylinder(h = blank_l + 0.1 - blank_taper,
+            r = positive_blank_dia/2);
+    cylinder(h = blank_l + 0.1,
+            r = positive_blank_dia/2 - blank_taper);
+  }
+}
+
+module BlankStem(){ ////toplevel
+  StemWith()
+    StemBlankPart();
 }
 
 module Wingnut(){ ////toplevel
 }
 
 module Wingnut(){ ////toplevel
@@ -116,14 +140,18 @@ module Wingnut(){ ////toplevel
 }
 
 module ClampCollarPlan(){
 }
 
 module ClampCollarPlan(){
-  circle(r= thread_nom/2 + clamp_bot_collar_th);
+  circle(r= clamp_collar_r);
 }
 module ClampHolePlan(){
   circle(r= clamp_hole_dia/2);
 }
 module ClampArmPlan(){
 }
 module ClampHolePlan(){
   circle(r= clamp_hole_dia/2);
 }
 module ClampArmPlan(){
-  rectfromto([0,       -clamp_w/2],
-            [clamp_l, +clamp_w/2]);
+  r = clamp_collar_r;
+  hull(){
+    rectfromto([r,       -clamp_w/2],
+              [clamp_l, +clamp_w/2]);
+    ClampCollarPlan();
+  }
 }
 
 module ClampTop(){ ////toplevel
 }
 
 module ClampTop(){ ////toplevel
@@ -141,8 +169,8 @@ module ClampTop(){ ////toplevel
       for (m=[0,1]){
        mirror([0,m,0])
          translate([0, clamp_reg_sz2/2 + clamp_reg_clear_y, 0])
       for (m=[0,1]){
        mirror([0,m,0])
          translate([0, clamp_reg_sz2/2 + clamp_reg_clear_y, 0])
-         rectfromto([-clamp_reg_bot_x_min - clamp_reg_extra_x, 0 ],
-                    [0,                            clamp_reg_sz1 ]);
+         rectfromto([clamp_reg_bot_x_min - clamp_reg_extra_x, 0 ],
+                    [0,                           clamp_reg_sz1 ]);
       }
       ClampHolePlan();
     }
       }
       ClampHolePlan();
     }
@@ -169,20 +197,33 @@ module ClampBot(){ ////toplevel
   }
   translate([0, 0, clamp_bot_th]) {
     linextr(-clamp_reg_sz2, clamp_max_table_th+clamp_reg_sz2) {
   }
   translate([0, 0, clamp_bot_th]) {
     linextr(-clamp_reg_sz2, clamp_max_table_th+clamp_reg_sz2) {
-      translate([-clamp_reg_bot_x_min, 0]) {
+      translate([clamp_reg_bot_x_min, 0]) {
        rectfromto([ 0,             -clamp_reg_sz2/2 ],
                   [ clamp_reg_sz2, +clamp_reg_sz2/2 ]);
       }
     }
     linextr(-clamp_reg_sz2, 0) {
       difference(){
        rectfromto([ 0,             -clamp_reg_sz2/2 ],
                   [ clamp_reg_sz2, +clamp_reg_sz2/2 ]);
       }
     }
     linextr(-clamp_reg_sz2, 0) {
       difference(){
-       rectfromto([ -clamp_reg_bot_x_min, -clamp_reg_sz2/2 ],
-                  [  0,                   +clamp_reg_sz2/2 ]);
+       rectfromto([ clamp_reg_bot_x_min, -clamp_reg_sz2/2 ],
+                  [  0,                  +clamp_reg_sz2/2 ]);
        ClampHolePlan();
       }
     }
   }
 }
 
        ClampHolePlan();
       }
     }
   }
 }
 
+module StemBlankTest(){ ////toplevel
+  StemBlankPart();
+  linextr(-1.5,0) square(center=true, [10,35]);
+}
+
+module Demo(){ ////toplevel
+  color("blue") translate([0,0, clamp_top_th+0.5]) BlankStem();
+  color("red") ClampTop();
+  color("grey") translate([0,0, -(clamp_bot_th + 5)]) ClampBot();
+  translate([0,0, -(clamp_bot_collar +10)])
+    rotate([180,0,0]) Wingnut();
+}
+
 //Wingnut();
 //Stem();
 //Wingnut();
 //Stem();