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