Commit feb1290c authored by Alexander Dielen's avatar Alexander Dielen

don't use uninitialized face normals to compute vertex normals

parent 8a3d334f
......@@ -73,26 +73,14 @@ class Normals(unittest.TestCase):
self.mesh.update_halfedge_normals()
def test_calc_vertex_normal_fast(self):
self.mesh.request_vertex_normals()
self.mesh.request_halfedge_normals()
self.mesh.request_face_normals()
n = self.mesh.calc_vertex_normal_fast(self.vhandle[2])
self.assertTrue(np.allclose(n, np.array([1, 2, 0])))
self.assertTrue(np.allclose(n, np.array([0.70710678, 0., -0.29289322])))
def test_calc_vertex_normal_correct(self):
self.mesh.request_vertex_normals()
self.mesh.request_halfedge_normals()
self.mesh.request_face_normals()
n = self.mesh.calc_vertex_normal_correct(self.vhandle[2])
self.assertTrue(np.allclose(n, np.array([1, 0, 0])))
def test_calc_vertex_normal_loop(self):
self.mesh.request_vertex_normals()
self.mesh.request_halfedge_normals()
self.mesh.request_face_normals()
n = self.mesh.calc_vertex_normal_loop(self.vhandle[2])
self.assertTrue(np.allclose(n, np.array([0.8660254, 0, 0])))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment