sample_surface_uniform#

ifermi.analysis.sample_surface_uniform(vertices, faces, grid_size)[source]#

Sample isosurface faces uniformly.

The algorithm works by:

  1. Splitting the mesh into a uniform grid with block sizes determined by grid_size.

  2. For each cell in the grid, finds whether the center of any faces falls within the cell.

  3. 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.

  4. Returns the indices of all the faces that have been selected.

This algorithm is not well optimised for small grid sizes.

Parameters:
  • vertices (ndarray) – A (n, 3) float array of the vertices in the isosurface.

  • faces (ndarray) – A (m, 3) int array of the faces of the isosurface.

  • grid_size (float) – The grid size in Å^-1.

Return type:

ndarray

Returns:

A (k, ) int array containing the indices of uniformly spaced faces.