marching_cubes
marching_cubes(S, GV, nx, ny, nz, isovalue=0.0)
Compute the marching cubes of a scalar field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
S |
(n,) numpy double array
|
Vector of scalar values |
required |
GV |
(n,3) numpy double array
|
Matrix of grid vertices |
required |
nx |
int
|
Number of grid vertices in x direction |
required |
ny |
int
|
Number of grid vertices in y direction |
required |
nz |
int
|
Number of grid vertices in z direction |
required |
isovalue |
double, optional (default
|
Isovalue to use for reconstruction |
0.0
|
Returns |
required | ||
V |
(m,3) numpy double array
|
Matrix of mesh vertices |
required |
F |
(p,3) numpy int array
|
Matrix of triangle indices |
required |
See Also
lazy_cage, fast_winding_number, squared_distance
Examples:
# Some scalar function fun
def fun(V):
return np.sum(V**2,axis=1)
# Generate a grid
GV,_ = gpytoolbox.regular_cube_mesh(100)
# Evaluate scalar function on grid
S = fun(GV)
# Compute isosurface
V,F = gpytoolbox.marching_cubes(S,GV,100,100,100,0.5)
Source code in src/gpytoolbox/marching_cubes.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 51 52 53 54 |
|