connected_components
connected_components(F, return_face_indices=False)
Computes the connected components of a triangle mesh. This follows the convention of gptoolbox (https://github.com/alecjacobson/gptoolbox/blob/master/mesh/connected_components.m)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
F |
(m,3) numpy int array
|
face index list of a triangle mesh |
required |
return_face_indices |
bool, optional (default False)
|
whether to return component IDs for faces for faces |
False
|
Returns:
Name | Type | Description |
---|---|---|
C |
(n,) numpy int array
|
connected component ID for each vertex |
CF |
if requested, (m,) numpy int array
|
connected component ID for each face |
Examples:
V,F = gpy.read_mesh("mesh.obj")
C,CF = gpy.connected_components(F)
Source code in src/gpytoolbox/connected_components.py
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 45 46 |
|