-
Notifications
You must be signed in to change notification settings - Fork 0
/
Arrow Display Mount.scad
94 lines (78 loc) · 2.69 KB
/
Arrow Display Mount.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
arrowSpread = 300;
arrowLength = 787.4;
arrowDiameter = 8.6;
holeDepth = 15;
minThickness = 2;
backInset = 0.35;
backInsetScale = 0.8;
fudge = 0.001;
fw = 0.5;
function afn(r) = 180 / asin(fw / (2 * r));
module drawCorner(r, height) {
translate([r, r]) rotate([0, 0, 180]) linear_extrude(height) difference() {
square([r + fudge, r + fudge]);
circle(r=r, $fn=afn(r));
}
}
module drawBlockPolyhedron(faceSize, h, angle) {
translate([0, faceSize, 0]) rotate([90, 0, 0]) linear_extrude(faceSize)
drawBlockPolygon(faceSize, h, angle);
}
module drawBlockPolygon(faceSize, h, angle) {
x = faceSize;
z = sin(90 - angle) * faceSize;
n = cos(90 - angle) * faceSize;
j = tan(angle) * (h - n);
polygon([
[j, 0],
[2 * z + faceSize - j, 0],
[2 * z + faceSize, h - n],
[z + faceSize, h],
[z, h],
[0, h - n]
]);
}
module arrowShafts(spread, length, d, lift, inset, faceSize) {
angle = asin(spread / (2 * length));
o = faceSize * sin(angle);
translate([0, 0, o - lift])
for (a = [-angle, 0, angle])
rotate([0, a, 0]) translate([0, 0, lift - inset])
cylinder(h = length, r = d / 2, $fn=afn(d / 2));
}
module drawBlock() {
faceSize = arrowDiameter + minThickness * 2;
arrowAngle = asin(arrowSpread / (2 * arrowLength));
arrowLift = faceSize / tan(arrowAngle);
blockWidth = 2 * sin(90 - arrowAngle) * faceSize + faceSize;
n = cos(90 - arrowAngle) * faceSize;
blockHeight = holeDepth + n + minThickness;
j = tan(arrowAngle) * (blockHeight - n);
blockRadius = arrowDiameter - minThickness;
echo("faceSize", faceSize);
echo("arrowAngle", arrowAngle);
echo("arrowLift", arrowLift);
echo("blockWidth", blockWidth);
echo("blockHeight", blockHeight);
echo("blockRadius", blockRadius);
difference() {
translate([-blockWidth / 2, -faceSize / 2, 0])
drawBlockPolyhedron(faceSize, blockHeight, arrowAngle);
translate([
blockWidth * backInsetScale / -2,
-faceSize / 2 + faceSize + fudge,
(blockHeight - blockHeight * backInsetScale) / 2
])
rotate([90, 0, 0]) linear_extrude(backInset) scale(backInsetScale)
drawBlockPolygon(faceSize, blockHeight, arrowAngle);
translate([0, 0, blockHeight - faceSize * sin(arrowAngle)])
arrowShafts(arrowSpread, arrowLength, arrowDiameter, arrowLift, holeDepth, faceSize);
translate([blockWidth / -2 + j, faceSize / -2, 0]) rotate([0, -arrowAngle, 0])
translate([0, 0, -blockHeight])
drawCorner(blockRadius, blockHeight * 3);
translate([blockWidth / 2 - j, faceSize / -2, 0]) rotate([0, arrowAngle, 0])
rotate([0, 0, 90]) translate([0, 0, -blockHeight])
drawCorner(blockRadius, blockHeight * 3);
}
}
drawBlock();