Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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
Пример #4
0
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)
Пример #5
0
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
Пример #6
0
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)