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 figures, 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 cause a new shape to be created and the editing window will appear, allowing you to name and make the shape. The shape you make will appear in the main drawing area and in the three smaller preview areas found on the left side of the editing window.

The preview areas show your shape at different sizes as it might appear within your model, as well as how it looks while rotating. The rotatable feature can be turned off if you want a shape that does not rotate as the turtle's heading changes.

There are four drawing tools (select from four button icons), each of which can be filled with color or not, and a background grid to guide you. You can move and size these basic shapes with the mouse pointer as a drawing tool.

The basic geometric figure created last will fall on top. Geometric figures can be removed one at a time with the Remove Last button. The Remove Last and Remove All buttons are the only way of correcting mistakes -- you can't go back to move or alter a geometric figure after it's been drawn. If you make a mistake drawing a geometric figure, to fix it, remove it and then redraw it.

Geometric figures that use the key color (selected from a drop-down menu -- the default is gray) will change according to the value of each turtle's color variable in your model. Figures filled with any other color (selected from the palette at the top) will stay that color regardless of each turtle's color. For example, you could create cars that always have yellow headlights and black wheels but have bodies of different colors by drawing the bodies in the key color.

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.

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 Shapes Editor's list along with the "default" shape.

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:

crt 50

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

fd random 15
set shape "rabbit"

Voila! Rabbits! Note the use of double quotes around the shape name.

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