While LaTeX packages TikZ and PStricks (see previous post) extensively support 2D, the 3D support is somewhat limited: z-coordinate (depth) is not accounted for in certain cases, so the the newer object declaration or higher layer “covers” older object or lower layer.
Possible solution is using Asymptote package. It comes with additional bonuses like inlining code into TeX code, export into various image formats and even embedding PRC graphics within PDF files. Just what one needs for imaging the crystal structure! :-)
For example this code produces following image of cubic L21 lattice of Heusler alloy Cu2MnAl: