<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=LatticeGenerator</id>
	<title>LatticeGenerator - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=LatticeGenerator"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LatticeGenerator&amp;action=history"/>
	<updated>2026-07-07T01:40:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=LatticeGenerator&amp;diff=6239&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LatticeGenerator&amp;diff=6239&amp;oldid=prev"/>
		<updated>2014-03-28T01:47:13Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:47, 28 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=LatticeGenerator&amp;diff=6238&amp;oldid=prev</id>
		<title>Speleo3: created</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LatticeGenerator&amp;diff=6238&amp;oldid=prev"/>
		<updated>2013-01-04T17:18:50Z</updated>

		<summary type="html">&lt;p&gt;created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a simple script to generate a repeating atom lattice. It just writes atoms in PDB format, and PyMOL will automatically [[connect_mode|connect adjacent atoms]] when loading the PDB file. You may adjust the &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;x_shift&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;y_shift&amp;lt;/code&amp;gt; arrays to obtain different geometries, and the number of iterations in the loops to adjust the lattice size.&lt;br /&gt;
&lt;br /&gt;
See also the [http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg11139.html thread on pymol-users mailing list].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from numpy import array&lt;br /&gt;
&lt;br /&gt;
# coordinates of the repeating unit (from cyclohexane)&lt;br /&gt;
c = array([[ 0.064,   2.851,  -1.085 ],&lt;br /&gt;
           [ 0.260,   1.969,   0.159 ]])&lt;br /&gt;
x_shift = array([ 1.67441517, -0.91605961,  1.66504574])&lt;br /&gt;
y_shift = array([-0.69477826, -0.40578592,  2.40198410])&lt;br /&gt;
&lt;br /&gt;
# template string for PDB hetatom line&lt;br /&gt;
s = 'HETATM %4d  C03 UNK     1    %8.3f%8.3f%8.3f  0.00  0.00           C  '&lt;br /&gt;
&lt;br /&gt;
out = open('lattice.pdb', 'w')&lt;br /&gt;
&lt;br /&gt;
i = 0&lt;br /&gt;
for x in range(10):&lt;br /&gt;
    for y in range(10):&lt;br /&gt;
        for v in (c + (x-y/2) * x_shift + y * y_shift):&lt;br /&gt;
            i += 1&lt;br /&gt;
            print &amp;gt;&amp;gt; out, s % (i, v[0], v[1], v[2])&lt;br /&gt;
&lt;br /&gt;
out.close()&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
    from pymol import cmd&lt;br /&gt;
    cmd.load('lattice.pdb')&lt;br /&gt;
except ImportError:&lt;br /&gt;
    print 'Please load lattice.pdb with PyMOL'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;/div&gt;</summary>
		<author><name>Speleo3</name></author>
	</entry>
</feed>