mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 22:00:35 +08:00
avoid recalculating normals for simple move
Summary: If offset_verts_ is used to move meshes with a single vector, the normals won't change so don't need to recalculate. I am planning to allow user-specified vertex normals. This change means that user-specified vertex normals won't get overwritten when they don't need to be. Reviewed By: nikhilaravi Differential Revision: D27765256 fbshipit-source-id: f6e4d308ac9ac023030325cb75a18d39b966cf88
This commit is contained in:
committed by
Facebook GitHub Bot
parent
17633808d8
commit
502f15aca7
@@ -486,6 +486,7 @@ class TestMeshes(TestCaseMixin, unittest.TestCase):
|
||||
self.assertClose(
|
||||
new_mesh.verts_normals_list()[i],
|
||||
new_mesh_naive.verts_normals_list()[i],
|
||||
atol=1e-6,
|
||||
)
|
||||
self.assertClose(
|
||||
new_mesh.faces_normals_list()[i],
|
||||
@@ -533,10 +534,14 @@ class TestMeshes(TestCaseMixin, unittest.TestCase):
|
||||
|
||||
# check face areas, normals and vertex normals
|
||||
self.assertClose(
|
||||
new_mesh.verts_normals_packed(), new_mesh_naive.verts_normals_packed()
|
||||
new_mesh.verts_normals_packed(),
|
||||
new_mesh_naive.verts_normals_packed(),
|
||||
atol=1e-6,
|
||||
)
|
||||
self.assertClose(
|
||||
new_mesh.verts_normals_padded(), new_mesh_naive.verts_normals_padded()
|
||||
new_mesh.verts_normals_padded(),
|
||||
new_mesh_naive.verts_normals_padded(),
|
||||
atol=1e-6,
|
||||
)
|
||||
self.assertClose(
|
||||
new_mesh.faces_normals_packed(), new_mesh_naive.faces_normals_packed()
|
||||
|
||||
Reference in New Issue
Block a user