(6 intermediate revisions by the same user not shown)
Line 1:
Line 1:
= Overview =
{{Infobox psico
|module = psico.xtal
}}
Can display multiple copies of the unit cell.
[[File:SupercellExample.png|200px|thumb|right|Example with 2 unit cells in c-direction, created with: supercell 1,1,2,2x19]]
'''supercell''' can display multiple copies of the unit cell.
Can also fill the unit cell (and its copies) with symmetry mates.
See [http://sourceforge.net/mailarchive/forum.php?thread_name=l2vdcf611bd1004140816zeca28714mf76b9f72008099ab%40mail.gmail.com&forum_name=pymol-users thread on pymol-users mailing list].
See [http://sourceforge.net/mailarchive/forum.php?thread_name=l2vdcf611bd1004140816zeca28714mf76b9f72008099ab%40mail.gmail.com&forum_name=pymol-users thread on pymol-users mailing list].
= Example =
Requires [http://numpy.scipy.org numpy].
== Example ==
<source lang="python">
<source lang="python">
run supercell.py
# import psico.xtal, or run the standalone script:
run https://raw.githubusercontent.com/speleo3/pymol-psico/master/psico/xtal.py
fetch 2x19, async=0
fetch 2x19, async=0
supercell 2,1,1, 2x19, green
supercell 2,1,1, 2x19, green
Line 14:
Line 23:
</source>
</source>
= The Code =
== See Also ==
<source lang="python">
'''
(c) 2010 Thomas Holder
PyMOL python script (load with `run supercell.py`)
Usage: See "help supercell"
'''
from pymol import cmd, cgo
from math import cos, sin, radians, sqrt
import numpy
def cellbasis(angles, edges):
'''
For the unit cell with given angles and edge lengths calculate the basis
# import psico.xtal, or run the standalone script:runhttps://raw.githubusercontent.com/speleo3/pymol-psico/master/psico/xtal.pyfetch2x19,async=0supercell2,1,1,2x19,greensupercell1,1,2,2x19,orange,name=super2