chiark / gitweb /
mic-table-clamp: wip ClampBot
[reprap-play.git] / mic-table-clamp.scad
1 // -*- C -*-
2
3 // print Stem and Wingnut on High Detail
4 // but adjust shell thickness to 2mm
5
6 // others on Standard
7
8 include <utils.scad>
9 include <threads.scad>
10 include <camera-mount.scad>
11
12 positive_dia = inch * 3/8. - 0.375;
13 positive_l = inch * 1/2.;
14
15 stem_l = 40;
16 stem_dia = 12;
17 stem_th = 3;
18 stem_ceil = 2;
19 stem_base_th  = 4;
20 stem_base_dia = 25;
21 stem_inner_l = 30;
22
23 thread_nom = 8;
24 thread_pitch = 1.25;
25 thread_act = thread_nom + 0.600;
26
27 clamp_l = 40;
28 clamp_top_th = 7;
29 clamp_bot_th = 10;
30 clamp_bot_tooth_h = 2.5;
31 clamp_bot_tooth_d  = 10;
32 clamp_bot_collar = 20;
33 clamp_bot_collar_th = 4.0;
34 clamp_reg_sz = 3;
35 clamp_w = 15;
36 clamp_max_table_th = 35;
37
38 clamp_hole_dia = thread_nom + 0.30;
39
40 clamp_reg_clear_x = 2.5;
41 clamp_reg_clear_y = 0.75; // each side
42 clamp_reg_extra_x = 4;
43
44 //ct_h = 7;
45
46 wingnut_th = 5;
47 wingnut_wall = 4;
48 wingnut_wing_mindia = 17.0;
49 wingnut_wing_xrad = 8;
50 wingnut_wing_xh = 5;
51 wingnut_wing_th = 3;
52
53 $test= true;
54 ///$test= false;
55
56 //$fa= 3;
57 //$fs= 0.2;
58
59 // calculated
60
61 wingnut_cnr = wingnut_wing_th/2 -0.1;
62
63 clamp_reg_bot_x_min = stem_base_dia/2 + clamp_reg_clear_x - clamp_reg_sz;
64
65 module OurThread(l){
66   translate([0,0,-0.01])
67     metric_thread(diameter=thread_act, pitch=thread_pitch,
68                   leadin=3, internal=true,
69                   test=$test, length=l);
70 }
71
72 module Stem(){ ////toplevel
73   translate([0,0, stem_l -0.1])
74     english_thread(diameter=positive_dia/inch, threads_per_inch=16,
75                    leadin=1, test=$test,
76                    length= (positive_l + 0.1) / inch);
77
78   difference(){
79     union(){
80       cylinder(r= stem_dia/2 * 1/(0.5 * sqrt(3)),
81                h = stem_l,
82                $fn=6);
83       cylinder(r= stem_base_dia/2,
84                h = stem_base_th);
85     }
86     OurThread(stem_inner_l);
87   }
88 }
89
90 module Wingnut(){ ////toplevel
91   difference(){
92     union(){
93       cylinder(r= (thread_nom+wingnut_wall)/2,
94                h= wingnut_th);
95       minkowski(){
96         sphere(r= wingnut_cnr);
97         translate([0,0, wingnut_cnr*0.5])
98           linear_extrude(height= wingnut_wing_xh + wingnut_th
99                          - wingnut_cnr*1.5)
100           square([wingnut_wing_mindia + wingnut_wing_xrad*2 - wingnut_cnr*2,
101                   wingnut_wing_th - wingnut_cnr*2],
102                  center=true);
103       }
104     }
105     translate([0,0, wingnut_th])
106       linear_extrude(height= wingnut_wing_xh+1)
107       square(wingnut_wing_mindia, center=true);
108     translate([0,0, wingnut_th])
109       rotate([180,0,0])
110       OurThread(wingnut_th+3);
111     mirror([0,0,1])
112       linear_extrude(height=5)
113       square(center=true, wingnut_wing_mindia*2);
114   }
115 }
116
117 module ClampCollarPlan(){
118   circle(r= thread_nom/2 + clamp_bot_collar_th);
119 }
120 module ClampHolePlan(){
121   circle(r= clamp_hole_dia/2);
122 }
123 module ClampArmPlan(){
124   rectfromto([0,       -clamp_w/2],
125              [clamp_l, +clamp_w/2]);
126 }
127
128 module ClampTop(){ ////toplevel
129   linear_extrude(height = clamp_top_th, convexity=4) {
130     difference(){
131       union(){
132         ClampArmPlan();
133         ClampCollarPlan();
134       }
135       ClampHolePlan();
136     }
137   }
138   linear_extrude(height = clamp_reg_sz, convexity=4) {
139     difference(){
140       for (m=[0,1]){
141         mirror([0,m,0])
142           translate([0, clamp_reg_sz/2 + clamp_reg_clear_y, 0])
143           rectfromto([-clamp_reg_bot_x_min - clamp_reg_extra_x, 0 ],
144                      [0,                             clamp_reg_sz ]);
145       }
146       ClampHolePlan();
147     }
148   }
149 }
150
151 module ClampBot(){ ////toplevel
152   linear_extrude(height = clamp_bot_th, convexity=4) {
153     difference(){
154       ClampArmPlan();
155       ClampHolePlan();
156     }
157   }
158   translate([clamp_l, 0, clamp_bot_th-0.1])
159     linear_extrude(height = clamp_bot_tooth_h +0.1)
160     rectfromto([ -clamp_bot_tooth_d, -clamp_w/2 ],
161                [  0,                 +clamp_w/2 ]);
162   translate([0,0, clamp_bot_th])
163     mirror([0,0,1])
164     linear_extrude(height = clamp_bot_collar)
165     difference(){
166     ClampCollarPlan();
167     ClampHolePlan();
168   }
169   translate([0, 0, clamp_bot_th]) {
170     linextr(-clamp_reg_sz, clamp_max_table_th+clamp_reg_sz) {
171       translate([-clamp_reg_bot_x_min, 0]) {
172         rectfromto([ 0,            -clamp_reg_sz/2 ],
173                    [ clamp_reg_sz, +clamp_reg_sz/2 ]);
174       }
175     }
176     linextr(-clamp_reg_sz, 0) {
177       difference(){
178         rectfromto([ -clamp_reg_bot_x_min, -clamp_reg_sz/2 ],
179                    [  0,                   +clamp_reg_sz/2 ]);
180         ClampHolePlan();
181       }
182     }
183   }
184 }
185
186 //Wingnut();
187 //Stem();