.. include:: ../../toolkit-substitutions

.. oe:namespace:: OESpicoli

.. meta::
   :keywords: OEMakeMolecularSurface

.. oe:function:: OEMakeMolecularSurface

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEMakeMolecularSurface(OESurface& surf,
                                     const OEChem::OEMolBase& mol,
                                     float resolution = 0.5f,
                                     float probeRadius = 1.4f,
                                     unsigned int polygonizeMethod = OEPolygonizeMethod::Default)
         bool OEMakeMolecularSurface(OESurface& surf, const float* coords,
                                     const float* radii, int natoms,
                                     float resolution = 0.5f,
                                     float probeRadius = 1.4f,
                                     unsigned int polygonizeMethod = OEPolygonizeMethod::Default)

   .. oe:language:: python

      .. oe:api:: python

         OEMakeMolecularSurface(surf: OESurface,
                                mol: Union[OEGraphMol,OEMol,OEQMol],
                                resolution: float = 0.5,
                                probeRadius: float = 1.4, polygonizeMethod: int) -> bool
         OEMakeMolecularSurface(surf: OESurface, coords: OEFloatArray,
                                radii: OEFloatArray, natoms: int,
                                resolution: float = 0.5,
                                probeRadius: float = 1.4, polygonizeMethod: int) -> bool

   Fill the surface surf with the molecular surface for the molecule
   mol. See :ref:`generation_molecules` section for a full description
   of the molecular surface. The molecule must have valid 3D coordinates
   assigned. The atomic radius of each atom in the molecule should
   already be set before calling this function. The suggested radii can
   be set with :oe:func:`OEChem::OEAssignBondiVdWRadii`.

   The ``resolution`` is the grid spacing to use during surface
   construction. This is typically scaled with the size of the
   molecule. For most molecules 0.5 is good.

   The default probeRadius is 1.4 |A|, the radius of water approximated
   as a sphere.

   The ``polygonizeMethod`` specifies the method to be used when generating
   the triangles for the surface.  Allowed values are from the 
   :oe:constns:`OESpicoli::OEPolygonizeMethod` namespace.

   The overloaded version of the function takes a coordinate and radii
   array, ``coords`` and ``radii`` respectively, of length ``natoms``
   to create the accessible surface.

   This function will set the array of vertex normals and array of
   atom indices on the surface.

   .. seealso::

      * :ref:`generation_molecules`
      * The :oe:constns:`OESpicoli::OEPolygonizeMethod` namespace


