remesh_botsch
remesh_botsch(V, F, i=10, h=None, project=True, feature=np.array([], dtype=int))
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
|
feature |
numpy int array, optional (default np.array([], dtype
|
List of indices of feature vertices that should not change (i.e., they will also be in the output). They will be placed at the beginning of the output array in the same order (as long as they were unique). |
np.array([], dtype=int)
|
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 |
Notes
The ordering of the output can be somewhat confusing. The output vertices are ordered as follows: [feature vertices, boundary vertices, other vertices]. If a vertex is both a feature and boundary one, it is treated as a feature vertex for the purposes of the ordering. For a more in-depth explanation see PR #45.
Examples:
# Read a mesh
v, f = gpytoolbox.read_mesh("bunny_oded.obj")
# Do 20 iterations of remeshing with a target length of 0.01
u, g = gpytoolbox.remesh_botsch(v, f, 20, 0.01, True)
Source code in src/gpytoolbox/remesh_botsch.py
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|