Scientific.Visualization.VMD

Package Scientific :: Package Visualization :: Module VMD |
[frames] | no frames]

# Module VMD

Definitions of simple 3D graphics objects and scenes containing them, in a form that can be fed to the molecular visualization program VMD

Scenes can either be written as VMD script files, or visualized directly by running VMD.

This module is almost compatible with the modules VRML and VRML2, which provide visualization by VRML browsers. There is no Polygon class, and the only material attribute supported is diffuse_color. Note also that loading a scene with many cubes into VMD is very slow, because each cube is represented by 12 individual triangles.

Example:

     >>> from VMD import *
     >>> scene = Scene([])
     >>> scale = ColorScale(10.)
     >>> for x in range(11):
     >>>     color = scale(x)
     >>>     scene.addObject(Cube(Vector(x, 0., 0.), 0.2,
     >>>                          material=Material(diffuse_color = color)))
     >>> scene.view()

Classes
| Arrow Arrow
| Cone Cone
| Cube Cube
| Cylinder Cylinder
| Group Base class for composite objects
| Line Line
| Material Material specification for graphics objects
| Molecules Molecules from a PDB file
| Scene VMD scene
| SceneFile
| ShapeObject Graphics objects representing geometrical shapes
| Sphere Sphere
| VMDObject Graphics object for VMD

Functions
Material |
DiffuseMaterial(color) Returns: a material with the 'diffuse color' attribute set to color |
Material |
EmissiveMaterial(color) Returns: a material with the 'diffuse color' attribute set to color |
isGroup(x) |

Variables
| ex = `Vector(1.000000,0.000000,0.000000)`
| ey = `Vector(0.000000,1.000000,0.000000)`
| ez = `Vector(0.000000,0.000000,1.000000)`

Function Details

### DiffuseMaterial(color) |
Parameters: `color` (Color or `str`) - a color object or a predefined color name Returns: Material a material with the 'diffuse color' attribute set to color

### EmissiveMaterial(color) |
Parameters: `color` (Color or `str`) - a color object or a predefined color name Returns: Material a material with the 'diffuse color' attribute set to color