Esempio n. 1
0
def test_translate(unit_sphere):
    geom.stl_translate(unit_sphere, (-1, -2, 3))
    c = geom.stl_geometric_centre(unit_sphere)
    assert np.all(np.abs(c - np.array([-1, -2, 3])) < TOLERANCE)
Esempio n. 2
0
def test_recentre(off_centre_unit_sphere):
    c = geom.stl_geometric_centre(off_centre_unit_sphere)
    assert not np.all(np.abs(c) < TOLERANCE)
    geom.stl_recentre(off_centre_unit_sphere)
    c = geom.stl_geometric_centre(off_centre_unit_sphere)
    assert np.all(np.abs(c) < TOLERANCE)
Esempio n. 3
0
def test_geometric_center(unit_sphere):
    c = geom.stl_geometric_centre(unit_sphere)
    assert np.all(np.abs(c) < TOLERANCE)
Esempio n. 4
0
def test_translate(unit_sphere):
    geom.stl_translate(unit_sphere, (-1,-2,3))
    c = geom.stl_geometric_centre(unit_sphere)
    assert np.all(np.abs(c - np.array([-1,-2,3])) < TOLERANCE)
Esempio n. 5
0
def test_recentre(off_centre_unit_sphere):
    c = geom.stl_geometric_centre(off_centre_unit_sphere)
    assert not np.all(np.abs(c) < TOLERANCE)
    geom.stl_recentre(off_centre_unit_sphere)
    c = geom.stl_geometric_centre(off_centre_unit_sphere)
    assert np.all(np.abs(c) < TOLERANCE)
Esempio n. 6
0
def test_geometric_center(unit_sphere):
    c = geom.stl_geometric_centre(unit_sphere)
    assert np.all(np.abs(c) < TOLERANCE)