Generating Artistic Patterns with a Computer

Many artists now use computers to create art. Artists like Bathsheba Grossman develop algorithms that generate artistic patterns.

Block programming languages like Scratch and Snap! enable anyone to explore the generation of artistic designs through algorithms. A free account for Snap! can be obtained at the following web address:

The Snap Workspace

The Snap! workspace consists of a Command Palette with commands on the left, a Script Area in the middle, and a Stage on the right.

Actors called sprites can be placed on the stage.  Initially, a screen turtle (in the form of an arrow) is the default sprite that appears on the stage.

The Move Command

Drag the command Move 10 Steps from the command palette on the left into the script space. Each command in Snap! is enclosed in a block called a code block (because the block encloses the code). Click the code block that contains the command Move 10 Steps. The turtle should move 10 steps forward (in the direction that the turtle is pointed) when this code block is clicked.

Try other values such as 100 Steps.  In this case, only one turtle is on the screen. However, it is possible to create multiple turtles.  The term Sprite is also used as another name for a screen turtle.

Resetting the Turtle

If the turtle went off the screen in the last section, reset its position by clicking on the Go To X_Y_ code block.  You will use this frequently and may want to drag the command block into a corner of the command space for easy access.

In this example, the commands asks the turtle to go to a location with an X coordinate of 0 and a Y coordinate of 0 (i.e., the center of the screen). In the illustration below, the X and Y coordinates have been superimposed on the stage.

The Turn Command

Then try the Turn command. Drag the Turn Right 15 Degrees code block into the script space. Enter the setting of 90 degrees into the code block.

            Turn Right 90 Degrees

Click on the code block to execute the command. Watch the turtle rotate 90 degrees when the command is executed.

This example shows the Turn Right command. A Turn Left command is also available.

Pen Commands

The original floor turtle had a pen in its belly that could be raised and lowered. In a similar manner, Pen Up and Pen Down commands (found in the green Pen palette) enable the screen turtle to draw on the screen. Drag the Pen Down command into the script space.  Click the Pen Down code block, and then click the Move/Turnblock four times

If the pen is lowered, it stays in the down position until the Pen Up command is executed.

The Repeat Command

Use the Repeat code block to repeat commands.  The Repeat command is found in the Control palette (highlighted in yellow).   To use it, drag the command blocks you want to repeat into the empty space of the Repeat block and enter the number of times you want them to repeat.

The command Repeat 4 [Move 100 Turn 90] achieves the same result as duplicating the Move and Turn commands four times.

The Make a Block Option

In Snap!, the Make a Block option is used to “teach the Turtle a new word.” This option is found at the bottom of each palette of commands.

Click the Make a Block button to define a new command. Enter Square as the name of the new command. In most cases, the “for all sprites” option will be selected so that the new command will work with any sprite. Then click OK.

Defining a New Command – Square

Next drag the previously developed block of code,

            Repeat 4 [Move 100 Steps; Turn 90 Degrees]

into the Block Editor to define a new command named Square.

Click OK. A new command, Square, will appear at the bottom of the list of Motion blocks. It can now be used as though it were a built-in command.

Spinning the Square to Create a Pattern

Create a pattern similar to those designed by digital artists. Begin by drawing a series of squares, turning slightly (10 degrees) before drawing each square in the series.

            Repeat 36 [Square; Turn 10 Degrees]

Rotating the turtle as it draws a series of squares results in the following pattern.

Graphics drawn with the turtle can be exported as Scalable Vector Graphics (SVG) files for higher resolution output. To access the Scalable Vector Graphic feature, turn on the Log Pen Vectors option in Settings.

After a design has been drawn, place the mouse cursor on any part of the design and right-click to access the menu with the “SVG Export” option.

The SVG file can then be imported into other graphics programs such as Silhouette Studio.  (Silhouette Studio Business Edition includes an option to import SVG files.)

Foil Quill is a third party option available for the Silhouette die cutter that can be used to emboss foil patterns onto materials such as card stock.

The result is an embossed foil pattern obtained by using an SVG vector pattern generated by Snap!.