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