# CS111 Lab 02 # Written by CS111 staff # Various designs using layers in cs1graphics # jan 14 17 from cs1graphics import * from cs1graphicsHelper import * from cones import * design = Canvas(900,700,'ivory','i scream, u scream') # TASK 1: Pinwheel # A pinwheel design of single cones (scoop in center first) topCone = treat.clone() rightCone = treat.clone() leftCone = treat.clone() bottomCone = treat.clone() pinwheel = Layer() pinwheel.add(topCone) pinwheel.add(rightCone) pinwheel.add(leftCone) pinwheel.add(bottomCone) rightCone.rotate(270) leftCone.rotate(90) bottomCone.rotate(180) # see the pinwheel centered in the canvas #design.add(pinwheel) #pinwheel.moveTo(450,350) #drawGrid(design,100) #drawReferencePoints(design) # TASK 2 # A firework design of single cones (scoops outward, cones inward) top = treat.clone() right = treat.clone() left = treat.clone() bottom = treat.clone() firework = Layer() firework.add(top) firework.add(right) firework.add(left) firework.add(bottom) right.rotate(90) right.moveTo(180,0) left.rotate(270) left.moveTo(-180,0) bottom.rotate(180) bottom.moveTo(0,180) top.moveTo(0,-180) # View the firework centered in the canvas #design.add(firework) #firework.moveTo(450,350) #drawGrid(design,100) #drawReferencePoints(design) # Task 3: The Wheel # Building upon the firework, make a wheel wheel = Layer() spokes1 = firework.clone() spokes2 = firework.clone() spokes2.rotate(45) wheel.add(spokes1) wheel.add(spokes2) #design.add(wheel) #wheel.moveTo(450,350) #drawGrid(design,100) #drawReferencePoints(design) # Task 4: That 70s design # Combine wheel and pinwheel disco = Layer() center = pinwheel.clone() center.scale(1.25) corner = wheel.clone() corner.scale(0.40) c1 = corner.clone() c2 = corner.clone() c3 = corner.clone() c4 = corner.clone() c1.moveTo(150,150) c2.moveTo(-150,150) c3.moveTo(-150,-150) c4.moveTo(150,-150) disco.add(center) disco.add(c1) disco.add(c2) disco.add(c3) disco.add(c4) #design.add(disco) #disco.moveTo(450,350) #drawGrid(design,100) #drawReferencePoints(design) # Task 5: Collage of 70s design + double scoop artwork = Layer() leftside = disco.clone() leftside.rotate(45) rightside = doubleTreat.clone() rightside.scale(1.5) artwork.add(leftside) artwork.add(rightside) rightside.moveTo(450,100) #design.add(artwork) #artwork.moveTo(350,350) #drawReferencePoints(design) #drawGrid(design,100)