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