warp.geometry.find_triangle_neighbor_edge_index#

warp.geometry.find_triangle_neighbor_edge_index(
triangle_neighbors: Array[int32],
triangle: int32,
neighbor: int32,
) → int32[source]#
  • Kernel: true

Return the local edge of triangle shared with neighbor.

Parameters:
  • triangle_neighbors – The (num_tris, 3) adjacency array built by tri_tri_adjacency() (its triangle_neighbors output).

  • triangle – Index of the triangle to search.

  • neighbor – 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.