chiark / gitweb /
8e2a9772b6842095f6cb58cbcc452f98fdfe2892
[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
30 // "keepslot" refers to the screws in the wooden jig block
31 keepslotstartz = 20;
32 keepslotlen = 18;
33 keepslotx = backslotedgespace / 2;
34 keepslotwidth = 4;
35
36 mainframeextraside = 12;
37 mainframeextrafront = 15;
38
39 rearwallstrengthwidth = 10;
40 keepslotclear = 10;
41
42 // computed values
43
44 slotslopediag = sqrt(1 + slotslope*slotslope);
45 slotwidthx = slotwidth * slotslopediag;
46
47 slotxperlen = slotslope / slotslopediag;
48 slotyperlen =         1 / slotslopediag;
49
50 mainframeholex = backslotedgespace/2 + slotpluglongerlen * slotxperlen
51   + 0.5 * slotwidth * slotyperlen;
52
53 mainframeholey = -slotpluglongerlen * slotyperlen
54   + 0.5 * slotwidth * slotxperlen;
55
56 mainframemaxx = mainframeholex + mainframeextraside;
57 mainframeminy = mainframeholey - mainframeextrafront;
58 mainframemaxz = keepslotstartz + keepslotlen;
59
60 module MainFrame(){
61   for (m=[0,1]) {
62     mirror([m,0,0]) {
63       translate([-1, mainframeminy, 0])
64         cube([mainframemaxx+1, -mainframeminy, basethick]);
65       translate([-1, -rearwallthick, 0])
66         cube([mainframemaxx+1, rearwallthick, mainframemaxz]);
67
68       for (x=[keepslotx - keepslotclear, mainframemaxx - 0.5]) {
69         translate([x,0,0])
70           rotate([90,0,-90])
71           linear_extrude(height=mainframeendthick)
72           polygon([[-mainframeminy, 0],
73                    [0, mainframemaxz],
74                    [0, 0]]);
75       }
76
77       translate([backslotedgespace/2, 0, 1])
78         mirror([0,0,1])
79         linear_extrude(height=slotplugheight+1)
80         polygon([[0,0],
81                  [slotwidthx, 0],
82                  [slotwidthx + slotplugshorterlen * slotxperlen,
83                   -slotplugshorterlen * slotyperlen],
84                  [slotpluglongerlen * slotxperlen,
85                   -slotpluglongerlen * slotyperlen]]);
86       translate([-1,
87                  -rearwallthick - boltholeslotshorter + 0.2,
88                  tubedia + tubetubetopslop + tubetubethick + 4])
89         cube([keepslotx - keepslotclear + 1,
90               boltholeslotshorter + 0.5,
91               rearwallstrengthwidth]);
92     }
93   }
94 }
95
96 module TubeThing(extralen, dia, extraheight, underheight){
97   effheight = tubetubetopslop + extraheight + underheight;
98   len = -mainframeminy + extralen * 2;
99   translate([0, mainframeminy - extralen, -underheight]) {
100     translate([0,0, dia/2 + effheight])
101       rotate([-90,0,0]) cylinder(h=len, r=dia/2);
102     translate([-dia/2, 0, 0])
103       cube([dia, len, effheight + dia/2]);
104   }
105 }
106
107 module Jig(){
108   difference(){
109     union(){
110       MainFrame();
111       TubeThing(0, tubedia+tubetubethick*2, -tubetubethick, 0);
112     }
113     union(){
114       translate([0,0,-0.1])
115         TubeThing(10, tubedia, 0, 5);
116       translate([-boltholedia/2, mainframeminy - 1, -5])
117         cube([boltholedia,
118               -mainframeminy + 1 - rearwallthick - boltholeslotshorter,
119               mainframemaxz + 10]);
120       for (m=[0,1]) {
121         mirror([m,0,0]) {
122           translate([mainframeholex, mainframeholey, -30])
123             cylinder(h=basethick+40, r=mainframeholedia/2);
124           translate([keepslotx - keepslotwidth/2,
125                      -10, keepslotstartz])
126             cube([keepslotwidth, 20, keepslotlen + 10]);
127         }
128       }
129     }
130   }
131 }
132
133 //MainFrame();
134 //TubeThing(0, tubedia);
135
136 rotate([-90,0,0])
137   Jig();