mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 05:40:34 +08:00
Fix save_ply with noncontiguous faces
Summary: As noted in #710, save_ply was failing with some values of the faces tensor. It was assuming the faces were contiguous in using view() to change them. Here we avoid doing that. Reviewed By: patricklabatut Differential Revision: D29159655 fbshipit-source-id: 47214a7ce915bab8d81f109c2b97cde464fd57d8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8006842f2a
commit
354a1808ff
@@ -353,6 +353,11 @@ class TestMeshPlyIO(TestCaseMixin, unittest.TestCase):
|
||||
save_ply(file, verts=verts, faces=faces, verts_normals=normals)
|
||||
file.close()
|
||||
|
||||
def test_contiguity_unimportant(self):
|
||||
verts = torch.rand(32, 3)
|
||||
self._test_save_load(verts, torch.randint(30, size=(10, 3)))
|
||||
self._test_save_load(verts, torch.randint(30, size=(3, 10)).T)
|
||||
|
||||
def test_empty_save_load(self):
|
||||
# Vertices + empty faces
|
||||
verts = torch.tensor([[0.1, 0.2, 0.3]])
|
||||
|
||||
Reference in New Issue
Block a user