Ibrahim Riaz CS 151 Project 2
Skip to end of metadata
Go to start of metadata

Ibrahim Riaz CS 151 Project 2 


Abstract:

 

This project was designed to improve upon my learning in the class this week and organize the tools we were given, namely for loops, parameterization and functions to create artworks inspired by Sol Lewitt. In my extensions, I leverages the random package, controlled my randomness, used pen and fill colors and played around with increasing edge sizes  in different ways. Functions are a set of commands upon which the computer acts and the parameters are simply bits of informational variables manipulated by the user. Therefore, in the true spirit of art, I started with the creation of some very basic shapes : triangle and hexagon and recalled the functions to create more complex shapes and eventually complex art works which will hopefully be hung in museums soon.

Task 1:

 

To begin the project, I creates a set of simple shapes. These shapes were a block (editable by the user to be both a square of a rectangle), a triangle and a hexagon. These shapes were created using turtle and the use of for loops so that I would have to write less code.

In order to create shapes with greater user control, I used parameters that allow a user to determine where and how large these simple shapes would be in terms of edge sizes.

 

 

Task 2:





 

For my next task I simply used parameters and recalls pre-existing triangle and hexagon functions to create more complex shapes. The beauty of this process is that I can scale my pictures up or down in size using the scale parameter and also control where they are created by manipulating the x and y parameter.

 

Task 3:

 

The last and more final task was creating two distinct works of art inspired by Sol Lewitt.

 

As someone who was inspired by the use of geometric shapes by Lewitt, all of my works utilized increasing scales, complex shapes and for loops in order to create artworks which are intended to serve as both optical illusions and therapy. I used white ink for the pen and black for the fill to make the shape cooler.

 

The second art piece was similarly a work inspired by geometric shapes.

 

 

 

Extension 1 

 

For my first extension, I created a new scene using circles and parameters. I had a lot of trouble creating a circle so instead of using a formula of ngon with very small angles, I used the turtle circle function in python. Using this function in tandem with loops to create a range and by changing the x, y coordinates as I wanted using parameters allowed me to recreate Sol Lewis drawing.

 

Extension 2 & 4

As a second extension, I chose to utilize the use of colors and learnt that my pictures were more engaging wit colors and in this picture, I simply use blue to recreate my original scene. Update: I also created a list and then used a random function to random choose a color for the pen and the fill color for my original art works.

 

Extension 3

 

For my third extension, I utilize lists, randomization and colors and parameters in a creative and fun way. By using ranges and limits, I create complex shapes that pop up in random colors taken from a list, are filled by random colors and then are created in increasing sizes in random places within a part on the screen. By restricting parameters to lets say  x in range 0, 100 - I could restrict my shapes to the top right quadrant of the screen and so on.

Extension 5: Limiting shapes to a quadrant and changing extra parameters like width.

To illustrate, I restricted everything to the top right quadrant and increased the width of all shapes created to show more control and understanding of the process.


Questions:

  1. Does breaking a scene into pieces make it easier to create?
    Yes. Breaking a project down means one can make simple functions which help visualize the larger picture but also ensure we write cleaner and less code overall which can be reused multiple times.
  2. What is a for loop and why are they useful?
    For loops are commands that let you execute a series of commands multiple times with the ability to manipulate parameters such as increasing size with every rerun amongst other things. A for loop is useful as you can simply input a range to delineate how many times you wish to execute a function instead of retyping a line of code 80 times.

  3. What is the difference between using "from turtle import *" and "import turtle"? Explain from both a practical use point of view and how they differentially affect the global symbol table.
    Import turtle as t means we delineate every command with a t. prior to typing out the command as opposed to from turtle import *. This means to turn right we would say t.right as opposed to simply right. Practically this means adding an extra letter but it is better practice and helps someone reading code understand which commands are utilizing turtle. 
  4. Which Sol Lewitt work did you choose as inspiration? Why?
    Drawing 47 as it reminded of the time when I was super into geometric shapes in middle school mathematics class.

Conclusion:

A brief description (1-3 sentences) of what you learned. Think about the answer to this question in terms of the stated purpose of the project. What are some specific things you had to learn or discover in order to complete the project?

I liked this project because it offered a lot of creativity. Moreover, it was heavily dependent on the use of functions which meant that although I did not have to code a lot, I did have to code smart. that meant having a strong understanding of both for loops and functions with parameters. Another thing I had to use was lists and random packages, they were definitely something I had not learnt in class. Moreover the ability to manipulate colors was an added benefit of this project as it helped me construct and understand my visualizations better.

Acknowledgements:

TA

Angie Lu 

 

A list of people you worked with, including TAs and professors. Include in that list anyone whose code you may have seen, such as those of friends who have taken the course in a previous semester.

A list of any resources that you used.  This includes textbooks, lecture notes, python documentation, library documentation or forums.  If you used a specific website, please link to it.

Put the label cs151s20project# on your wiki page.

Labels
  • No labels