test/test_tri_mesh.rb in gmath3D-0.2.3 vs test/test_tri_mesh.rb in gmath3D-0.2.4

- old
+ new

@@ -171,6 +171,16 @@ def test_area box_mesh = get_box_mesh() assert_equal(94, box_mesh.area) end + + def test_normals_for_each_vertices + box = Box.new(Vector3.new(-1,-1,-1), Vector3.new(1,1,1)) + box_mesh = TriMesh.from_box(box) + result = box_mesh.normals_for_each_vertices + assert_equal( box_mesh.vertices.size, result.size ) + box_mesh.vertices.each do |vertex| + assert_equal(vertex.normalize, result[vertex]) + end + end end