Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def clean_from_file(tmpdir):
outfile = str(tmpdir.mkdir("tmpdir").join('tmp.ply'))
clean_from_file(examples.bunny_scan, outfile, verbose=False,
joincomp=False)
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