-
Notifications
You must be signed in to change notification settings - Fork 1
/
twisted-steps.js
70 lines (59 loc) · 1.34 KB
/
twisted-steps.js
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
function main() {
let a = [];
let offset = 0;
// for(let i=5; i>0; i--){
// a.push(
// translate( [0,0,offset],
// scale([1,1,1/i],
// cube({size: i})
// )
// )
// )
// offset += 1;
// }
offset = 0;
for(let i=5; i>0; i--){
a.push(
rotate([0,-90,90],
translate([0,0,offset],
scale([1,1,1/i], cube({size: i}))
)
)
)
offset += 1;
}
offset = 0;
for(let i=5; i>0; i--){
a.push(
rotate([0,-90,-180],
translate([0,0,offset],
scale([1,1,1/i], cube({size: i}))
)
)
)
offset += 1;
}
offset = 0;
for(let i=5; i>0; i--){
a.push(
rotate([0,-90,0],
translate([0,0,offset],
scale([1,1,1/i], cube({size: i}))
)
)
)
offset += 1;
}
for(let i=5; i>0; i--){
a.push(
translate([0,-5,0],
rotate([0,-90,-90],
translate([0,0,offset],
scale([1,1,1/i], cube({size: i}))
)
))
)
offset += 1;
}
return union.apply(null, a);
}