random_points_on_mesh
random_points_on_mesh(V, F, n, rng=np.random.default_rng(), distribution='uniform', return_indices=False)
Samples a mesh V,F according to a given distribution. Valid meshes are polylines or triangle meshes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
V |
(n_v,d) numpy array
|
vertex list of vertex positions |
required |
F |
(m,k) numpy int array
|
if k==2, interpret input as ordered polyline; if k==3 numpy int array, interpred as face index list of a triangle mesh |
required |
rng |
numpy rng, optional (default
|
which numpy random number generator to use |
np.random.default_rng()
|
n |
int
|
how many points to sample |
required |
method |
string, optional (default
|
According to which distribution to sample. Currently, only uniform is supported. |
required |
return_indices |
bool, optional (default
|
Whether to return the indices for each element along with the barycentric coordinates of the sampled points within each element |
False
|
Returns:
Name | Type | Description |
---|---|---|
x |
(n,d) numpy array
|
the n sampled points |
I |
(n,) numpy int array
|
element indices where sampled points lie (if requested) |
u |
(n,k) numpy array
|
barycentric coordinates for sampled points in I |
Examples:
TODO
Source code in src/gpytoolbox/random_points_on_mesh.py
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 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 |
|