Home   Manual

Unit cell PovRay

I am trying to export crystal structure with unit cell from Avogadro 1.2 to PovRay format. The problem is that unit cell is missing after rendering. Any suggestions?

Thanks,
Bojana

Yeah, unfortunately, the PovRay export doesn’t include “lines” which unfortunately includes the unit cell boundaries. (Probably the best way would be to export them as very small cylinders.)

Thank you for the quick answer.

Regards
Bojana

Dear Bojana,

from multiple alternatives outside Avogadro to accomplish this task let me present just two which are cross-platform:

  • light weight for disk space used, fine control over processing and output (e.g., it may require / offer some scripting): Jmol, a program both open source and freely available.

  • significant disk space used (ca 1.6 GB), preset defaults, but less hassle to enter details: CCDC Mercury, either the free community edition, or any above. The installation is this large because the program already includes all bells and whistles the corporate edition eventually enables (possibly your school / scientific library has a subscription to the CSD database which includes Mercury, too.).

In detail:

  • Start Jmol, e.g., in Linux from the CLI by jmol 1505213.cif to load the file of interest. Open Jmol’s own script console, and load the file a twice by

    load "1505213.cif" {1 1 1}
    

    to obtain a visualization about the unit cell and any molecule with at least one atom within the unit cell. Adjust the perspective, and click on the povray button to export a .pov, a .pov.ini and – if correctly set up – a .png. For example

    Jmol.pov

    Additional hints are provided by the documentation. As a side note, I recommend Robert Hanson’s open access article in J. Appl. Cryst. about Jmol with additional examples relevant to crystallography.

  • Mercury possesses a dedicated tool bar “display options” to toggle on/off e.g., the display of the unit cell, short contacts, networks of hydrogen bonds, or the packing within a unit cell when visualizing a model. Once set either choose a) File → Save as to write .pov, .pov.ini, and ccdc_macro_overrides.inc, and eventually run e.g., povray 1505213.pov to obtain 1505213.png for a quick test.

    Or b) choose the dedicated entry File → PovRay image which offers you an intuitive adjustment of background and style of the representation, including the option to export multiple .png for an animation:

    The parameters accessible to you by this pathway allow the rapid generation of high quality illustrations. E.g., determine the dimensions you need for a conference poster, account for 300 dpi resolution, enter this dimensions as width and height, and click render. Or stitch individual frames into an animation:

    ezgif.com-optimize

    Mercury already includes a PovRay engine. Still, contrasting to an installation in Windows, I prefer Mercury to use PovRay as provided by the Linux package manager. This required a one-time adjustment of the path pointing to the corresponding executable.


File 1505213.cif used in these examples is an entry of the public COD.

1 Like