Shapes Editor Guide

NetLogo User Manual   

The Shapes Editor allows you to create and save turtle designs. NetLogo uses fully scalable and rotatable vector graphics, which means it lets you create designs by combining basic geometric elements, which can appear on-screen in any size or orientation.

Getting Started

To begin making shapes, choose Shapes Editor in the Tools menu. A new window will open listing all the shapes currently in the model, beginning with default, the default shape. The Shapes Editor allows you to create a new shape, edit, copy, or delete an existing shape, or import shapes from other models.

Creating and Editing Shapes

Pressing the New button will make a new shape. Or, you may select an existing shape and press Edit.

Tools

In the upper left corner of the editing window is a group of drawing tools. The arrow is the selection tool, which selects an already drawn element.

To draw a new element, use one of the other seven tools:

When using the polygon tool, click the mouse to add a new segment to the polygon. When you're done adding segments, double click.

After you draw a new element, it is selected, so you can move, delete, or reshape it if you want:

Previews

As you draw your shape, you will also see it in three smaller sizes in the three preview areas found near the bottom of the editing window. The previews show your shape as it might appear in your model, including how it looks as it rotates. The rotatable feature can be turned off if you want a shape that always faces the same way, regardless of the turtle's heading.

Overlapping Shapes

New elements go on top of previous elements. You can change the layering order by selecting an element and then using the Bring to front and Send to back buttons.

Undo

At any point you can use the Undo button to undo the edit you just performed.

Colors

Elements whose color matches the Color that changes (selected from a drop-down menu -- the default is gray) will change color according to the value of each turtle's color variable in your model. Elements of other colors don't change. For example, you could create cars that always have yellow headlights and black wheels, but different body colors.

Shape Design

It's tempting to draw complicated, interesting shapes, but remember that in most models, the patch size is so small that you won't be able to see all the detail. Simple, bold shapes are best.

Saving Shapes

When the shape is done, give it a name and press the Done button at the bottom of the editing window. The shape and its name will now be included in the list of shapes along with the "default" shape.

Importing Shapes

If you want to use a shape from another model in this model, you must first import the shape into this model. Press the Import button to select a NetLogo model from which to import one or more shapes. Once you have chosen a model, a list of that model's shapes will appear. Choose as many of these shapes as you like to import into the original model and press the Import button to import the shapes.

Using Shapes in a Model

In the model's code or in the command center, you can use any of the shapes that are in the model. For example, suppose you want to create 50 turtles with the shape "rabbit". Provided there is some shape called rabbit in this model, give this command to the observer in the command center:

O> crt 50

And then give these commands to the turtles to spread them out, then change their shape:

T> fd random 15
T> set shape "rabbit"

Voila! Rabbits! Note the use of double quotes around the shape name. Shape names are strings.

The set-default-shape command is also useful for assigning shapes to turtles.