]> wolfpit.net Git - hardware/fuck_tomatoes/.git/blob - utils/Gcode.py
t
[hardware/fuck_tomatoes/.git] / utils / Gcode.py
1 from utils import Geometry
2
3 def buildGcodePackage(points, xyMax):
4 package = 'G0 F5000\n'
5 for point in points:
6 if Geometry.pointWithinBounds(point, xyMax):
7 x,y = point
8 package += 'G0 X{:.3f} Y{:.3f}\n'.format(x, y)
9 package += 'M106 S300\nG4 P500\nM107\n'
10 package += 'G0 F5000 X0 Y0\n'
11 return package