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