cellcomplex.property_topomesh.analysis.compute_topomesh_vertex_property_from_faces

cellcomplex.property_topomesh.analysis.compute_topomesh_vertex_property_from_faces(topomesh, property_name, weighting='area', neighborhood=1, adjacency_sigma=0.5, verbose=False)[source]

Compute a property on degree 0 using the same property defined at degree 2.

The vertex property is computed by averaging the properties of its neighbor faces, weighting them differently according to the chosen method.

Parameters
  • topomesh (cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to compute the property.

  • property_name (str) – The name of the property to compute (must be already computed on faces).

  • weighting (str) –

    The way weights are assigned to each face for the averaging of the property (default is area)
    • uniform: all the faces have the same weight (1)

    • area: the weight on the faces is equal to their area

    • angle: the weight of the faces is equal to the incidence angle at the considered vertex (neighborhood=1)

    • cotangent: the weight of the faces is equal to the sum of cotangent of opposite angles (neighborhood=1)

    • angular sector: the weight of the faces is computed as the angular sector intersecting face barycenter (neighborhood=1)

  • neighborhood (int) – The ring-distance of faces considered around each vertex (1-ring is immediate neighbor faces).

  • adjacency_sigma (float) – The standard deviation of the gaussian weighting using the ring-distance.

  • verbose (bool) – Whether to display information while the property is being computed

Returns

Return type

None

Note

The PropertyTopomesh passed as argument is updated.

Example

>>> from cellcomplex.property_topomesh.example_topomesh import square_topomesh
>>> from cellcomplex.property_topomesh.analysis import compute_topomesh_property
>>> from cellcomplex.property_topomesh.analysis import compute_topomesh_vertex_property_from_faces
>>> topomesh = square_topomesh(side_length=1)
>>> compute_topomesh_property(topomesh,'normal',2,normal_method='orientation')
>>> compute_topomesh_vertex_property_from_faces(topomesh,'normal',weighting='area',neighborhood=3,adjacency_sigma=1.2)