Cord/examples/shell.crd

14 lines
391 B
Plaintext

// shell.crd — hollow sphere with cylindrical holes
let outer: Obj = sphere(5)
let inner: Obj = sphere(4)
let shell: Obj = diff(outer, inner)
let hole_x: Obj = cylinder(1.5, 12)
let hole_y: Obj = rotate_x(cylinder(1.5, 12), pi/2)
let hole_z: Obj = rotate_y(cylinder(1.5, 12), pi/2)
let holes: Obj = union(hole_x, union(hole_y, hole_z))
let result: Obj = diff(shell, holes)
cast(result)