Skip to content

Instantly share code, notes, and snippets.

@GilesBathgate
Created January 2, 2014 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GilesBathgate/8229461 to your computer and use it in GitHub Desktop.
Save GilesBathgate/8229461 to your computer and use it in GitHub Desktop.
OpenSCAD hollow test case
//----TEST 1 ----------------
module test1() {
module hollow_cube() {
polyhedron([[-5,5,-5],[-5,-5,-5],[-5,-5,5],[-5,5,5],[5,-5,-5],[5,-5,5],[5,5,5],[5,5,-5],[-2.5,2.5,-2.5],[-2.5,-2.5,-2.5],[-2.5,-2.5,2.5],[-2.5,2.5,2.5],[2.5,-2.5,-2.5],[2.5,-2.5,2.5],[2.5,2.5,2.5],[2.5,2.5,-2.5]],[[0,1,2,3],[2,1,4,5],[3,2,5,6],[4,1,0,7],[7,0,3,6],[5,4,7,6],[8,9,10,11],[10,9,12,13],[11,10,13,14],[12,9,8,15],[15,8,11,14],[13,12,15,14]]);
}
difference(){
hollow_cube();
cube(5);
}
}
//-----TEST 2 ----------------
module test2() {
module hollow_cube() {
difference(){
cube(10,center=true);
cube(5,center=true);
}
}
difference(){
hollow_cube();
cube(5);
}
}
test1();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment