Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_clean():
meshfix = _meshfix.PyTMesh()
meshfix.load_file(examples.bunny_scan)
# v, f = meshfix.return_arrays()
# assert f.shape[0] == bunny.n_faces
assert meshfix.boundaries()
meshfix.clean()
assert not meshfix.boundaries()
def test_load_and_save_file(tmpdir):
meshfix = _meshfix.PyTMesh()
meshfix.load_file(examples.bunny_scan)
with pytest.raises(Exception):
meshfix.load_file(examples.bunny_scan)
v, f = meshfix.return_arrays()
assert f.shape[0] == bunny.n_faces
# test saving
filename = str(tmpdir.mkdir("tmpdir").join('tmp.ply'))
meshfix.save_file(filename)
new_bunny = pv.PolyData(filename)
assert new_bunny.points.shape == v.shape