Ejemplo n.º 1
0
def create_drawing(scale=1.0):
    t = PdfTurtle.create(600, 600)
    t.fillcolor('blue')
    t.begin_fill()
    for i in range(20):
        d = (50 + i*i*1.5)
        t.pencolor(0, 0.05*i, 0)
        t.width(i)
        t.forward(d)
        t.right(144)
    t.end_fill()

    drawing = t.to_reportlab()

    # Scale the Drawing.
    drawing.scale(scale, scale)
    drawing.width *= scale
    drawing.height *= scale
    return drawing
Ejemplo n.º 2
0
 def draw(self):
     t = PdfTurtle(self.canv, self._frame)
     draw_spiral(t)
Ejemplo n.º 3
0
 def draw(self):
     t = PdfTurtle(self.canv, self._frame, self.width, self.height)
     t.up()
     t.back(self.width/2)
     t.left(90)
     t.forward(self.height/2)
     t.right(90)
     t.down()
     draw_diagram(t, self.board_state, self.cell_size)
Ejemplo n.º 4
0
 def draw(self):
     t = PdfTurtle(self.canv, self._frame, self.width, self.height)
     t.up()
     t.back(self.width / 2)
     t.left(90)
     t.forward(self.height / 2)
     t.right(90)
     t.down()
     try:
         draw_diagram(t, self.board_state, self.cell_size)
     except:
         print(self.board_state)
         raise
Ejemplo n.º 5
0
 def draw(self):
     t = PdfTurtle(self.canv, width=self.width, height=self.height)
     t.fillcolor('blue')
     t.begin_fill()
     for i in range(20):
         d = (50 + i*i*1.5)*self.scale
         t.pencolor(0, 0.05*i, 0)
         t.width(i*self.scale)
         t.forward(d)
         t.right(144)
     t.end_fill()
Ejemplo n.º 6
0
 def draw(self):
     t = PdfTurtle(self.canv, width=self.width, height=self.height)
     t.fillcolor('blue')
     t.begin_fill()
     for i in range(20):
         d = (50 + i * i * 1.5) * self.scale
         t.pencolor(0, 0.05 * i, 0)
         t.width(i * self.scale)
         t.forward(d)
         t.right(144)
     t.end_fill()