def off_centre_unit_sphere(geomdir, tmpdir): """An stl.mesh.Mesh representing the unit sphere off centre.""" stl_path = os.path.join(geomdir, 'unit_sphere.stl') g = geom.stl_load(stl_path) g.x += 0.1 g.y += 0.2 g.z -= 0.3 # We save and re-load the geometry to make sure it's as if we loaded from # disk in the first place. tmp_stl = os.path.join(tmpdir.strpath, 'temp.stl') g.save(tmp_stl) return geom.stl_load(tmp_stl)
def test_load_stl(geomdir): stl_path = os.path.join(geomdir, 'unit_sphere.stl') assert os.path.isfile(stl_path) g = geom.stl_load(stl_path) assert g is not None
def unit_sphere(geomdir): """An stl.mesh.Mesh representing the unit sphere.""" stl_path = os.path.join(geomdir, 'unit_sphere.stl') return geom.stl_load(stl_path)