Maps/surfaces examples


This page is intended to describe what is meant in povscript+ with maps, which are considered scalar fields in povscript+ (like electron density files or APBS OpenDX files) and surfaces, which are surfaces read in from GRASP/MSMS or generated via the gensurf command.

POVScript+, as of version 2.10, is designed with the idea that maps are used to extract isosurfaces, for example in an electron density map by using a contour value, as those shown here:

readmap 2fofc "2fofc_siga.omap";
! setup map properties (maptype 0 = draw surface as a wireframe mesh)
set maptype 0, mapradius 1.5;
set linewidth 0.025, linecolour grey 0.6;
! contour map at 1.0 sigma, thereby generating an isosurface
contour 2fofc at 1.0 covering require in residue 1012 and not $backb;
see the whole input file


POVScript+ considers surfaces as triangle lists that are either read in or generated, typically for the purposes of representing molecular/van der Waals surfaces:

Here's a generated surface:

! make the surface, smoothing factor 0.7 (max 1.0)
gensurf surf covering atom * plus 5.0 lambda 0.7;
! maptype 1 = draw surface as a solid object
set maptype 1;
set linecolour white;
! now just draw the surface
drawsurf surf;
see the whole input file


Or a surface read in from a MSMS file:

! needs cam3_msms.face and cam3_msms.vert from MSMS
readsurf surf "cam3_msms";
set maptype 1;
set linecolour white;
drawsurf surf;
see the whole input file


So isosurfaces and surfaces aren't really all that different, the former just requires an extra step (the contour command) to be generated. In fact, povscript+ treats the two *identically.* So either can be colored/visualized/output in the same way. For example:

Here's a generated surface colored by the nearest atom color:

gensurf surf covering atom * plus 5.0 lambda 0.7 using distance;
set atomcolour atom C* green;
! need to give a mapradius now so povscript+ has a distance cutoff
set maptype 1, mapradius 4.5;
! now tell povscript+ which atoms it should use for the distance
! calculation
drawsurf surf covering atom *;
see the whole input file


Or an electron density map colored the same way:

readmap 2fofc "2fofc_siga.omap" using distance;
set linewidth 0.6, linecolour skyblue;
! colourparts off uses nearest atom color, colourparts on uses
! residue color
set maptype 0, mapradius 1.5, mapthresh 0.4, colourparts off;
contour 2fofc at 1.0 covering require in residue A12 and not $backb;
see the whole input file


One important point is that POVScript+ 2.10 allows for the mapping of scalars onto surfaces/isosurfaces, so its easy to map electrostatic potential (from APBS, for example) onto a generated surface:

readmap map "bontB.pqr.dx";
read mol "bontB.pqr";
! apply scalars from "map" onto the generated "surf"
gensurf surf covering atom * plus 5.0 lambda 0.7 using scalars map;
set maptype 1;
! set up the color scheme and bounds for the potential values
set mapramp from red to blue through white;
set surfrange -5.0 0.0 5.0;
drawsurf surf;
see the whole input file

Be wary when doing this sort of thing - povscript+ applies transformations to ALL objects, so if you do:

read mol "bontB.pqr";
! WARNING: this will translate the "mol" object,
! but NOT the "map" object!
transform atom * by translation 20.0 0.0 0.0;

readmap map "bontB.pqr.dx";
! apply scalars from "map" onto the generated "surf"
gensurf surf covering atom * plus 5.0 lambda 0.7 using scalars map;
The resulting render won't come out how you might expect, since the atoms are being translated before the map is read in - therefore, the two objects will be on two different coordinate systems.


actually, any map can be mapped onto any surface/isosurface, so its completely acceptable to do things like:

readmap 2fofc "2fo-fc.omap";
readmap fofc "fo-fc.omap" using scalars 2fofc;
set maptype 1;
set mapramp from red to blue through white;
! scalars from 2fofc below 0.0 sigma will be red, at 1.0 sigma will be
! white and scalars at 2.0 sigma and above will be blue
set surfrange 0.0 1.0 2.0;
contour fofc at 2.0 covering in from A10 to A20;
So vertices on the fofc isosurface would be colored according to the scalar data in the 2fofc map. All kinds of possibilities result from this, and there many other possible options. See the new commands page for the gory specifics.


Go back to the povscript+ home page