mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-20 22:30:35 +08:00
Mesh normal consistency when no faces intersect
Summary: Corner case where there's nothing to do in this function. Reviewed By: nikhilaravi Differential Revision: D26073476 fbshipit-source-id: eb061683ffe35c1ffa8384c422a1557a636d52cd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7f62eacdb2
commit
e42b0c4f70
@@ -114,6 +114,11 @@ def mesh_normal_consistency(meshes):
|
||||
vert_edge_pair_idx, device=meshes.device, dtype=torch.int64
|
||||
)
|
||||
|
||||
if vert_edge_pair_idx.shape[0] == 0:
|
||||
return torch.tensor(
|
||||
[0.0], dtype=torch.float32, device=meshes.device, requires_grad=True
|
||||
)
|
||||
|
||||
v0_idx = edges_packed[edge_idx, 0]
|
||||
v0 = verts_packed[v0_idx]
|
||||
v1_idx = edges_packed[edge_idx, 1]
|
||||
|
||||
Reference in New Issue
Block a user