• ## Outreach

From: Lee-Ping Wang (leeping_at_stanford.edu)
Date: Fri Feb 28 2014 - 08:58:35 CST

Hi there,

I'm interested in doing a few things with VMD and I'm wondering if it's
possible.

1) Drawing circles. I have the following TCL snippet for drawing a
circle but it's kind of slow. I could also use VMD spheres with
angle-modulated transparency, but in this case I would prefer for it to
simply be a circle.

proc vmd_draw_circle {mol cnt ex ey {radius 1.0} {res 36} {thickness 5}} {

# Draw a circle, given the center, two unit vectors, radius, resolution
and thickness.

set pi 3.1415926535897931

for {set i 0} {\$i < \$res} {incr i} {

set q0 [expr 2 * \$pi * (\$i-0.1) / \$res]

cos(\$q0)]]] [vecscale \$ey [expr \$radius * sin(\$q0)]]]

set q1 [expr 2 * \$pi * (\$i+1.1) / \$res]

cos(\$q1)]]] [vecscale \$ey [expr \$radius * sin(\$q1)]]]

graphics \$mol line \$r0 \$r1 width \$thickness

}

}

2) Drawing small polyhedra. My method is to create atoms at the
positions of the vertices and use the "Polyhedra" representation. However,
VMD complains that there are too many bonds and does not draw all of the
polyhedral faces.

3) Tooltips. Is it possible to pop up an image if I mouse-over an atom
or graphics object?

Thanks,

- Lee-Ping Wang