axi/examples/device_test.py

24 lines
478 B
Python
Raw Normal View History

2017-01-16 00:24:55 +00:00
import axi
2017-01-07 03:14:32 +00:00
import time
2017-01-16 00:24:55 +00:00
from math import sin, cos, pi
2017-01-07 03:14:32 +00:00
def circle(cx, cy, r, n):
points = []
for i in range(n + 1):
a = 2 * pi * i / n
x = cx + cos(a) * r
y = cy + sin(a) * r
points.append((x, y))
return points
def main():
path = []
for i in range(10):
2017-01-16 00:24:55 +00:00
path.extend(circle(4, 4, (i + 1) * 0.2, 3600))
drawing = axi.Drawing([path]).simplify_paths(0.001)
axi.draw(drawing)
2017-01-07 03:14:32 +00:00
if __name__ == '__main__':
main()