Test efficient vertex neighboring triangles for surfaces.
()
| 441 | @pytest.mark.slowtest |
| 442 | @testing.requires_testing_data |
| 443 | def test_triangle_neighbors(): |
| 444 | """Test efficient vertex neighboring triangles for surfaces.""" |
| 445 | this = read_source_spaces(fname)[0] |
| 446 | this["neighbor_tri"] = [list() for _ in range(this["np"])] |
| 447 | for p in range(this["ntri"]): |
| 448 | verts = this["tris"][p] |
| 449 | this["neighbor_tri"][verts[0]].append(p) |
| 450 | this["neighbor_tri"][verts[1]].append(p) |
| 451 | this["neighbor_tri"][verts[2]].append(p) |
| 452 | this["neighbor_tri"] = [np.array(nb, int) for nb in this["neighbor_tri"]] |
| 453 | |
| 454 | neighbor_tri = _triangle_neighbors(this["tris"], this["np"]) |
| 455 | assert all( |
| 456 | np.array_equal(nt1, nt2) for nt1, nt2 in zip(neighbor_tri, this["neighbor_tri"]) |
| 457 | ) |
| 458 | |
| 459 | |
| 460 | def test_accumulate_normals(): |
nothing calls this directly
no test coverage detected