.. # split from OESpicoliFunctions.rst:722


.. oe:namespace:: OESpicoli

.. meta::
   :keywords: OESplitSurfaceByAtoms

.. oe:function:: OESplitSurfaceByAtoms

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

      .. oe:api::

         bool OESplitSurfaceByAtoms(OESurface& newsurf, const OESurface& surf,
                                    const OEChem::OEMolBase& mol,
                                    double maxDist = 4.0)
         bool OESplitSurfaceByAtoms(OESurface& surf,
                                    const OEChem::OEMolBase& mol,
                                    double maxDist = 4.0)

   .. oe:language:: python

      .. oe:api:: python

         OESplitSurfaceByAtoms(newsurf: OESurface, surf: OESurface,
                               mol: Union[OEGraphMol,OEMol,OEQMol],
                               maxDist: float = 4.0) -> bool
         OESplitSurfaceByAtoms(surf: OESurface,
                               mol: Union[OEGraphMol,OEMol,OEQMol],
                               maxDist: float = 4.0) -> bool

   Given an OESurface (``surf``) and the molecule it was constructed 
   from (``mol``), this function will create a new version of the surface
   with triangles cleanly partitioned by atom boundaries.  The vertices,
   triangles, and atom associations in the surface are all adjusted from the
   original surface to create the partitioning.  With the first form of this
   function, the split surface will be returned in the ``newsurf`` surface
   object.  With the second form, the input surface is modified in-place.
   The ``maxDist`` parameter specifies an upper limit for the expected 
   distance from any vertex in the surface to its assigned atom.  The 
   default value is adequate for normal molecular and solvent-accessible 
   surfaces.  Using too small of a value will result in decreased performance.

   .. seealso::
  
      * :ref:`splitting`

