Skip to content

Instantly share code, notes, and snippets.

@aravindk2604
Forked from madhephaestus/union.groovy
Created July 8, 2017 19:55
Show Gist options
  • Select an option

  • Save aravindk2604/7d594c249954177a9c806b6a864359f2 to your computer and use it in GitHub Desktop.

Select an option

Save aravindk2604/7d594c249954177a9c806b6a864359f2 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()
//create a sphere
CSG sphere = new Sphere(size/20*12.5).toCSG()
// perform a union
CSG cubePlusSphere = cube.union(sphere);
//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