-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathspacer.scad
95 lines (74 loc) · 2.89 KB
/
spacer.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
$fn = 30;
SPACER_LENGTH = 6;
ARM_THICKNESS = 3.8;
ARMS_SPACING = 20;
ARM_WIDTH = 20;
module spacer(length, width, thickness, support = false) {
BLOCKER_THICKNESS = 2;
SPACE = 0.3;
CLEAR = 0.7;
MAIN_HOLE_DIAMETER = 3;
SCREW_DIAMETER = 2.7;
NUT_DIAMETER = 5;
NUT_HEIGHT = 1.9;
difference() {
union() {
cube([ length, width, thickness ], center = true);
translate([0, 0, - SPACE / 2]) {
cube(size = [ length + thickness * 2 + CLEAR * 2, SPACER_LENGTH - SPACE, ARM_THICKNESS - SPACE ], center = true);
}
if (support) {
translate([ 0, 0, thickness / 2]) {
cylinder(r = 10, h = thickness);
}
} else {
translate([ 0, 0, thickness ]) {
//%cube(size = [ length, SPACER_LENGTH - SPACE, thickness ], center = true);
}
translate([ - length / 2, 0, thickness / 2 - 0.01 ]) {
rotate([90, 0, 90])
linear_extrude(height = length) {
polygon([[-1.5,0],[-(SPACER_LENGTH - SPACE) / 2, thickness + 0.01],[(SPACER_LENGTH - SPACE) / 2,thickness + 0.01],[1.5,0]]);
}
}
translate([ 0, 0, thickness / 2]) {
cylinder(r = 5, h = thickness);
}
}
// Blocker
translate([ - (length + thickness * 2) / 2 - BLOCKER_THICKNESS / 2 - CLEAR, 0, -SPACE / 2 ]) {
cube(size = [ BLOCKER_THICKNESS, SPACER_LENGTH - SPACE + 2, ARM_THICKNESS - SPACE ], center = true);
}
translate([ (length + thickness * 2) / 2 + BLOCKER_THICKNESS / 2 + CLEAR, 0, -SPACE / 2 ]) {
cube(size = [ BLOCKER_THICKNESS, SPACER_LENGTH - SPACE + 2, ARM_THICKNESS - SPACE ], center = true);
}
}
// Main hole
translate([ 0, 0, -10]) {
cylinder(r = MAIN_HOLE_DIAMETER, h = 20);
}
if (support) {
// Small hole
for (i = [0 : 3]) {
rotate([0, 0, i * 90]) {
//translate([-(length / 4 + MAIN_HOLE_DIAMETER / 2), 0, -5]) {
translate([-(length / 4 + 1.25), 0, -5]) {
cylinder(r = SCREW_DIAMETER / 2, h = 20);
// Nut
translate([0, 0, ARM_THICKNESS + 5 + 0.01]) {
rotate([0, 0, 90])
cylinder(r = NUT_DIAMETER / 2, h = NUT_HEIGHT, $fn = 6);
}
}
}
}
}
}
}
if (1) {
// Small
spacer(ARMS_SPACING, ARM_WIDTH, ARM_THICKNESS, true);
//spacer(ARMS_SPACING, ARM_WIDTH, ARM_THICKNESS, false);
// Large
//spacer(ARMS_SPACING + ARM_THICKNESS * 2 - 1, 15, ARM_THICKNESS);
}