The 2D representation of the molecule surface is calculated by first
drawing circles around each atom of the molecule and then identifying
the external arc segments that define a continuous surface around the
molecule.
This process is illustrated in the table
Table: Calculation of the 2D representation of a molecule surface

Calculation of the 2D representation of a molecule surface

The following Listing1 example shows how to
the display a molecule surface.
After creating an image object and preparing the molecule for 2D
depiction, an arc drawing functor is added to each atom of the
molecule by using the OESetSurfaceArcFxn
function.
The surface then can be drawn by calling the
OEDraw2DSurface function that calculates the
arc segments that form a continuous curve around the molecule.
The image created by Listing1 is shown in
Figure: Example of surface drawing.

It is also possible to draw multiple 2D surfaces arc-by-arc.
In the Listing4 example below the
arcs returned by the OEGet2DSurfaceArcs function
for the given atom display and radius are directly rendered below
the molecule diagram.
In this case it is important to call the OEGetMoleculeSurfaceScale
function with the largest radius scale of the 2D surfaces drawn.
This reduces the scaling of the molecule in order to able to fit the
molecule diagram and all of the arcs of the 2D surfaces into the image.
The image created by Listing4 is shown in
Figure: Example of drawing multiple 2D surfaces.

The last Listing5 example shows how to
draw a 2D surface with various radii.
It draws two surfaces one with a minimum radius scale and one with various radius
depending on the covalent radius of the atoms.
The OEGetMoleculeSurfaceScale function has to be called
in this example too with the largest radius scale in order to able to fit the molecule diagram
and all of the arcs of the 2D surfaces into the image.
The image created by Listing5 is shown in
Figure: Example of drawing 2D surface with various radii.