This will not work! Blender has a bug with unions where only the object faces are touching:
http://www.blender.org/forum/viewtopic.php?p=105599#105599
https://projects.blender.org/tracker/?func=detail&atid=498&aid=30462&group_id=9
Openscad examples rewritten as blender python scripts.
These scripts were written using blender 2.67.
To run them call blender -P exampleXXX.py from the command line.