Skip to content

remesh_botsch

remesh_botsch(V, F, i=10, h=None, project=True)

Remesh a triangular mesh to have a desired edge length

Use the algorithm described by Botsch and Kobbelt's "A Remeshing Approach to Multiresolution Modeling" to remesh a triangular mesh by alternating iterations of subdivision, collapse, edge flips and collapses.

Parameters:

Name Type Description Default
V numpy double array

Matrix of triangle mesh vertex coordinates

required
F numpy int array

Matrix of triangle mesh indices into V

required
i int, optional (default 10)

Number of algorithm iterations

10
h double, optional (default 0.1)

Desired edge length (if None, will pick average edge length)

None
project bool, optional (default True)

Whether to reproject the mesh to the input (otherwise, it will smooth over iterations).

True

Returns:

Name Type Description
U numpy double array

Matrix of output triangle mesh vertex coordinates

G numpy int array

Matrix of output triangle mesh indices into U

Examples:

TODO

Source code in src/gpytoolbox/remesh_botsch.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
36
37
38
39
40
41
42
43
44
def remesh_botsch(V,F,i=10,h=None,project=True):
    """Remesh a triangular mesh to have a desired edge length

    Use the algorithm described by Botsch and Kobbelt's "A Remeshing Approach to Multiresolution Modeling" to remesh a triangular mesh by alternating iterations of subdivision, collapse, edge flips and collapses.

    Parameters
    ----------
    V : numpy double array
        Matrix of triangle mesh vertex coordinates
    F : numpy int array
        Matrix of triangle mesh indices into V
    i : int, optional (default 10)
        Number of algorithm iterations
    h : double, optional (default 0.1)
        Desired edge length (if None, will pick average edge length)
    project : bool, optional (default True)
        Whether to reproject the mesh to the input (otherwise, it will smooth over iterations).

    Returns
    -------
    U : numpy double array
        Matrix of output triangle mesh vertex coordinates
    G : numpy int array
        Matrix of output triangle mesh indices into U

    Examples
    --------
    TODO
    """
    try:
        from gpytoolbox_bindings import _remesh_botsch_cpp_impl
    except:
        raise ImportError("Gpytoolbox cannot import its C++ binding.")

    if (h is None):
        h = np.mean(halfedge_lengths(V,F))

    v,f = _remesh_botsch_cpp_impl(V,F.astype(np.int32),i,h,project)

    return v,f