Skip to content

Commit b82675d

Browse files
committed
patch
1 parent 8fc8d81 commit b82675d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

meshgpt_pytorch/meshgpt_pytorch.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ def derive_angle(x, y, eps = 1e-5):
157157
def get_derived_face_features(
158158
face_coords: Float['b nf nvf 3'] # 3 or 4 vertices with 3 coordinates
159159
):
160-
shifted_face_coords = torch.cat((face_coords[:, :, -1:], face_coords[:, :, :-1]), dim = 2)
160+
is_quad = face_coords.shape[-2] == 4
161+
face_coords_shift = 2 if is_quad else 1 # @sbriseid says quads need to be shifted by 2
162+
163+
# shift face coordinates depending on triangles or quads
164+
165+
shifted_face_coords = torch.roll(face_coords, face_coords_shift, dims = (2,))
161166

162167
angles = derive_angle(face_coords, shifted_face_coords)
163168

meshgpt_pytorch/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.5.10'
1+
__version__ = '1.5.11'

0 commit comments

Comments
 (0)