# OESurfaceToMoleculeDistance¶

bool OESurfaceToMoleculeDistance(OESurface &surf, const OEChem::OEMolBase &mol)


Will calculate the minimum distance between every vertex in the surface (surf) and every atom in the molecule (mol). The minimum distance for each vertex is then stored on the surface to be accessed via the OESurface::GetDistance and OESurface::GetDistanceElement methods. Distances are calculated as the euclidean distance between the vertex and atom center minus the atomic radii. Note that this can result in distances that are negative to denote that they are inside the molecule. If atomic radii are not specified on the molecule BondiVdWRadii will be used.

This function will also reassign the atom indices associated with every vertex of the surface. To access these changes use the OESurface::GetAtoms and OESurface::GetAtomsElement methods.