===== Functions for convertcrystal ===== The tool ''convertcrystal'' is part of the QUAD package and converts crystal files in the format [[http://en.wikipedia.org/wiki/XYZ_file_format|XYZ]] to an output that is usable for QUAD. The standard crystal structure .cif files can be usually exported to a .xyz file by using software tools like "Diamond" or "Vesta". ''convertcrystal'' executes a script file which can contain following commands line by line. An example should be provided in the Tutorials folder ''openxyz filename'' opens a .xyz file ''savexyz filename'' saves a .xyz file ''unitcell a b c alpha beta gamma'' defines the unit cell structure of the loaded file. The definition of the 6 parameters can be found here: [[http://en.wikipedia.org/wiki/Fractional_coordinates]] ''printunitcellvectors'' prints the current unit cell vectors a,b and c ''atomdistance d'' Sets the distance limit in which the atoms are treated identical. (default: d=0.1A) ''findneighbors'' just prints the atom and tells how many other atoms at the same crystal position could be found ''removeoutside'' remove all atoms outside of the unit cell ''reduce'' removes atoms that sit on the same site in the crystal lattice (e. g. atoms at the corners) the function "removeoutside" should be executed first. ''expand min max'' expands the unit cell around the borders ''sort'' sort the atoms for increasing z-coordinate ''rotatex angle'' rotates crystal and the unit cell coordinates around x-axis ''rotatey angle'' rotates crystal and the unit cell coordinates around y-axis ''rotatez angle'' rotates crystal and the unit cell coordinates around z-axis ''moveatom atomnr x y z'' moves an atom around. if atomnr is -1 then the whole crystal is moved ''findcubiccell'' trys to find the smallest cubic unitcell of the system. and sets the unit cell accordingly. If this function does not work you have to do it manually by the "unitcell" command. ''buildlayers nlayers'' prints a script snipplet which contains the coordinates for the atom layers which you can directly use in the lua script. Note that the layer will be build up along z-axis and not around c-axis. ''pause'' waits for a keypress (enter) ''check'' checks if there is something outside of the primitive outside of the unit cell and warns In future there will be more checks included