예제 #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)
예제 #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)
예제 #3
0
def test_geometric_center(unit_sphere):
    c = geom.stl_geometric_centre(unit_sphere)
    assert np.all(np.abs(c) < TOLERANCE)
예제 #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)
예제 #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)
예제 #6
0
def test_geometric_center(unit_sphere):
    c = geom.stl_geometric_centre(unit_sphere)
    assert np.all(np.abs(c) < TOLERANCE)