sample_surface_uniform¶
- ifermi.analysis.sample_surface_uniform(vertices, faces, grid_size)[source]¶
Sample isosurface faces uniformly.
The algorithm works by:
Splitting the mesh into a uniform grid with block sizes determined by
grid_size
.For each cell in the grid, finds whether the center of any faces falls within the cell.
If multiple face centers fall within the cell, it picks the closest one to the center of the cell. If no face centers fall within the cell then the cell is ignored.
Returns the indices of all the faces that have been selected.
This algorithm is not well optimised for small grid sizes.