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