chiark / gitweb /
f297fc6bf49180ac2733e1cffeebf54d013f3e2d
[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
37 clamp_hole_dia = thread_nom + 0.30;
38
39 clamp_reg_clear_x = 2.5;
40 clamp_reg_clear_y = 0.75; // each side
41 clamp_reg_extra_x = 4;
42
43 //ct_h = 7;
44
45 wingnut_th = 5;
46 wingnut_wall = 4;
47 wingnut_wing_mindia = 17.0;
48 wingnut_wing_xrad = 8;
49 wingnut_wing_xh = 5;
50 wingnut_wing_th = 3;
51
52 $test= true;
53 ///$test= false;
54
55 //$fa= 3;
56 //$fs= 0.2;
57
58 // calculated
59
60 wingnut_cnr = wingnut_wing_th/2 -0.1;
61
62 clamp_reg_bot_x_min = stem_base_dia/2 + clamp_reg_clear_x - clamp_reg_sz;
63
64 module OurThread(l){
65   translate([0,0,-0.01])
66     metric_thread(diameter=thread_act, pitch=thread_pitch,
67                   leadin=3, internal=true,
68                   test=$test, length=l);
69 }
70
71 module Stem(){ ////toplevel
72   translate([0,0, stem_l -0.1])
73     english_thread(diameter=positive_dia/inch, threads_per_inch=16,
74                    leadin=1, test=$test,
75                    length= (positive_l + 0.1) / inch);
76
77   difference(){
78     union(){
79       cylinder(r= stem_dia/2 * 1/(0.5 * sqrt(3)),
80                h = stem_l,
81                $fn=6);
82       cylinder(r= stem_base_dia/2,
83                h = stem_base_th);
84     }
85     OurThread(stem_inner_l);
86   }
87 }
88
89 module Wingnut(){ ////toplevel
90   difference(){
91     union(){
92       cylinder(r= (thread_nom+wingnut_wall)/2,
93                h= wingnut_th);
94       minkowski(){
95         sphere(r= wingnut_cnr);
96         translate([0,0, wingnut_cnr*0.5])
97           linear_extrude(height= wingnut_wing_xh + wingnut_th
98                          - wingnut_cnr*1.5)
99           square([wingnut_wing_mindia + wingnut_wing_xrad*2 - wingnut_cnr*2,
100                   wingnut_wing_th - wingnut_cnr*2],
101                  center=true);
102       }
103     }
104     translate([0,0, wingnut_th])
105       linear_extrude(height= wingnut_wing_xh+1)
106       square(wingnut_wing_mindia, center=true);
107     translate([0,0, wingnut_th])
108       rotate([180,0,0])
109       OurThread(wingnut_th+3);
110     mirror([0,0,1])
111       linear_extrude(height=5)
112       square(center=true, wingnut_wing_mindia*2);
113   }
114 }
115
116 module ClampCollarPlan(){
117   circle(r= thread_nom/2 + clamp_bot_collar_th);
118 }
119 module ClampHolePlan(){
120   circle(r= clamp_hole_dia/2);
121 }
122 module ClampArmPlan(){
123   rectfromto([0,       -clamp_w/2],
124              [clamp_l, +clamp_w/2]);
125 }
126
127 module ClampTop(){ ////toplevel
128   linear_extrude(height = clamp_top_th, convexity=4) {
129     difference(){
130       union(){
131         ClampArmPlan();
132         ClampCollarPlan();
133       }
134       ClampHolePlan();
135     }
136   }
137   linear_extrude(height = clamp_reg_sz, convexity=4) {
138     difference(){
139       for (m=[0,1]){
140         mirror([0,m,0])
141           translate([0, clamp_reg_sz/2 + clamp_reg_clear_y, 0])
142           rectfromto([-clamp_reg_bot_x_min - clamp_reg_extra_x, 0 ],
143                      [0,                             clamp_reg_sz ]);
144       }
145       ClampHolePlan();
146     }
147   }
148 }
149
150 module ClampBot(){ ////toplevel
151   linear_extrude(height = clamp_bot_th, convexity=4) {
152     difference(){
153       ClampArmPlan();
154       ClampHolePlan();
155     }
156   }
157   translate([clamp_l, 0, clamp_bot_th-0.1])
158     linear_extrude(height = clamp_bot_tooth_h +0.1)
159     rectfromto([ -clamp_bot_tooth_d, -clamp_w/2 ],
160                [  0,                 +clamp_w/2 ]);
161   translate([0,0, clamp_bot_th])
162     mirror([0,0,1])
163     linear_extrude(height = clamp_bot_collar)
164     difference(){
165     ClampCollarPlan();
166     ClampHolePlan();
167   }
168 }
169
170 //Wingnut();
171 //Stem();