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