I decided to summarize all my comments in a form of answer and add some illustrations. Note that I have no experience in 3D printing, so I mainly focus on crystallographic part.
Since you asked for"a mathematically generated" 3D structure, you ought to know that water crystallizes in $P\mathrm{6_3cm}$ (# 185) space group having a hexagonal symmetry. Detailed information about symmetry generators and matrix transformations can be found online or in International Tables for Crystallography [1, pp. 582-583]:
There is already enough information to create a 3D model. If you want a more convenient way, you can get a CIF file for ice (COD-1011023) (which already embeds all the information above), and load it with Mercury (free, available on Windows, Linux, MacOS). From here on it's just a screencast of what's to click to get the desired molecular pattern like the one on your animated GIF:
Load the structure (drug-n-drop CIF file, or via Ctrl+O). What you see now is an asymmetric unit, in simple terms – a seed which an entire crystal structure can be grown from:
Let's expand the structure beyond those 6 atoms you've stuck with. Go to Calculate
> Packing/Slicing...
. Tick Pack
option, and click + 0.5
boxes next to $a$ and $b$ axis:
Rotate the grown structure approximately like it's shown below:
Note that you have 4 water molecules on each side that you don't need. Those can be deleted by right-clicking on them and selecting Delete this molecule
:
At this point you should have exactly the same 3D representation of the crystal structure:
Now you can print a 3D model directly from Mercury (File
> Print in 3D...
). The one with supporting framework looks like this:
6.1. Alternatively, you can save the structure as XYZ (Ctrl+S, choose Xmol files
) and do some post-processing work in Blender if needed.
Reference
- International Tables for Crystallography: Space-group symmetry, 1st ed.; Hahn, T., Ed.; Fuess, H., Hahn, T., Wondratschek, H., Müller, U., Shmueli, U., Prince, E., Authier, A., Kopský, V., Litvin, D. B., Rossmann, M. G., et al., Series Eds.; International Union of Crystallography: Chester, England, 2006; Vol. A.