chiark / gitweb /
mic-table-clamp: wip ClampBot
[reprap-play.git] / mic-table-clamp.scad
index 77c3fc4f94177a7a11aa435da96283c9053ff123..43b0069892d8203f272344947999010e1d3e5539 100644 (file)
@@ -1,37 +1,47 @@
 // -*- C -*-
 
-// print on High Detail
+// print Stem and Wingnut on High Detail
 // but adjust shell thickness to 2mm
 
+// others on Standard
+
+include <utils.scad>
 include <threads.scad>
 include <camera-mount.scad>
 
 positive_dia = inch * 3/8. - 0.375;
 positive_l = inch * 1/2.;
 
-stem_l = 7;
+stem_l = 40;
 stem_dia = 12;
+stem_th = 3;
+stem_ceil = 2;
+stem_base_th  = 4;
+stem_base_dia = 25;
+stem_inner_l = 30;
 
-base_th = 3;
-base_dia = 60;
+thread_nom = 8;
+thread_pitch = 1.25;
+thread_act = thread_nom + 0.600;
 
-module Base(){
-  translate([0,0,-0.1])
-    english_thread(diameter=positive_dia/inch, threads_per_inch=16,
-                  leadin=1, test=$test,
-                  length= (positive_l + 0.1) / inch);
+clamp_l = 40;
+clamp_top_th = 7;
+clamp_bot_th = 10;
+clamp_bot_tooth_h = 2.5;
+clamp_bot_tooth_d  = 10;
+clamp_bot_collar = 20;
+clamp_bot_collar_th = 4.0;
+clamp_reg_sz = 3;
+clamp_w = 15;
+clamp_max_table_th = 35;
 
-  rotate([180,0,0]) {
-    cylinder(r= stem_dia/2 * 1/(0.5 * sqrt(3)),
-            h = stem_l + 1,
-            $fn=6);
-    translate([0,0, stem_l])
-      cylinder(r= base_dia/2, h= base_th);
-  }
-}
+clamp_hole_dia = thread_nom + 0.30;
 
-thread_nom = 8;
-thread_act = thread_nom + 0.375;
+clamp_reg_clear_x = 2.5;
+clamp_reg_clear_y = 0.75; // each side
+clamp_reg_extra_x = 4;
+
+//ct_h = 7;
 
 wingnut_th = 5;
 wingnut_wall = 4;
@@ -40,17 +50,44 @@ wingnut_wing_xrad = 8;
 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;
 
-module Wingnut(){
+clamp_reg_bot_x_min = stem_base_dia/2 + clamp_reg_clear_x - clamp_reg_sz;
+
+module OurThread(l){
+  translate([0,0,-0.01])
+    metric_thread(diameter=thread_act, pitch=thread_pitch,
+                 leadin=3, internal=true,
+                 test=$test, length=l);
+}
+
+module Stem(){ ////toplevel
+  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);
+
+  difference(){
+    union(){
+      cylinder(r= stem_dia/2 * 1/(0.5 * sqrt(3)),
+              h = stem_l,
+              $fn=6);
+      cylinder(r= stem_base_dia/2,
+              h = stem_base_th);
+    }
+    OurThread(stem_inner_l);
+  }
+}
+
+module Wingnut(){ ////toplevel
   difference(){
     union(){
       cylinder(r= (thread_nom+wingnut_wall)/2,
@@ -70,13 +107,81 @@ module Wingnut(){
       square(wingnut_wing_mindia, center=true);
     translate([0,0, wingnut_th])
       rotate([180,0,0])
-      translate([0,0,-0.01])
-      metric_thread(diameter=thread_act, leadin=3, internal=true,
-                   test=$test, length=wingnut_th+3);
+      OurThread(wingnut_th+3);
     mirror([0,0,1])
       linear_extrude(height=5)
       square(center=true, wingnut_wing_mindia*2);
   }
 }
 
-Wingnut();
+module ClampCollarPlan(){
+  circle(r= thread_nom/2 + clamp_bot_collar_th);
+}
+module ClampHolePlan(){
+  circle(r= clamp_hole_dia/2);
+}
+module ClampArmPlan(){
+  rectfromto([0,       -clamp_w/2],
+            [clamp_l, +clamp_w/2]);
+}
+
+module ClampTop(){ ////toplevel
+  linear_extrude(height = clamp_top_th, convexity=4) {
+    difference(){
+      union(){
+       ClampArmPlan();
+       ClampCollarPlan();
+      }
+      ClampHolePlan();
+    }
+  }
+  linear_extrude(height = clamp_reg_sz, convexity=4) {
+    difference(){
+      for (m=[0,1]){
+       mirror([0,m,0])
+         translate([0, clamp_reg_sz/2 + clamp_reg_clear_y, 0])
+         rectfromto([-clamp_reg_bot_x_min - clamp_reg_extra_x, 0 ],
+                    [0,                             clamp_reg_sz ]);
+      }
+      ClampHolePlan();
+    }
+  }
+}
+
+module ClampBot(){ ////toplevel
+  linear_extrude(height = clamp_bot_th, convexity=4) {
+    difference(){
+      ClampArmPlan();
+      ClampHolePlan();
+    }
+  }
+  translate([clamp_l, 0, clamp_bot_th-0.1])
+    linear_extrude(height = clamp_bot_tooth_h +0.1)
+    rectfromto([ -clamp_bot_tooth_d, -clamp_w/2 ],
+              [  0,                 +clamp_w/2 ]);
+  translate([0,0, clamp_bot_th])
+    mirror([0,0,1])
+    linear_extrude(height = clamp_bot_collar)
+    difference(){
+    ClampCollarPlan();
+    ClampHolePlan();
+  }
+  translate([0, 0, clamp_bot_th]) {
+    linextr(-clamp_reg_sz, clamp_max_table_th+clamp_reg_sz) {
+      translate([-clamp_reg_bot_x_min, 0]) {
+       rectfromto([ 0,            -clamp_reg_sz/2 ],
+                  [ clamp_reg_sz, +clamp_reg_sz/2 ]);
+      }
+    }
+    linextr(-clamp_reg_sz, 0) {
+      difference(){
+       rectfromto([ -clamp_reg_bot_x_min, -clamp_reg_sz/2 ],
+                  [  0,                   +clamp_reg_sz/2 ]);
+       ClampHolePlan();
+      }
+    }
+  }
+}
+
+//Wingnut();
+//Stem();