-
Notifications
You must be signed in to change notification settings - Fork 0
/
dowel-jig.scad
129 lines (95 loc) · 3.29 KB
/
dowel-jig.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//----------------------------------------------------------------------------
$fn = 36;
epsilon = 0.1;
beam_length = 120;
beam_width = 20;
beam_height = 25; // drill bit is lead this much
beard_length = 90;
//----------------------------------------------------------------------------
translate([0 * beam_width * 1.5, 0, 0])
beam(10);
translate([1 * beam_width * 1.5, 0, 0])
beam(8);
translate([2 * beam_width * 1.5, 0, 0])
beam(3);
translate([3 * beam_width * 1.5, 0, 0])
rotate([90, 0, 0])
beard(beard_length);
//----------------------------------------------------------------------------
module beard(beard_length) {
beard_width = beam_width * 1.5;
beard_depth = beam_length / 3;
roundover = beam_width / 2;
thickness = (beard_width - beam_width) / 2;
beam_holder_height = beam_height + thickness;
difference() {
cube([beard_width, beard_depth, beam_holder_height]);
translate([(beard_width - beam_width) / 2, -epsilon, beam_holder_height - beam_height])
cube([beam_width, beard_depth + 2 * epsilon, beam_height + epsilon]);
// M5 thread
translate([0, beard_depth / 5, beam_holder_height - beam_height / 2])
beard_screw_hole(d = 5, cut_depth = beard_width);
translate([0, beard_depth / 5 * 4, beam_holder_height - beam_height / 2])
beard_screw_hole(d = 5, cut_depth = beard_width);
}
translate([0, 0, -(beard_length - beam_holder_height)])
cube([beard_width, thickness * 2, beard_length - beam_holder_height]);
translate([0, thickness * 2, 0])
rotate([0, 90, 0])
difference() {
cube([roundover, roundover, beard_width]);
translate([roundover, roundover, -epsilon])
cylinder(r = roundover, h = beard_width + 2 * epsilon);
}
}
module beam(d) {
difference() {
cube([beam_width, beam_length, beam_height]);
translate([beam_width / 2, beam_length / 8, 0])
drill_lead(d = d, l = beam_height);
// M5 thread
translate([0, beam_length / 8 * 2, beam_height / 2])
beam_screw_hole(d = 5, l = beam_length / 8 * 5, cut_depth = beam_width);
}
}
//----------------------------------------------------------------------------
module beam_screw_hole(d, l, cut_depth) {
translate([-epsilon, 0, 0])
rotate([0, 90, 0])
cylinder(d = d, h = cut_depth + 2 * epsilon);
translate([-epsilon, l, 0])
rotate([0, 90, 0])
cylinder(d = d, h = cut_depth + 2 * epsilon);
translate([-epsilon, 0, -d / 2])
cube([cut_depth + 2 * epsilon, l, d]);
}
module beard_screw_hole(d, cut_depth) {
translate([-epsilon, 0, 0])
rotate([0, 90, 0])
cylinder(d = d, h = cut_depth + 2 * epsilon);
}
module drill_lead(d, l) {
translate([0, 0, -epsilon])
cylinder(d = d, h = l + 2 * epsilon);
}
//----------------------------------------------------------------------------
nut_sizes = [
["m4", 7, 3 ],
["m5", 8, 4 ],
["m6", 10, 5 ],
["m8", 13, 6.5],
["m10",17, 8 ],
];
// distance between flats (wrench size)
function nut_width(size) = nut_sizes[search([size], nut_sizes)[0]][1];
function nut_height(size) = nut_sizes[search([size], nut_sizes)[0]][2];
module nut_head(width, height) {
side = width / sqrt(3);
for (i = [0, 60, 120]) {
rotate([0, 0, i])
translate([-side / 2, -width / 2, 0])
cube([side, width, height]);
}
}
//----------------------------------------------------------------------------
// vim:ft=openscad