Skip to end of metadata
Go to start of metadata

In this week's project we are supposed to get familiar with inheritance and class. Also, we learn how to use dictionary to build better lsystems. 

For the first task, I made this picture. These trees are created based on systemI, with iteration number 3. Since there are several replacement for one rule these trees are variable. 

I add some simple classes to my shapes document. As you can see, except square and triangle, i build pentagon, hexagon and star.

I also add color fill argument to every class. So that when I want to fill color in these figures I only need to set the fill value True. 

Next one is the indoor scene. As you can see, I create this scene only with figures shown above. At first I used loop and square class to build the mosaic floor and wall. To make them look better I set random color but control the range of rgb value. So the wall is generally blue and the floor is brown. 

The last task is the mosaic files. I create a simple file with a square and a star. To keep the random color of square and star different I set the star's rgb value in different order with square. 

I create a hexagon mosaic picture. It is important to find out the location relationship of nearby files. I did it in this way:


Next part is a new lsystem. I made some change to one of my old lsystem and get a totally new graph. This lsystem is shown below:
base V
rule F FF FFF
iteration number is 3 and angle is 144.

Next one is the tilt trees. To make this I make some change to the drawstring function. 
            #if t.heading()<90:
I also build a Ngon class. Since I had written similar code before it's quite easy. This class can draw Ngon with given number of sides. I add fill color argument to it. This is a simple example of class that can build string itself. 
In this week, I learned how to use class and dictionary to improve my lsystem and create more interesting graphs. I am now more familiar with these methods. 

People I worked with:

Pengyu Ren

  • No labels