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