-
Notifications
You must be signed in to change notification settings - Fork 3
/
projection.scad
35 lines (25 loc) · 1.39 KB
/
projection.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
node = 5;
edge = 1.5;
minwall = 1;
quickpreview = true;
$fs = .2;
$fa = 2;
$fn = (quickpreview && $preview) ? 3 : 0;
module transform() translate([0, 0, 45]) rotate([20, 30, 0]) children();
nodes = 25 * [[1, 1, 1], [-1, 1, 1], [1, -1, 1], [-1, -1, 1], [1, 1, -1], [-1, 1, -1], [1, -1, -1], [-1, -1, -1]];
edges = [[0, 1], [0, 2], [2, 3], [1, 3], [0, 4], [1, 5], [2, 6], [3, 7], [4, 5], [4, 6], [6, 7], [5, 7], ];
for(i = [0:len(nodes) - 1]) transform() translate(nodes[i]) sphere(node / 2);
for(i = [0:len(edges) - 1]) hull() for(end = [0, 1]) transform() translate(nodes[edges[i][end]]) sphere(edge / 2);
#intersection() {
translate([0, 0, 1000]) cube(2000, center = true);
union() {
for(i = [0:len(nodes) - 1]) hull() for(m = [0, 1]) mirror([0, 0, m]) transform() translate(nodes[i]) sphere(max(minwall / 2, node / 2 * sin(45)));
for(i = [0:len(edges) - 1]) hull() for(m = [0, 1]) mirror([0, 0, m]) for(end = [0, 1]) transform() translate(nodes[edges[i][end]]) sphere(max(minwall / 2, edge / 2 * sin(45)));
}
}
linear_extrude(1) offset(1) projection(cut = true) {
union() {
for(i = [0:len(nodes) - 1]) hull() for(m = [0, 1]) mirror([0, 0, m]) transform() translate(nodes[i]) sphere(max(minwall / 2, node / 2 * sin(45)));
for(i = [0:len(edges) - 1]) hull() for(m = [0, 1]) mirror([0, 0, m]) for(end = [0, 1]) transform() translate(nodes[edges[i][end]]) sphere(max(minwall / 2, edge / 2 * sin(45)));
}
}