From b82675dd4804d1bf6231721556c37daacee4fe4d Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Mon, 8 Jul 2024 12:15:34 -0700 Subject: [PATCH] patch --- meshgpt_pytorch/meshgpt_pytorch.py | 7 ++++++- meshgpt_pytorch/version.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/meshgpt_pytorch/meshgpt_pytorch.py b/meshgpt_pytorch/meshgpt_pytorch.py index 451bec3..0ff95e5 100644 --- a/meshgpt_pytorch/meshgpt_pytorch.py +++ b/meshgpt_pytorch/meshgpt_pytorch.py @@ -157,7 +157,12 @@ def derive_angle(x, y, eps = 1e-5): def get_derived_face_features( face_coords: Float['b nf nvf 3'] # 3 or 4 vertices with 3 coordinates ): - shifted_face_coords = torch.cat((face_coords[:, :, -1:], face_coords[:, :, :-1]), dim = 2) + is_quad = face_coords.shape[-2] == 4 + face_coords_shift = 2 if is_quad else 1 # @sbriseid says quads need to be shifted by 2 + + # shift face coordinates depending on triangles or quads + + shifted_face_coords = torch.roll(face_coords, face_coords_shift, dims = (2,)) angles = derive_angle(face_coords, shifted_face_coords) diff --git a/meshgpt_pytorch/version.py b/meshgpt_pytorch/version.py index 84b3eef..c1bbb90 100644 --- a/meshgpt_pytorch/version.py +++ b/meshgpt_pytorch/version.py @@ -1 +1 @@ -__version__ = '1.5.10' +__version__ = '1.5.11'