## Luc Moulinier HomePage>Tcl/Tk packages Documentation> tsurf

NAME
tsurf — Computes the isosurface given a set of points.
SYNOPSIS
DESCRIPTION
-sample number
-expand number
-contract number
-smooth number
-asa boolean
ALGORITHM
NOTES

### NAME

tsurf — Computes the isosurface from a set of points.

### SYNOPSIS

tsurf ?options-value? listOfPoints

### DESCRIPTION

This command will compute the iso-surface associated with a set of atoms or points. This extension is based upon the polyr program by Jesper James Jensen. It has been adapted to add the -contract, -smooth, -expand options.
It first creates a mesh and places the atoms on it given their radii (Van der Waals radius). It then creates the isosurface using the "marching cube" algorithm. It outputs two lists, one containing all triangles describing the surface, and one containing all normals associated with each triangle vertices.

The input atoms or points are given as a list like :
{{x1 y1 z1 na1 id1} {x2 y2 z2 na2 id2} ... {xn yn zn nan idn}}
where x,y,z are the coordinates of the atom, na is the atomic number, and id is a unique id for the atom. Id is not used at present but will be used in further developpements to calculate the contribution of atoms to a given triangle. In case of points, all na's will have the same value.

Below are described the allowed parameters :

-sample number
This defines the resolution of the grid, number being an integer. By default, sampling is set to 1 unit. A sampling of 3 means the grid step is 1/3 of unit.

-expand number
Expands the mask number times. A mask expansion consists in counting for every non-mask point, the number of neighbours which ARE in the mask. If this number (0-26) is greater than 1, the point is included in the mask. This adds one layer of points to the mask.

-contract number
Contracts the mask number times. A mask contraction consists in counting for all points IN the mask the number of neighbours which are not in the mask. If the count is >=1, the point is excluded from the mask. This peels one layer of point to the mask.

-smooth
Same as expand with a count >= 15.

-asa
'asa' stands for 'accessible surface area'. This option makes a crude approximation of the asa. Given a water molecule radius of 1.4A (the probe radius) and a grid sampling, it expands the mask until reaching the water radius.

### ALGORITHM

The set of points/atoms is first transfered on a mesh which resolution is set through the -sample option. Each atom radius is converted into grid unit offsets. Each atom is then placed on the mesh, and the surrounding grid points correspoinding to its radius are set on. The smooth, expand, contract, and asa options are then carried out. The mesh is finally transfered to a "marching cube" algorithm to extract the isosurface.

The output is composed of two lists : the first one contains the description of all the triangles composing the isosurface. {x1 y1 z1 x2 y2 z2 ... xn yn zn}, and the second contains all the normals for each vertice of the triangle, i.e. the list is like {nx1 ny1 nz1 nx2 ny2 nz2 ... nxn nyn nzn}. The format of these lists is well suitad when using OpenGL vertex arrays.

### NOTES

Next version will include more parameters to control the "marching cube" part of the extension. An effort should be done to remove the memory leaks ...