def main():
opts = docopt.docopt(__doc__)
radius = float(opts['<RADIUS>'])
nlines = int(opts['<NUM_LINES>'], 0)
npoints = int(opts['<NUM_POINTS>'], 0)
outfilename = opts['<OUTFILE>']
if not outfilename:
outfilename = 'os_%f_%d_%d.ngc' % (radius, nlines, npoints)
logging.getLogger('MainApp').info('Gcode file name: %s' % (outfilename))
p = OldSchoolPattern(radius=radius, nlines=nlines, npoints=npoints)
s = PathSimplifier()
comment = '''Generated by oldschool.py with parameters:
Radius: %f
Number of lines: %d
Number of points/line: %d''' % (radius, nlines, npoints)
g = GCodeGenerator(open(outfilename, 'w'), comment)
p.giterate(s.add_vector)
vectors = s.simplify()
#
# adjust all vectors to be negative only
#
vectors = add_to_vectors(vectors, -Point(radius, radius))
g.generate(vectors)
评论列表
文章目录