Skip to main content

build_neighbor_matrix

Function build_neighbor_matrix 

Source
pub fn build_neighbor_matrix(
    n_vertices: usize,
    faces: &[[usize; 3]],
    max_neighbors: usize,
) -> (Vec<Vec<usize>>, Vec<usize>)
Expand description

Build neighbor matrix for vectorized neighbor lookups

Returns (neighbor_matrix, neighbor_counts) where:

  • neighbor_matrix[i] contains the indices of vertex i’s neighbors (padded with usize::MAX)
  • neighbor_counts[i] is the number of valid neighbors for vertex i