4.67. SURFIN: Render 3D electron density isosurfaces

Authors: Doug du Boulay Materials and Structures Laboratory, Tokyo Institute of Technology, Nagatsuta, Midori-Ku, Yokohama Japan.

SURFIN is an OpenGL based subprogram intended for viewing 3D electron density isosurfaces. It builds on the togl library as a tcl/tk based interface to the OpenGL library and incorporates a public domain version of the "marching cubes" algorithm to identify isosurfaces from gridded data.

4.67.1. Purpose

SURFIN was cobbled togeather with chewing gum, as an example program to prove that 3D rendering of isosurfaces within the Xtal tcl/tk library infrastructure was possible. As such it was a success. Unfortunately its functionality leaves a great deal to be desired...

Figure 4-6. Screen shot of SURFIN

4.67.2. Functionality

SURFIN renders the electron density contents of the xtal .map. The graphical interface is a little misleading, in that a great deal of the implied functionality has actually not been implemented.

Currently contour lighting can be adjusted. The desired contour levels and colours can be customized via a tcl script file contained in the working directory. By default some relative values are adopted to span the range of the minimum and maximum difference electron densities.

Currently there is no functionality for viewing and manipulating atomic sites and bonds, lighting is basically not implemented and surface normals are not calculated correctly. Apart from that its perect.

4.67.3. File Assignments

4.67.4. Examples

# file:  ./tclsurfin.rc    Sourced from surfin.tcl
# manually set some initial default values
#
#set contourSettings(Dvalues) [list -.5 -.2 .2  .5 ];# contour levels
set contourSettings(Dvalues) [list -4. -2. 2. 4. ];# contour levels
#set contourSettings(Dvalues) [list -40. -15. 15. 40.];# contour levels
set contourSettings(DrelVal) [list -0.8 -.3 .3  .8 ];# fraction of range
set contourSettings(FixedVals) 1 ;# 0/1 aply relVal or Dvalues
#
# Specify a colour gradient scheme for +ive and -ive contours
# The 4th coordinate is Opacity/transparency
set contourSettings(DmaxNeg) [list 1. 1. 1. 1.0 ] ; #  Maximum negative colour
set contourSettings(DminNeg) [list 1. 0. 0. 0.0 ] ; #  Minimum negative colour
set contourSettings(DmaxPos) [list 1. 1. 1. 1.0 ] ; #  Maximum positive colour
set contourSettings(DminPos) [list 0. 0. 1. 0.0 ] ; #  Minimum positive colour
#