.. # split from OESpicoliFunctions.rst:69


.. oe:namespace:: OESpicoli

.. meta::
   :keywords: OECalculateTriangleAreas

.. oe:function:: OECalculateTriangleAreas

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

      .. oe:api::

         bool OECalculateTriangleAreas(const OESurface& surf, float* areas)

   .. oe:language:: python

      .. oe:api:: python

         OECalculateTriangleAreas(surf: OESurface, areas: OEFloatArray) -> bool

   Will calculate the area of every triangle of ``surf`` and store the
   result in the array ``areas`` of that should be large enough to
   hold ``GetNumTriangles()`` floats. The array is indexed by the
   triangle indices.

   :oe:src:`Listing 1<SNIPPET-AtomAreas-CalculateTriangleAreas>`
   demonstrates how to calculate the surface area contribution from
   each atom. It is assumed ``surf`` is an
   :ref:`OESurface <OESpicoli_OESurface>` created from the molecule ``mol``.

   .. oe:source:: CalculateTriangleAreas.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-AtomAreas
      :caption: Calculates the surface area contribution from each atom
      :refnum: 1

   .. oe:source:: CalculateTriangleAreas.py
      :language: python
      :frag:     SNIPPET-AtomAreas
      :caption: Calculates the surface area contribution from each atom
      :refnum: 1

..  oe:language:: python

    :ref:`Full listing. <listing-CalculateTriangleAreas.py>`


   .. oe:source:: CalculateTriangleAreas.java
      :language: java
      :noindent:
      :frag:     SNIPPET-AtomAreas
      :caption: Calculates the surface area contribution from each atom
      :refnum: 1

   .. oe:source:: CalculateTriangleAreas.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-AtomAreas
      :caption: Calculates the surface area contribution from each atom
      :refnum: 1


