1 2from piddleAI import * # change these to whatever 3canvas = AICanvas(name="Sample1.ai") # backend you want to test 4 5canvas.defaultLineColor = Color(0.7,0.7,1.0) # light blue 6canvas.drawLines( map(lambda i:(i*10,0,i*10,300), range(30)) ) 7canvas.drawLines( map(lambda i:(0,i*10,300,i*10), range(30)) ) 8canvas.defaultLineColor = black 9 10canvas.drawLine(10,200, 20,190, color=red) 11canvas.drawEllipse( 130,30, 200,100, fillColor=yellow, edgeWidth=4 ) 12 13canvas.drawArc( 130,30, 200,100, 45,50, edgeColor=navy, edgeWidth=4 ) 14 15canvas.defaultLineWidth = 4 16canvas.drawRoundRect( 30,30, 100,100, fillColor=blue, edgeColor=maroon ) 17canvas.drawCurve( 20,20, 100,50, 50,100, 160,160 ) 18 19#canvas.drawString("This is a test!", 30,130, Font(face="times",size=16,bold=1), 20# color=green, angle=-45) 21 22polypoints = [ (160,120), (130,190), (210,145), (110,145), (190,190) ] 23canvas.drawPolygon(polypoints, fillColor=lime, edgeColor=red, edgeWidth=3, closed=1) 24 25canvas.drawRect( 200,200,260,260, edgeColor=yellow, edgeWidth=5 ) 26canvas.drawLine( 200,260,260,260, color=green, width=5 ) 27canvas.drawLine( 260,200,260,260, color=red, width=5 ) 28 29canvas.flush() 30