def test_z_rotate(self): alpha = radians(25) t = Matrix44.z_rotate(alpha) x = diag((1., 1., 1., 1.)) x[0, 0] = cos(alpha) x[1, 0] = -sin(alpha) x[0, 1] = sin(alpha) x[1, 1] = cos(alpha) self.assertTrue(equal_matrix(t, x))
def write(filename, sponge, merge=False): dwg = ezdxf.new('R2000') transform = Matrix44.chain(Matrix44.z_rotate(math.radians(45)), Matrix44.translate(5, 3, 4)) sponge.render(dwg.modelspace(), merge=merge, matrix=transform) dwg.saveas(filename)