From DDL Wiki
Shape grammars are a production system created by taking a sample of the whole for which one is trying to write a language (Stiny 1980). From this sample a vocabulary of shapes can be written that represent all the basic forms of that sample. By defining the spatial relationships between those forms and how the forms are related to each other, shape rules can be written.
A shape rule consists of a left and right side. If the shape in the left side matches a shape in a drawing then the rule can be applied, and the matching shape changes to match the right side of the rule. The shape rules allow the addition and subtraction of shapes, which in the end are perceived as shape modifications.
These shape rules, combined with an initial shape, produce a shape grammar that represents the language of the design (Stiny 1980). Shapes themselves can exist as points, lines, planes, volumes, or any combination thereof (Stiny 1980). All shape generation must start with an initial shape: a point, a coordinate axis, etc. If the grammar is going to end, it must end with a terminal rule, which prevents any other rules from being applied after it. This forces there to be closure in the rule sequence.
There are multiple ways to drive a shape grammar. The simplest is to utilize labels and markers. Labels are typically alphanumeric characters attached to a shape. Markers are similar to labels, but are symbols attached to a shape. In both cases, they are used to limit which rules can and cannot be applied to the shape. If an appropriate marker or label exists, then a rule can be applied. The terminal rule typically removes all labels and markers. Another way to drive the grammar is through shape recognition. Shape recognition is able to drive the grammar in the same way that labels and markers do, but is broader in that it allows the rules to be applied to a parametric range of a shape. It allows any shape within predefined allowable limits to be recognized by the rule and thus allows the rule to be applied. If the shape in the left-hand side of the rule exists and is recognizable, then the rule can be applied. The difficulty is that the rule must recognize a parameterized shape, i.e. a similar shape regardless of scaling, rotation or other allowable modifications. A parametric shape grammar allows for the modification of similar shapes, and the removal and placement of parametric shapes.
The advantage of labels and markers is that the grammar can force certain rules to be applied and prevent non-applicable rules from being used. When developing a form that is generally the same, this enables all the aspects of the form to be created in a proper order with proper relationships. In the it was shown that all coffee makers fundamentally have the same components. By utilizing labels, it was ensured that each of these components would be created and be placed in a reasonable relationship with the other components. The coffee maker grammar utilized rules that applied to more than one view: top, side, and front. The labels enabled changes to be made in multiple views that were sensible, and then the final shapes could be abstracted to 3-D models. The labels drove the grammar and prevented the rules from creating forms that did not hold the necessary functionality. For example, labels enforced an important relationship among the three main components: the filter, the water storage unit, and the base unit. Labels prevented the base unit from being above the water storage unit, so that the final coffee maker design could be usable.
Some applications of shape grammars include:
-Architectural floor plans (Stiny and Mitchell, 1978)
-Chinese ice-ray lattice windows (Stiny 1977)
-Coffee makers (Agarwal and Cagan, 1998)
-Harley-Davidson branding (Pugliese and Cagan, 2001)
-Buick branding (!McCormack, Cagan, and Vogel, 2004)
-Automobile Classes (Orsborn, Cagan, Pawlicki and Smith, 2006)
The first shape grammars utilized only straight lines. The computations for these rules were defined to allow for the interaction and recognition of these lines (Krishnamurti, 1980). Since the world is not composed of only straight lines, the next obvious step was to recognize curves and curved shapes (!McCormack and Cagan, 2002). But, there was still the limitation in that up to this point all the shape grammars that have dealt with lines and curves were only in a single planar coordinate system. Some grammars have been created that use 3-D shapes, i.e. to build Wright style houses (Koning & Eizenberg, 1981).
Example: Stiny's ICE-RAY LATTICE
This parametric shape grammar is composed of a simple initial shape and five rules.
The initial shape is a quadrilateral with a marker (a dot).
The first rule takes a triangle and inserts a line to create a triangle and a quadrilateral. The coordinates indicate that a parametric application is allowed. This is implied for the rest of the rules. The marker must be observed in the left hand side of the rule for the rule to be applied, which is the case for this and all the other rules.
The second rule takes a quadrilateral and inserts a line to create two quadrilaterals.
The third rule takes a pentagon and inserts a line to create a quadrilateral and a pentagon.
The fourth rule takes a quadrilateral and inserts a line to create a triangle and a pentagon.
The fifth rule (the terminal rule) removes the marker. Once this rule has been applied, no other rule can be applied.
After the rules are applied through many iterations an attractive lattice can easily be created.
This shape grammar is simple and a fun one to try by yourself with pen and paper.
Agarwal, M. and Cagan, J. (1998). A blend of different tastes: the language of coffeemakers Environment and Planning B, 25(2), 205-226.
Koning, H. and Eizenberg, J. (1981). The language of the prairie: Frank Lloyd Wright’s prairie houses Environment and Planning B, 8(3), 295-323.
Knight, T (2003). Computing with emergence Environment and Planning B, 30(1), 125-155.
Krishnamurti, R. (1980). The arithmetic of shapes Environment and Planning B, 7(4), 463-484.
!McCormack, J. and Cagan, J. (2002). Supporting Designer’s Hierarchies Through Parametric Shape Recognition Environment and Planning B, 29(6), 913-931.
!McCormack, J., Cagan, J. and Vogel, C. (2004). Speaking the Buick Language: Capturing, Understanding, and Exploring Brand Identity with Shape Grammars Design Studies, 25(1), 1-29.
Orsborn, S., Cagan, J., Pawlicki, R. and Smith, R., 2006 “Creating Cross-over Vehicles: Defining and Combining Vehicle Classes Using Shape Grammars,” Artificial Intelligence for Engineering Design, Analysis and Manufacturing, 20(3), pp. 217-246.
Pugliese, M. and Cagan, J. (2001). Capturing a Rebel: Modeling the Harley-Davidson Brand through a Motorcycle Shape Grammar Research in Engineering Design, 13(3), 139-156.
Stiny, G. (1977). Ice-ray: a note on the generation of Chinese lattice designs Environment and Planning B, 4(1), 89-98.
Stiny, G. (1980). Introduction to shape and shape grammars Environment and Planning B, 7(3), 343-351.
Stiny, G. and Mitchell, W. J. (1978). The Palladian grammar Environment and Planning B, 5(1), 5-18.