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