-
Notifications
You must be signed in to change notification settings - Fork 1
/
more-half-cylinder-stuff.js
60 lines (50 loc) · 1.36 KB
/
more-half-cylinder-stuff.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
function main () {
var shapes = [];
for(var i=0; i < 6; i++) {
shapes.push(
rotate([0,0,i*45],
halfHollowCylinder(4+i, 3.5+i, 6.5 - i)
)
)
if(i < 5)
shapes.push(
rotate([0,0,(i + 0.5)*45],
partialHollowCylinder(4.6+i, 3.9+i, 1)
)
)
}
return union(
shapes
)
}
function partialCylinder() {
return difference(
cylinder({ r: 4, h: 10, fn: 45}),
cylinder({ r: 3, h: 10, fn: 45 }),
translate([0,0,4], cube({ size: [4,4,6]})),
translate([-4,0,7], cube({ size: [4,4,3]})),
translate([0,-4,7], cube({ size: [4,4,3]}))
)
}
function hollowCylinder(r, ir, h) {
return difference(
cylinder( { r: r, h: h, fn: 45} ),
cylinder( { r: ir, h: h, fn: 45 } )
)
}
function halfHollowCylinder(r, ir, h) {
return difference(
cylinder( { r: r, h: h, fn: 45} ),
cylinder( { r: ir, h: h, fn: 45 } ),
translate([-r,0,0], cube({size: [r*2,r,h]}))
)
}
function partialHollowCylinder(r, ir, h) {
return difference(
cylinder( { r: r, h: h, fn: 45} ),
cylinder( { r: ir, h: h, fn: 45 } ),
translate([-r,0,0], cube({size: [r*2,r,h]})),
translate([0.5*r,-r,0], cube({size: [r/2,r,h]})),
translate([-r,-r,0], cube({size: [r/2,r,h]}))
)
}