# Art & Music: Creating Patterns through Computer Graphics (Spring 2024)

This strand will be used to explore turtle graphics in Snap! with the students of our Spring 2024 course Creating Art, Music, and Games. Instructional content can be found here: Module 1 – Make to Learn

I was trying to create a shape that looks like the roof of the church from the bottom. I first use two different loops, the first loop uses stars to create the center and the second one uses a 17-sided polygon to create the other sides. The result isn't that bad, but the center become very dark from the repeating of drawings, so I used white and redraw it and now its much better.
Beside the drawing, I also created two useful function. One that can draw polygon with anyside. It takes in four inputs: number of sides, x coordinate, y coordinate, and size. The other function is draw star with any number of points. It takes in five inputs: n (how many points), m (each points are m spaces away, for example, the most common star we draw is a 5/2 star), x coordinates, y coordinates, and size. The star function isn't perfect, it's still not working for 4 points star, but its working for most other stars.

Previous: For this assignment I was working with the idea of symmetry and adding geometric shapes/patterns. I just wanted to gain a strong understanding of how to create a pattern using shapes and loved the way the circles looked, something I want to focus more on when submitting my final piece by creating a galaxy potentially. I found it interesting that pieces can have things like shading by having a turtle sprite overlap continuously in a certain area, something I showed in my blue and black circle. I created multiple functions, one to create a simple square and another to create a circle. From those two functions I then expanded and create spiral functions for each shape.

New: For this assignment I was working with the idea of creating geometric shapes/patterns that resembled planet rings. I just wanted to gain a strong understanding of how to create a pattern using shapes and loved the way the circles looked especially when overlapping with no rhyme or reason. I found it interesting that pieces can have things like shading by having a turtle sprite overlap continuously in a certain area, something I showed in my blue and black circle. I created multiple functions to minimize code length for example one being to create a circle and from that I then expanded and created spiral functions for each shape.

For this assignment I wanted to make a design that changed color intermittently and also produced an interesting and gripping geometric shape. I started off with trying to make a triangle shape and built off that. After some troubleshooting I was able to go from the original square pattern to a more triangular look by changing the angle of rotation to 120 degrees. Additionally, I added a nested repetition statement to ensure it shifted a little before recreating the pattern. After I created the pattern on a small scale I looked to scale it up and am hoping to complete by creating a smaller pattern in the middle surround by larger patterns on the outside.

I really liked the symmetrical square and circle overlayed designs in the corners.

I wanted to create a sunflower as I thought that would be particularly suited to the spinning shapes concept that we went over in class. In addition to using Spin Square, I implemented a similar block: Spin Rhombus, which uses different angles from a regular square to create a longer diamond shape. It was particularly useful in capturing the "radiating out" look of petals. I found that squares were better suited to the inner parts of the flower, namely the seeds. I made blocks to create the sunflower seeds and petals (going outwards), as well as blocks that would create them in the reverse direction (going inwards). I also made a block that I think will be more useful going forward: Reset, which clears the drawing and places the Turtle at user-specified coordinates, ready to draw! I wanted to keep the drawing somewhat still abstract, reminiscent of the spirograph drawing kits from our childhood. Overall, I am pretty happy with my drawing, but I still need to practice cleaning up my code when making custom blocks.

For this project I tried to spin circles around to the point in which they looked like rainbow 3D donuts. I used a couple of nested loops to create the circle by changing the angle of rotation by 15 degrees and putting the pen down, move some steps, create another circle until you get a 3D donut shape. I then repeated this 4 times for one row and had 3 rows in the stage. For each loop, I pretty much had a function that abstracted creating a circle, spinning the circle, drawing a row, and drawing a grid.

In this project I explored the concept of radial symmetry combined with complex geometric design. My goal is to develop a deeper understanding of pattern creation through repeated geometric patterns, and I particularly like the beauty of overlapping circles. This is an element I plan to emphasize in the submission. I found the fascinating effect of creating the illusion of shadows by having sprites repeatedly traverse specific areas, as evidenced by the denser white areas in my designs. I originally designed functions for drawing basic shapes such as squares and circles. Building on these basic functions, I developed additional functions to generate spirals from these shapes, resulting in the complex and layered patterns seen here.

In this project, I want create some vines. some intertwined pattern that mimics the natural growth of vines. I used different vibrant colors to contrast against the dark background. I crafted two primary blocks for this project. The first block Circle was designed to establish the fundamental shape that would be replicated. The second block Drawing is used to invoke the Circle multiple times. By using these two blocks, I am in the processing of completing this project.

I knew I wanted a black background so whatever I created would pop and ended up drawing dandelions. I started with the stem, which was a straight line with a thicker pen size. I had the sprite set at pointing downwards (180 degrees) so it wouldn't go flying. For the dandelions, I made circles of various sizes and combined them to form different designs. The last piece of my drawing was the spores, by using the "write" and "go to random position" blocks. My goal is to go into more detail on the flower part because it appears to be too round.

Bear Drawing
In this draft of my week two turtle art drawing, I created an image of a simple bear. I wanted to make something different from geometric patterns, and something that looked like it could be done by hand. Most of the shapes used are circles or half circles. It was a bit difficult trying to make everything symmetrical when you're not following a completely repeating pattern -- as you would for a geometric shape drawing (I think I would need to include inputs and coordinates for this later on). I would also like to add more going on in the background in the future.

My goal was to make a color changing spiral that looked like an optical illusion. I did this by creating circles that gradually grew in size and changed in color to make a cone-like shape. I then repeated this shape in all four corners of the stage so that they would be overlapping to create additional patterns.

Snap! artistic patterns (berkeley.edu)

Old: I wanted to figure out creating a gradient for the background, and though it's not implemented yet, I wanted to figure out an abstract pattern to make for the foreground, similar to the square one we experimented with in class since I'm a fan of abstract designs.

To make the gradient, I use a for loop since I need the iterator. Then, I change the hue of the pen very gradually with modulo and division (the numbers used are arbitrary).

New: I wanted to figure out creating a gradient for the background, and using the Colors and Crayons library, I was able to have more granular control over the gradients by managing modifying the RGB values with every step. Although figuring out the library was a bit a pain, as it makes a couple decisions I wouldn't have realized it makes without looking at the documentation (particularly how color spaces besides RGB are used, which made me work with RGB to make things easier).

I also wanted to do the same for the overlying pattern, which is inspired by this design, and the various abstract patterns people made in class. However, the creation of this pattern seems to be very taxing, as the browser significantly slows while this is running, and I'm not sure how much more optimization I can do.

The way I handle gradients is by calculating the difference between the two colors passed to the function at the start, then dividing that by the number of iterations the loop is going to go through, to ensure a gradual change. But it seems the choking point of the program is using the "set pen _ to", and I'm not quite sure why...

Tech Art 1/22/24

I was trying to use math to make art and ended up stumbling around. I eventually found that the timer has weird behavior when drawing in turbo mode, which ended up making a cool pattern. Eventually, I combined both the original math art idea with the timer pattern to make what I feel can be considered art. Overall the project needs more documentation, but I'll work on that now that I know there are notes.

I initially started with an infinity warp. I used a simple infinity sign to create a cool and somewhat randomized unique backdrop. This included created nested infinity signs each time. The nested infinity signs are consolidated in Circle Pattern. Then I created a fun windmill on top this included ccreating a stem block and then using another triangular loop to create the windmill itself.

I think the use of two distinct blocks, which are circles for shaping and drawing for replication, shows a thoughtful approach to structure and design!

Your dandelions look great! I think the use of the random position block was a great choice for the seeds flying in the air. I also like how the dandelions are thinner in-between the center and the outer part, which matches a cross-section of a real dandelion puff. I noticed that the puffs are not exactly the same when it comes to how "dense" each one looks; the one in the center, for example, looks like it has perhaps lost more spores or is thinner than the other two. Is this a conscious choice to give the dandelions different perceived distances from the viewer? Because if so, very cool!

I'm having some difficulty reading the "Sprite" turtle's blocks. While the blocks in the "Dandelion" turtle are super organized and easy to read, the ones for "Sprite" are less so. I also noticed that "Sprite" remains visible for the entire drawing process. It kind of looks like an abstract dandelion seed, perhaps one closer to the viewer due to its size. I don't know if that's intended to be hidden instead, though.

Love the use of the Y drawing and the random positions for the poofs! I noticed you were experimenting with the warp block on the other sprite (which should probably be hidden or moved, as it's just kinda chilling on the screen there) and it turns out if you put it around your main blocks, the drawing instantly completes, which is pretty cool! Anyway, love what you've done, and I think it's nice with the roundness it currently has

Update Post-Revision: I have changed the structure of my custom command block code in order to be shorter and neater. Now, my Sunflower Petals and Seeds (and their Reversed versions) make use of for-loop structures and if-elif-else structures. As part of this, I no longer set each color by hand, instead adjusting the colors of the petals or seeds by a regular amount each time. I also created new command blocks: Inner Petals, Mid Petals, and Outer Petals. These encapsulate some of the internal repeat structures that were present in the original Sunflower Petals block and made writing the Sunflower Petals Reversed block much easier. Now, I believe that my code is much easier to read and adjust.

It took me a long time to do as I am still trying to get the hang of Snap!. On the one hand, I have some idea of structures I want to make or that would be helpful; on the other, I struggle to navigate Snap!'s blocks that make those things possible. I also struggle with math and algorithms, so if anyone else is also struggling, you are not alone!

This looks really cool! I love how simplistic the structure of your program is, and that you use nested custom blocks to keep things neat. I wonder what it would've looked like to use a forever loop and gradually change the angle, so it would eventually draw these concentric circles around the whole canvas. But this is a great project!