X-Git-Url: http://git.tremily.us/?p=hooke.git;a=blobdiff_plain;f=hooke%2Futil%2Fquickhull.py;h=39e4274bdc44d625805d16e079902460cec77fcf;hp=1b54165f54a7075e59f5fbda5b5d10ab79767039;hb=HEAD;hpb=ae09e7a6081e691c8cecf57fdb7a208c07fc663d diff --git a/hooke/util/quickhull.py b/hooke/util/quickhull.py index 1b54165..39e4274 100644 --- a/hooke/util/quickhull.py +++ b/hooke/util/quickhull.py @@ -98,17 +98,17 @@ def points_inside_hull(hull, points): return inside def print_postscript(sample, hull): - print "%!" - print "100 500 translate 2 2 scale 0 0 moveto" - print "/tick {moveto 0 2 rlineto 0 -4 rlineto 0 2 rlineto" - print " 2 0 rlineto -4 0 rlineto 2 0 rlineto} def" + print('%!') + print('100 500 translate 2 2 scale 0 0 moveto') + print('/tick {moveto 0 2 rlineto 0 -4 rlineto 0 2 rlineto') + print(' 2 0 rlineto -4 0 rlineto 2 0 rlineto} def') for (x,y) in sample: - print x, y, "tick" - print "stroke" - print hull[0,0], hull[0,1], "moveto" + print('{} {} tick'.format(x, y)) + print('stroke') + print(hull[0,0], hull[0,1], 'moveto') for (x,y) in hull[1:]: - print x, y, "lineto" - print "closepath stroke showpage" + print('{} {} lineto'.format(x, y)) + print('closepath stroke showpage') if __name__ == "__main__": #sample = 10*array([(x,y) for x in arange(10) for y in arange(10)])