Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active January 16, 2026 00:17
Show Gist options
  • Select an option

  • Save madhephaestus/bae417566c2b46e3ab94 to your computer and use it in GitHub Desktop.

Select an option

Save madhephaestus/bae417566c2b46e3ab94 to your computer and use it in GitHub Desktop.
double size =40;
CSG cube = new Cube( size,// X dimention
size,// Y dimention
size// Z dimention
).toCSG()
cube.setName("cube")
//create a sphere
CSG sphere = new Sphere(size/20*12.5).toCSG()
sphere.setName("sphere")
// perform a union
CSG cubePlusSphere = cube.union(sphere);
cubePlusSphere.setName("Assembly")
println cubePlusSphere.name
println cube.name
println sphere.name
//To union a list of CSG's together use the static unioAll
CSG allUnion = CSG.unionAll([cubePlusSphere , cube.movex(size*1.5), sphere.movey(size*1.5)])
return allUnion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment