warp.fem.utils.grid_to_tets#

warp.fem.utils.grid_to_tets(Nx, Ny, Nz)[source]#

Constructs a tetrahedral mesh topology by diving each cell of a dense 3D grid into five tetrahedrons

The resulting tets have positive volume assuming that z is the fastest moving index direction

Parameters:
  • Nx (int) – Resolution of the grid along x dimension

  • Ny (int) – Resolution of the grid along y dimension

  • Nz (int) – Resolution of the grid along z dimension

Returns:

Array of shape (5 * Nx * Ny * Nz, 4) containing vertex indices for each tet