Skip to content

cotangent_weights

cotangent_weights(V, F)

Builds the cotangent weights (cotangent/2) for each halfedge.

The ordering convention for halfedges is the following: [halfedge opposite vertex 0, halfedge opposite vertex 1, halfedge opposite vertex 2]

Parameters:

Name Type Description Default
V (n,d) numpy array

vertex list of a triangle mesh

required
F (m,3) numpy int array

face index list of a triangle mesh

required

Returns:

Name Type Description
C (m,3) numpy array

cotangent weights for each halfedge

Examples:

# Mesh in V,F
from gpytoolbox import cotangent_laplacian
C = cotangent_weights(V,F)
Source code in src/gpytoolbox/cotangent_weights.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def cotangent_weights(V,F):
    """Builds the cotangent weights (cotangent/2) for each halfedge.

    The ordering convention for halfedges is the following:
    [halfedge opposite vertex 0,
     halfedge opposite vertex 1,
     halfedge opposite vertex 2]

    Parameters
    ----------
    V : (n,d) numpy array
        vertex list of a triangle mesh
    F : (m,3) numpy int array
        face index list of a triangle mesh

    Returns
    -------
    C : (m,3) numpy array
        cotangent weights for each halfedge

    Examples
    --------
    ```python
    # Mesh in V,F
    from gpytoolbox import cotangent_laplacian
    C = cotangent_weights(V,F)
    ```
    """

    l_sq = halfedge_lengths_squared(V,F)
    return cotangent_weights_intrinsic(l_sq,F)