def test_from_list(): numbers = [1, 0, 0, 3, 0, 1, 0, 4, 0, 0, 1, 5, 0, 0, 0, 1] T = Transformation.from_list(numbers) assert T.matrix == [[1.0, 0.0, 0.0, 3.0], [0.0, 1.0, 0.0, 4.0], [0.0, 0.0, 1.0, 5.0], [0.0, 0.0, 0.0, 1.0]]
def _to_xform(m): m = m if len(m) == 16 else m + [0, 0, 0, 1] return xform_from_transformation(Transformation.from_list(m))