warp.geometry.tri_tri_adjacency#
- warp.geometry.tri_tri_adjacency(
- indices,
- vertex_count=None,
- return_neighbor_edge_indices=True,
Build triangle-triangle adjacency for a triangle mesh. Assumes edge-manifold with possible boundary (i.e., exactly one or two triangles per edge). Consistent triangle orientation is not required.
- Parameters:
indices (warp.array2d[warp.int32]) – A
(num_tris, 3)warp.arrayof triangle vertex indices (int32).vertex_count (int | None) – Number of vertices in the mesh. If
None, inferred as one plus the maximum vertex index. Must not beNonewhen used in a CUDA graph capture context.return_neighbor_edge_indices (bool) – If
True(default), also compute and return each neighboring triangle’s local edge index for the shared edge. PassFalseto skip this and build only the adjacency array, which is faster and uses less memory (usefind_triangle_neighbor_edge_indexto recover a single such index on demand).
- Returns:
If
return_neighbor_edge_indicesisTrue, a tuple(triangle_neighbors, neighbor_edge_indices)of(num_tris, 3)int32arrays; otherwise the single arraytriangle_neighbors.triangle_neighbors[t, j]is the triangle adjacent to triangletacross the edge opposite local vertexj(the edge joining local vertices(j + 1) % 3and(j + 2) % 3), or-1on a boundary edge.neighbor_edge_indices[t, j]is the local edge index of that shared edge within the neighboring triangle.