
In this project, you will practice creating parent-child class inheritance relationships to create new, unique shapes with minimal redundant code.
Shape child classesIn shapes.py, create at least two more classes that inherit from Shape (not counting Square). The constructor for each one should contain at least parameters for
distancecolorfillWrite one test function in shapes.py that draws all 2+ shapes. The function should showcase the properties of the different shape classes (fill, color, size, etc.).
Take a screenshot — this is Required Image 1 in your project report.
Hint: You will need to call the Shape hold method from your test function to keep the window open.
Create a new file named mosaic.py.
Important: mosaic.py should NOT import turtle or turtle_interpreter. The goal this week is to do all drawing using objects of child classes of Shape (think of it as a fun challenge!). Drawing using TurtleInterpreter methods or using turtle indirectly through TurtleInterpreter is off-limits
Loosely inspired by MC Escher or Islamic Mosaics, design a tile. For this assignment, a tile is a square that has 4 or more shapes inside of the square.
In a file named mosaic.py, create a function tile(x, y, scale) that draws 4 or more shapes inside a square. Define the lower left corner of the tile at location (x, y). The scale determines the size of the tile and scales the pattern as well. The tile by default (when scale is 1) should be 100x100 (should be 100 distance wide and 100 distance high). If scale is 2, then the tile should be 200x200.
In mosaic.py, create a function test_tile() that draws the tile in 3 different locations at 3 different scales.
Call test_tile() and take a screenshot of the resuting image. This is Required Image 2 in your project report.
Create a grid of 20 tiles.
Define a function mosaic(x, y, scale, Nx, Ny) that draws a 2D array of tiles Nx by Ny, where each tile is of size scale*100 by scale*100, and the lower left corner of the mosaic is at (x, y). So if scale is .5, Nx is 5, and Ny is 4, the function should draw twenty 50x50 tiles in a grid five across and four down.
In mosaic.py, create a function test_mosaic() that calls the mosaic function 3 times with different x, y, and scale arguments. One of the mosaic function calls should have Nx = 5 and Ny = 4 as arguments.
Call test_mosaic() and take a screenshot of the resuting image. This is Required Image 3.
In your report section called Art Reflection discuss which compositions inspired you and what aspects of theirs you emulated.
In order to grade your project, we need to be able to run your code and get the same results as you do! In your project submission ZIP file, please include any L-system .txt files that are needed run your code.
Here is a summary of the expected outputs from each of the source code files that you created:
python3 shapes.py: Draw a test collection of shapes that you implemented through Shape class inheritance.python3 mosaic.py: Draws your mosaic in 3 locations at 3 scales.If you use command-line arguments, please explain what they are and provide an example way to run your code in your report as part of the image caption.
Congratulations on completing the core tasks! Between the code that you’ve already written and the report that you write, you’ve already earned up to 26/30 points for this project. If you turn it in by the first deadline that's 27/30 points.
The remaining 3/30 are a chance for you to earn credit for exploring parts of this project and digging deeper to express your creativity! This is entirely optional; 27/30 is an A- and is a perfectly respectable place to stop. Extensions are open-ended and exist to compliment the structured core project. Explore and learn something new that interests you! Concentrating your energy on 2 "deep" extensions that challenge you will earn you more points than many small, "shallow" extensions.
You can pick your own topics that interest you. Here are a few examples:
drawString so that when drawing a tree the branches droop down like gravity is pulling at them. (1pts)To turn in your project, make sure you do all of the following:
hewolfe_Project9.© 2021 Hannen Wolfe and Oliver Layton