mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 22:00:35 +08:00
Handle header has no newline or space after OFF. (#665)
Summary: Allow a line like `OFF10 10 10` as the start of an OFF file. Such things apparently occur in ModelNet40. This resolves https://github.com/facebookresearch/pytorch3d/issues/663. Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/665 Test Plan: New test Reviewed By: nikhilaravi Differential Revision: D28180006 Pulled By: bottler fbshipit-source-id: 7f474c6a262e32da012217e09f76e8672a7f0278
This commit is contained in:
committed by
Facebook GitHub Bot
parent
34163326b2
commit
5241b7dd4e
@@ -254,6 +254,11 @@ class TestMeshOffIO(TestCaseMixin, unittest.TestCase):
|
||||
lines2[0] = "OFF " + lines[0]
|
||||
load(lines2)
|
||||
|
||||
# OFF line can be merged in to the first line with no space
|
||||
lines2 = lines.copy()
|
||||
lines2[0] = "OFF" + lines[0]
|
||||
load(lines2)
|
||||
|
||||
with self.assertRaisesRegex(ValueError, "Not enough face data."):
|
||||
load(lines[:-1])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user