Skip to content

Instantly share code, notes, and snippets.

@nichtich
Created August 17, 2011 00:14
Show Gist options
  • Save nichtich/1150497 to your computer and use it in GitHub Desktop.
Save nichtich/1150497 to your computer and use it in GitHub Desktop.
Truncated octahedron as 3D-Model in OpenSCAD
/*
Truncated octahedron.
*/
module truncocta() {
// octahedron based on code by Willliam A Adams
octapoints = [
[+1, 0, 0], // + x axis
[-1, 0, 0], // - x axis
[0, +1, 0], // + y axis
[0, -1, 0], // - y axis
[0, 0, +1], // + z axis
[0, 0, -1] // - z axis
];
octafaces = [
[4,2,0],[4,0,3],[4,3,1],[4,1,2],[5,0,2],[5,3,0],[5,1,3], [5,2,1]
];
intersection() {
scale(v=3) {
polyhedron(points=octapoints,triangles=octafaces);
}
% cube(size=4,center=true);
}
}
truncocta();
translate([2,2,2]) { truncocta(); }
/*
TODO:
Create wireframe, see
http://www.thingiverse.com/thing:9560
http://www.thingiverse.com/thing:10409
And/or plates (could be connected by magnets:
http://www.thingiverse.com/thing:6497 )
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment