source: pymolproxy/branches/1.0/scripts/

Last change on this file was 1970, checked in by gah, 12 years ago
File size: 749 bytes
2# -- create a Compiled Graphics Object for a unit cell box
4from pymol.cgo import *
5from pymol import cmd
7# Arguments:
8#   lv: List of vertices; each vertex is a [x,y,z] list
9#   lw: Line width
10#    r: Red component of box color
11#    g: Green component of box color
12#    b: Blue component of box color
13# name: Name of box, which can be used with other PyMOL commands
14def draw_box(lv, lw=2.0, r=0.5, g=0.5, b=0.5, name='unitcell'):
15   box = [LINEWIDTH, lw, BEGIN, LINES, COLOR, r, g, b]
16   for v in lv:
17      box.append(VERTEX)
18      box.append(v[0])
19      box.append(v[1])
20      box.append(v[2])
21   box.append(END)
22   cmd.load_cgo(box, name)
24# Extend the PyMOL interpeter with the new "draw_box" command
25cmd.extend("draw_box", draw_box)
Note: See TracBrowser for help on using the repository browser.