chiark / gitweb /
sewing-table: NewArm: make longer
[reprap-play.git] / tube-crossdrill-jig.scad
1 // -*- C -*-
2
3 //$fs=0.1;
4 //$fa=3;
5 $fs=0.2;
6 $fa=6;
7
8 rearwallthick = 3;
9 basethick = 2;
10 mainframeendthick = 2.5;
11
12 tubedia = 16 + 0.8;
13 tubetubethick=2;
14 tubetubetopslop=1;
15
16 boltholedia = 6.5 + 0.5;
17 boltholeslotshorter = 6;
18 mainframeholedia = 5 + 1.0;
19
20 // "slot" refers to the things in the base of the drill press stand
21 backslotedgespace = 59;
22 slotwidth = 11.5 - 0.5;
23 backslotmid2screwhole = 17;
24 slotplugheight = 5.5;
25 slotplugshorterlen =10;
26 slotpluglongerlen = 20;
27
28 //slotslope = 11.0 / 18.5;
29 slotslope = 1 / tan(51);
30
31 // "keepslot" refers to the screws in the wooden jig block
32 keepslotstartz = 20;
33 keepslotlen = 18;
34 keepslotx = backslotedgespace / 2;
35 keepslotwidth = 4;
36
37 mainframeextraside = 12;
38 mainframeextrafront = 15;
39
40 rearwallstrengthwidth = 10;
41 keepslotclear = 10;
42
43 // computed values
44
45 slotslopediag = sqrt(1 + slotslope*slotslope);
46 slotwidthx = slotwidth * slotslopediag;
47
48 slotxperlen = slotslope / slotslopediag;
49 slotyperlen =         1 / slotslopediag;
50
51 mainframeholex = backslotedgespace/2 + slotpluglongerlen * slotxperlen
52   + 0.5 * slotwidth * slotyperlen;
53
54 mainframeholey = -slotpluglongerlen * slotyperlen
55   + 0.5 * slotwidth * slotxperlen;
56
57 mainframemaxx = mainframeholex + mainframeextraside;
58 mainframeminy = mainframeholey - mainframeextrafront;
59 mainframemaxz = keepslotstartz + keepslotlen;
60
61 module MainFrame(){
62   for (m=[0,1]) {
63     mirror([m,0,0]) {
64       translate([-1, mainframeminy, 0])
65         cube([mainframemaxx+1, -mainframeminy, basethick]);
66       translate([-1, -rearwallthick, 0])
67         cube([mainframemaxx+1, rearwallthick, mainframemaxz]);
68
69       for (x=[keepslotx - keepslotclear, mainframemaxx - 0.5]) {
70         translate([x,0,0])
71           rotate([90,0,-90])
72           linear_extrude(height=mainframeendthick)
73           polygon([[-mainframeminy, 0],
74                    [0, mainframemaxz],
75                    [0, 0]]);
76       }
77
78       translate([backslotedgespace/2, 0, 1])
79         mirror([0,0,1])
80         linear_extrude(height=slotplugheight+1)
81         polygon([[0,0],
82                  [slotwidthx, 0],
83                  [slotwidthx + slotplugshorterlen * slotxperlen,
84                   -slotplugshorterlen * slotyperlen],
85                  [slotpluglongerlen * slotxperlen,
86                   -slotpluglongerlen * slotyperlen]]);
87       translate([-1,
88                  -rearwallthick - boltholeslotshorter + 0.2,
89                  tubedia + tubetubetopslop + tubetubethick + 4])
90         cube([keepslotx - keepslotclear + 1,
91               boltholeslotshorter + 0.5,
92               rearwallstrengthwidth]);
93     }
94   }
95 }
96
97 module TubeThing(extralen, dia, extraheight, underheight){
98   effheight = tubetubetopslop + extraheight + underheight;
99   len = -mainframeminy + extralen * 2;
100   translate([0, mainframeminy - extralen, -underheight]) {
101     translate([0,0, dia/2 + effheight])
102       rotate([-90,0,0]) cylinder(h=len, r=dia/2);
103     translate([-dia/2, 0, 0])
104       cube([dia, len, effheight + dia/2]);
105   }
106 }
107
108 module Jig(){
109   difference(){
110     union(){
111       MainFrame();
112       TubeThing(0, tubedia+tubetubethick*2, -tubetubethick, 0);
113     }
114     union(){
115       translate([0,0,-0.1])
116         TubeThing(10, tubedia, 0, 5);
117       translate([-boltholedia/2, mainframeminy - 1, -5])
118         cube([boltholedia,
119               -mainframeminy + 1 - rearwallthick - boltholeslotshorter,
120               mainframemaxz + 10]);
121       for (m=[0,1]) {
122         mirror([m,0,0]) {
123           translate([mainframeholex, mainframeholey, -30])
124             cylinder(h=basethick+40, r=mainframeholedia/2);
125           translate([keepslotx - keepslotwidth/2,
126                      -10, keepslotstartz])
127             cube([keepslotwidth, 20, keepslotlen + 10]);
128         }
129       }
130     }
131   }
132 }
133
134 //MainFrame();
135 //TubeThing(0, tubedia);
136
137 rotate([-90,0,0])
138   Jig();