From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Wed Jul 16 2008 - 18:24:09 CDT

On Wed, 16 Jul 2008, FX wrote:

FX> Hi all,

hi fx,

FX> I've used VMD quite a bit by now, including for hybrid organic-inorganic
FX> systems. For those, it is quite useful to draw the metal centres as
FX> polyhedra, with the neighbours of the metal centre as corners of the
FX> polyhedra. So far, I use scripts to achieve that, but it's not very
FX> intuitive to handle, so I've written a patch to add this representation
FX> "natively" in VMD. I write to the list because I don't know exactly how
FX> patch should be submitted for VMD, and I'd be happy to have some feedback on
FX> the patch itself (it's my first VMD patch and the first time I write C++,
FX> which I am learning for the occasion).

the "cleanest" way to handle it would probably be to send a message
to vmd_at_ks.uiuc.edu, but also contacting john (stone) directly works
pretty well for me. for larger projects and also to share test files
and similar things, we use the biofs of the VMD public biocore project.

on the representation: it patches cleanly into my chechout of the cvs
and it looks pretty clean. the acid test is usually when john compiles
on windows machines or some other "weird" boxes. there are a few
constructs that are legal c++ code, but don't work so well across
platforms. i keep forgetting of those every once in a while, but
john is a nice guy and always fixes it.

when compiling, i see that the variable "j" is not used, but other
than that is compiles find and works fine and looks pretty cool,
particularly when using a transparent material on a GLSL capabable
graphics card. so i wholeheartedly second including this feature.

FX> The polyhedra representation works in the following way: for each atom of
FX> the selection, it looks for all atoms (possibly not in the selection) of the
FX> molecule within a given distance ; when more than 3 atoms are inside the
FX> cutoff radius, a polyhedron is drawn with these atoms as corners. In simple
FX> words, the representation draws polyhedra from atoms surrounding the
FX> selected atoms. I have attached a screenshot of what the result looks like
FX> in the case of MOF-5, where each inorganic unit has 4 Zn atoms (hence 4
FX> tetrahedra) joined by a common oxygen.

the one possible improvement that i am seeing (and i've been suggesting
something similar for dynamic bonds as well for quite a while now) would
be to have _two_ selections. one for the center and one for the
"neigbors". but i would expect that to matter only in very rare
cases, e.g. when the corner atoms are actually small molecules (h2o, nh3)
and yon only want the "center" of the molecule be used. which is true
for the specific system i was testing, but even then with a careful
choice of the cutoff radius it does the right thing.

FX> I hope this can make it into the codebase. If there is any legal aspect to
FX> consider (e.g., transfer of copyright), please advise me of the course to
FX> follow.

nobody has asked me to sign over something so far. i implicitly assume
that i'm assigning ownership to UIUC (see license), but it is not like
you are submitting something to a "political" project like the GCC. ;-)

salut,
   axel.

FX>
FX> Thanks,
FX> FX
FX>
FX>
FX> PS: I'm sending this message a second time, as the first one didn't appear
FX> to make it through (but no error or bounce received... that's weird). The
FX> attachment are not attached this time, but can be found here:
FX>
FX> -- patch:
FX> http://www.homepages.ucl.ac.uk/~uccafco/tmp/patch-vmd-polyhedra.diff
FX> -- screenshot: http://www.homepages.ucl.ac.uk/~uccafco/tmp/MOF-5.png
FX>
FX>
FX>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.