View source on GitHub

Computes vertex degree based weights for edges of a mesh.

The degree (valence) of a vertex is number of edges incident on the vertex. The weight for an edge $w_{ij}$ connecting vertex $v_i$ and vertex $v_j$ is defined as,

$$ w_{ij} = 1.0 / degree(v_i) \sum_{j} w_{ij} = 1 $$

edges A numpy.ndarray of shape [E, 2], where E is the number of directed edges in the mesh.
dtype A numpy float data type. The output weights are of data type dtype.

weights A dtype numpy.ndarray of shape [E,] denoting edge weights.

ValueError If edges is not a numpy.ndarray or if its shape is not supported, or dtype is not a float type.