ArticleslgStudy

science

Shape grammar

Shape grammar is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Shape grammar rather than just read about it. In short: Shape grammars in computation are a specific class of production systems that generate geometric shapes. Typically, shapes are 2- or 3-dimensional, thus shape grammars are a way to study 2- and 3-dimensional languages.

Key takeaways

  • Shape grammar belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Shape grammar to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Shape grammar from memory before moving on to harder problems.

Reference excerpt

Shape grammars in computation are a specific class of production systems that generate geometric shapes. Typically, shapes are 2- or 3-dimensional, thus shape grammars are a way to study 2- and 3-dimensional languages. Shape grammars were first introduced in a seminal article by George Stiny and James Gips in 1971. The mathematical and algorithmic foundations of shape grammars (in particular, for linear elements in two-dimensions) were developed in "Pictorial and Formal Aspects of Shapes and Shape Grammars" (Birkhäuser Basel, 1975) by George Stiny. Applications of shape grammars were first considered in "Shape Grammars and their Uses" (Birkhäuser Basel, 1975) by James Gips. These publications also contain two independent, though equivalent, constructions showing that shape grammars can simulate Turing machines.

Definition A shape grammar consists of shape rules and a generation engine that selects and processes rules. A shape rule defines how an existing (part of a) shape can be transformed. A shape rule consists of two parts separated by an arrow pointing from left to right. The part left of the arrow is termed the Left-Hand Side (LHS). It depicts a condition in terms of a shape and a marker. The part right of the arrow is termed the Right-Hand Side (RHS). It depicts how the LHS shape should be transformed and where the marker is positioned. The marker helps to locate and orient the new shape. A shape grammar minimally consists of three shape rules: a start rule, at least one transformation rule, and a termination rule. The start rule is necessary to start the shape generation process. The termination rule is necessary to make the shape generation process stop. The simplest way to stop the process is by a shape rule that removes the marker. Shape grammars differ from Chomsky grammars in a major respect: the production rules may be applied serially (as with Chomsky grammars) or in parallel (not allowed in Chomsky grammars), similar to the way "productions" are done in L-Systems. A shape grammar system additionally has a working area where the created geometry is displayed. The generation engine checks the existing geometry, often referred to as Current Working Shape (CWS), for conditions that match the LHS of the shape rules. Shape rules with matching LHS are eligible for use. If more than one rule applies, the generation engine has to choose which rule to apply. In the alternative scenario, the engine first chooses one of the grammar rules and then tries to find all matches of the LHS of this rule in the CWS. If there are several matches, the engine can (depending on its configuration/implementation)

apply the rule to all matches in parallel, apply the rule to all matches serially (which might lead to inconsistencies) or choose one of the detected matches and apply the rule to only this match. Shape grammars are most useful when confined to a small, well-defined generation problem such as housing layouts and structure refinement. Because shape rules typically are defined on small shapes, a shape grammar can quickly contain a lot of rules. The palladian villas shape grammar presented by William Mitchell for example contains 69 rules, that are applied throughout eight stages. Parametric shape grammars are an extension of shape grammars. The new shape in the RHS of the shape rule is defined by parameters so that it can take into account more of the context of the already existing shapes. This typically affects internal proportions of the new shape so that a greater variety of forms can be created. In this way, attempts are made to make shape grammars respond to structural conditions, for example the width of beams in roof structures which depends on span. Despite their popularity and applicability in academic circles, shape grammars have not found widespread use in generic Computer Aided Design applications.

Applications Shape grammars were originally presented for painting and sculpture but have been studied in particular in architecture (computer-aided architectural design), as they provide a formalism to create new designs. Other important domains shape grammars have been applied in are decorative arts, industrial design and engineering.

Software Prototypes This is a list of software prototypes that are available on the web (several of them are strictly speaking rather set grammar systems):

Grammar Environment GRAPE SD2 Shape Grammar Interpreter Shaper2D spapper SubShapeDetector Yingzao fashi building generator SortalGI

Literature Stiny, G. & Gips, J. (1972). Shape grammars and the generative specification of painting and sculpture. In Information Processing 71, 1460–1465. North-Holland Publishing Company. link to article Stiny, G. (1975). Pictorial and Formal Aspects of Shape and Shape Grammars. Birkhäuser Basel. link to the book Stiny, G. (1980). Introduction to shape and shape grammars. Environment and Planning B: Planning and Design 7(3), 343-351. Knight, T.W. (1994). Transformations in Design: A Formal Approach to Stylistic Change and Innovation in the Visual Arts. Cambridge University Press. Stiny, G. (2006). Shape: Talking about Seeing and Doing. MIT Press, Cambridge, MA. link to book Archived 2014-01-05 at the Wayback Machine

See also Formal grammar Graph rewriting L-system Production system Procedural Modeling

References

External links www.shapegrammar.org (last capture on the Internet Archive (2019)) Shape Grammar and Style Simulation (list of references) Shape grammar implementation: from theory to useable software (overview of computational implementation approaches as of 2010) Workshop on Advances in Shape Grammars as of 2016

Worked examples

Example 1 — a first encounter with Shape grammar

Start with the simplest possible case. Write down what Shape grammar claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Shape grammar before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Shape grammar ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Shape grammar

In research
Shape grammar appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Shape grammar in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Shape grammar is common in secondary-school and first-year university syllabi. It links to neighbouring topics Architectural theory, so understanding it makes those chapters shorter.
In everyday life
Look for Shape grammar outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Shape grammar” →

How to study Shape grammar in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Shape grammar means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Shape grammar out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Shape grammar in simple terms?

Shape grammars in computation are a specific class of production systems that generate geometric shapes. Typically, shapes are 2- or 3-dimensional, thus shape grammars are a way to study 2- and 3-dimensional languages.

Why does Shape grammar matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Shape grammar?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Shape grammar.

Tags

  • Architectural theory

Keep exploring