openalea.cellcomplex.property_topomesh.property_topomesh_analysis.compute_topomesh_triangle_properties

openalea.cellcomplex.property_topomesh.property_topomesh_analysis.compute_topomesh_triangle_properties(topomesh, positions=None)[source]

Compute an usual set of properties over the faces of a PropertyTopomesh.

The function computes several geometrical properties assuming the structure passed as argument is a PropertyTopomesh representing a triangular mesh. The area, perimeter and eccentricity of each triangular face is computed and the corresponding properties updated in the structure.

Parameters:
  • topomesh (openalea.cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to compute the property.
  • positions (dict, optional) – A position dictionary if the property (‘barycenter’,0) is empty.
Returns:

None

Note

The PropertyTopomesh passed as argument is updated.

Example

>>> from openalea.cellcomplex.property_topomesh.example_topomesh import square_topomesh
>>> from openalea.cellcomplex.property_topomesh.property_topomesh_analysis import compute_topomesh_triangle_properties
>>> topomesh = square_topomesh(side_length=1)
>>> compute_topomesh_triangle_properties(topomesh)
>>> print topomesh.wisp_property('area',2)
{0: 0.5, 1: 0.5}