warp.geometry.find_triangle_neighbor_edge_index#

warp.geometry.find_triangle_neighbor_edge_index = <Function find_triangle_neighbor_edge_index(triangle_neighbors: array(ndim=2, dtype=int32), triangle: int32, neighbor: int32)>#

Return the local edge of triangle shared with neighbor.

Parameters:
  • triangle_neighbors (warp.array2d[warp.int32]) – The (num_tris, 3) adjacency array built by tri_tri_adjacency() (its triangle_neighbors output).

  • triangle (int32) – Index of the triangle to search.

  • neighbor (int32) – Index of the triangle to find among triangle’s neighbors.

Returns:

The local edge index j such that triangle_neighbors[triangle, j] == neighbor, or -1 if triangle and neighbor are not adjacent. Calling this with triangle and neighbor swapped recovers a single entry – the value tri_tri_adjacency() would have stored in neighbor_edge_indices had it been called with return_neighbor_edge_indices=True – without having to keep that array around.

Return type:

int32