-
Notifications
You must be signed in to change notification settings - Fork 0
/
swan-splint.scad
71 lines (61 loc) · 1.15 KB
/
swan-splint.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
include <./scad/util.scad>;
LAYER_HEIGHT = 0.28;
module diamondQuadrulate(pts) {
if (len(pts) != 2) {
echo("Not enough points for quadrulate, 2 points needed");
} else {
x1 = pts[0].x;
y1 = pts[0].y;
x2 = pts[1].x;
y2 = pts[1].y;
polygon([
[x1, 0],
[x2, y2],
[0, y1],
[-x2, y2],
[-x1, 0],
[-x2, -y2],
[0, -y1],
[x2, -y2]
]);
}
}
module triangleQuadrulate(pts) {
if (len(pts) != 2) {
echo("Not enough points for quadrulate, 2 points needed");
} else {
x1 = pts[0].x;
y1 = pts[0].y;
x2 = pts[1].x;
y2 = pts[1].y;
polygon([
[30, 30],
[0, y1],
[-x1, y2],
[-x1, 0],
[-x2, -y2],
[0, -y1],
[x2, -y2]
]);
}
}
module splintShape(w = 24, l = 24, r = 5) {
$fn = 64;
c = w * PI;
xInset = 2/5 * w;
yInset = 1/3 * c;
round(r)
triangleQuadrulate([
[w, c],
[xInset, yInset]
]);
}
module splint(w = 24, h = 5, scl = [.6, .95], r = 5) {
linear_extrude(LAYER_HEIGHT * h)
difference() {
splintShape(w, r);
scale(scl)
splintShape(w, r);
}
}
splint(scl = [.6, .9]);