Skip to content

Commit d3e0486

Browse files
committed
address #92 (comment) again
1 parent b82675d commit d3e0486

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

meshgpt_pytorch/meshgpt_pytorch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,17 @@ def get_derived_face_features(
158158
face_coords: Float['b nf nvf 3'] # 3 or 4 vertices with 3 coordinates
159159
):
160160
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
162161

163162
# shift face coordinates depending on triangles or quads
164163

165-
shifted_face_coords = torch.roll(face_coords, face_coords_shift, dims = (2,))
164+
shifted_face_coords = torch.roll(face_coords, 1, dims = (2,))
166165

167166
angles = derive_angle(face_coords, shifted_face_coords)
168167

168+
if is_quad:
169+
# @sbriseid says quads need to be shifted by 2
170+
shifted_face_coords = torch.roll(shifted_face_coords, 1, dims = (2,))
171+
169172
edge1, edge2, *_ = (face_coords - shifted_face_coords).unbind(dim = 2)
170173

171174
cross_product = torch.cross(edge1, edge2, dim = -1)

meshgpt_pytorch/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.5.11'
1+
__version__ = '1.5.12'

0 commit comments

Comments
 (0)