upper_envelope
upper_envelope(V, T, D)
Slices tet mesh according per-vertex material soft labels
Parameters:
Name | Type | Description | Default |
---|---|---|---|
V |
numpy double array
|
Matrix of tet mesh vertex coordinates |
required |
T |
numpy int array
|
Matrix of tet mesh indices into V |
required |
D |
numpy double array
|
Matrix of per-vertex labels: each column corresponds to a different material and has per-vertex soft labels between zero and one |
required |
Returns:
Name | Type | Description |
---|---|---|
U |
numpy double array
|
Matrix of sliced, output tet mesh vertex coordinates |
G |
numpy int array
|
Matrix of sliced, output tet mesh indices into U |
LT |
numpy int array
|
Matrix of hard per-tet labels: in the same style of D, but only taking values one and zero. |
Notes
This uses the algorithm described by Abdrashitov et al. in "Interactive Modelling of Volumetric Musculoskeletal Anatomy". We thank the first author, Rinat Abdrashitov, for providing an initial version of the code.
Examples:
# Build a tet mesh
V,T = gpytoolbox.regular_cube_mesh(20)
# Build a soft label for each vertex
l = np.zeros((V.shape[0],2))
l[:,0] = np.linalg.norm(V,axis=1)
l[:,1] = 1.0 - l[:,0]
# Slice the mesh
U,G,LT = gpytoolbox.upper_envelope(V,T,l)
# U is the sliced mesh
Source code in src/gpytoolbox/upper_envelope.py
3 4 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 45 46 47 48 49 50 |
|