Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import numpy as np
- R = 10
- def lower_pen(f):
- f.write('G1 Z-2.0\n')
- def raise_pen(f):
- f.write('G1 Z0.0\n')
- def move(f, x, y):
- f.write('G1 X{:.2f} Y{:.2f}\n'.format(x, y))
- f = open('simple_test.gcode', 'w')
- move(f, 1, 0)
- lower_pen(f)
- for i in np.arange(0, 2 * math.pi, (2 * math.pi) / 50):
- x = math.cos(i)
- y = math.sin(i)
- print('angle: {}; x: {}; y: {}'.format(i, x, y))
- move(f, x, y)
- raise_pen(f)
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement