The recipe is as follows:

- Pick random points on a 2D grid
- Find the 'convex hull' of the points.
- Pick an interior point, and connect it to a random edge, as long as it does not intersect another edge
- Repeat #3 until all points are assigned.

There are a number of criteria described implicitly or explicitly by A&A about whether a shape should be legitimate. Things like 'do lines cross' is trivial for a research assistant to identify when doing this by hand on graph paper, but not exactly trivial when doing this algorithmically. A MATLAB routine for constructing these shapes was published more recently by Collin & McCullen (2002), and they worked through many of these issues. I have borrowed heavily from their examples, and come up with a MakeAttneave() function that creates points for an Attneave shape that satisfies a number of criteria.

MakeAttneave is called with the following arguments:

MakeAttneave(size,numpoints,minangle, maxangle)

MakeAttneave works by first finding the convex hull, just like the recipe above. As a side effect, we now have a ConvexHull function available in PEBL, which can be useful for other purposes. After the convex hull is found, we just take the remaining shapes, and try to add them in random positions in the current shape, one at a time. At each point, we pick a random edge, and then create candidate edges between the two endpoint of that edge and the new point. Then, check to see if the new edges cross any other edges, and whether the angles are valid. It should always be possible to find a pair of points between which you can fit any interior point, but sometimes it won't be possible to find one that doesn't violate the edge constraints. When this happens, I have an 'emergency out: I simply call the MakeAttneave function recursively. In its current form, I don't do any checks, so it is possible to create constraints that make it impossible to find a legal figure, and the function will recurse until its stack depth or the machine memory runs out, and the system crashes. So take care when you use it.

What does the output look like? First, let me try two sets with fairly high minimum angles (20 degrees):

10 points, angles 20-175 degrees | 20 points, angles 20-175 degrees |

Lets decrease the minimum angle from 20 degrees to 5, for each number of points:

10 points, 5-175 degrees | 20 points, 5-175 degrees |

These didn't take as long to make, which is nice, but you get those spikes, which may not be ideal.

Trying to push the parameters further leads to some problems. With 10 points, you can set the minimum angle as high as 50 degrees, without the search taking too extremely long. And it creates nice full polygons.

10 points, 50-175 degrees

25 points, .1-179 degrees

30 points, .1-179 degrees

These get quit complex, and start filling in more of the circle-mashing together to fit enough vertices in the constrained shape. They share a resemblance even if they aren't similar in shape. In the future, when I blog about the object judgment task, I'll describe how to create (and validate) shape families--shapes that have a family resemblance, yet are still valid according to the testing criteria.

References:

Attneave, F., & Arnoult, M. D. (1956). The quantitative study of shape and pattern perception. Psychological Bulletin, 53(6), 452-471.

Collin, C. A., & Mcmullen, P. A. (2002). Using Matlab to generate families of similar Attneave shapes. Behavior Research Methods Instruments and Computers, 34(1), 55-68.