Institute for Personal Robots in Education Blog

Picasso's Dog

Thanks to Julia Ferraioli for a link to Math ∩ Programming. This post on Bezier Curves and Picasso translates nicely into Calico Python (code below). Makes an interesting discussion, even for younger students, using Calico Jigsaw (inspired by Scratch, code to right).

# After:
# http://jeremykun.com/2013/05/11/bezier-curves-and-picasso/

from Graphics import *
win = Window(500, 500)
curves = [
    Curve([180,280], [183,268], [186,256], [192,244]), # front leg
    Curve([191,244], [290,244], [300,230], [339,247]), # tummy
    Curve([340,246], [350,290], [360,300], [355,207]), # back leg
    Curve([351,210], [370,207], [380,196], [375,193]), # tail
    Curve([375,193], [310,220], [190,220], [162,205]), # back
    Curve([164,205], [135,194], [135,265], [153,275]), # ear start
    Curve([153,275], [168,275], [170,180], [149,190]), # ear end + head
    Curve([149,190], [122,214], [142,204], [ 85,240]), # nose bridge
    Curve([ 86,240], [100,247], [125,233], [140,238]), # mouth
]

win.setBackground(Color("white"))
for curve in curves:
    curve.border = 3
    curve.draw(win)

AttachmentSize
Screenshot from 2013-05-11 23:49:39.png38.01 KB
Screenshot from 2013-05-11 23:11:03.png36.65 KB
Screenshot from 2013-05-11 12:18:44.png16.36 KB

Post new comment

  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
More information about formatting options