chiark / gitweb /
tube-crossdrill-jig: slot plugs in right place
[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 = 3;
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 + 0.5;
19
20 // "slot" refers to the things in the base of the drill press stand
21 backslotedgespace = 55;
22 slotwidth = 11.5;
23 backslotmid2screwhole = 17;
24 slotplugheight = 5.5;
25 slotplugshorterlen = 8;
26 slotpluglongerlen = 18;
27
28 slotslope = 11.0 / 18.5;
29
30 // "keepslot" refers to the screws in the wooden jig block
31 keepslotstartz = 20;
32 keepslotlen = 25;
33 keepslotx = backslotedgespace / 2;
34 keepslotwidth = 4;
35
36 mainframeextraside = 15;
37 mainframeextrafront = 25;
38
39 rearwallstrengthwidth = 10;
40 keepslotclear = 10;
41
42 // computed values
43
44 mainframeholex = backslotedgespace/2 + slotwidth/sqrt(2) +
45   backslotmid2screwhole / sqrt(2);
46
47 mainframeholey = -backslotmid2screwhole / sqrt(2);
48
49 mainframemaxx = mainframeholex + mainframeextraside;
50 mainframeminy = mainframeholey - mainframeextrafront;
51 mainframemaxz = keepslotstartz + keepslotlen;
52
53 slotslopediag = sqrt(1 + slotslope*slotslope);
54 slotwidthx = slotwidth * slotslopediag;
55
56 slotxperlen = slotslope / slotslopediag;
57 slotyperlen =         1 / slotslopediag;
58
59 echo(slotslope, slotslopediag, slotwidthx);
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();