def test_nonuniformscale2d_from_vector(): scale = np.array([1, 2]) h**o = np.array([[scale[0], 0, 0], [0, scale[1], 0], [0, 0, 1]]) tr = NonUniformScale.identity(2).from_vector(scale) assert_equal(tr.h_matrix, h**o)
def test_nonuniformscale_identity_3d(): assert_allclose(NonUniformScale.identity(3).h_matrix, np.eye(4))