Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Jul 8, 2024
1 parent 8fc8d81 commit b82675d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion meshgpt_pytorch/meshgpt_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion meshgpt_pytorch/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.5.10'
__version__ = '1.5.11'

0 comments on commit b82675d

Please sign in to comment.