Inca Reconstruction Using Shape Grammar
Course Project for CS888 - Computer Graphics for Architecture
Project Objective
Incan buildings have relatively simple and regular structures. It is
possible to describe such buildings using several shape grammar rules. The
purpose of this project is to demonstrate the feasibility of using shape
grammar as a tool to recreate simple Inca sites.
Implementation Details
- The program is written using PyOpenGL and PyQt4. It is only tested
on Ubuntu Hardy. The source code can be found here. To run the program, extract the files
from the archive and run ./inca.py. You must have PyOpenGL and PyQt4
installed to run the program.
- The following shape grammar rules are used to generate an Incan
house. The elements with all lowercase letters are terminals. The ones
with all uppercase letters indicate different types. The rest are
non-terminals.
House -> Facades Roof
Facades -> Facade{FRONT, BACK, SIDE}
Facade[FRONT] -> pillar (30% probability)
Facade[FRONT] -> RegularFacade (70% probability)
Facade[BACK] -> RegularFacade
Facade[SIDE] -> RegularFacade (35% probability)
Facade[SIDE] -> side_wall (65% probability)
Roof[Side facade is regular] -> rectangular_roof
Roof[Side facade is triangular] -> sharp_roof
RegularFacade -> wall+
RegularFacade -> wall (window | door)* wall
RegularFacade -> wall window* door window* wall
RegularFacade -> wall (window door)+ window wall
A set of parameters is associated with the house to determine its
appearance. The parameters can be individually modified from GUI
for each house. When the parameters specified by the user exceed the
size of the house, the sizes of windows and doors are adjusted in order
to maintain the desired number of windows and doors.
- Only simple Incan walls are supported by the system. Incan walls
with niches are not included. There is no shape grammar rule for the
Incan walls, since their locations are quite ad hoc. Users must specify
where to create those walls and they are not included in random generation.
- When a site plan is provided, there is no rule for generating stairs and
terraces. When a site is generated randomly, there are a couple of
rules that govern the generation.
Plan -> LeftTerraces stairs RightTerraces (stairs | e)
LeftTerraces -> terrace terrace+
RightTerraces -> TerraceWithHouse TerraceWithHouse TerraceWithHouse+
TerraceWithHouse -> terrace House House
TerraceWithHouse -> terrace House House House
TerraceWithHouse -> terrace House House House House
The choices of rules depend on probability. The location and the
orientation of the stairs, the partitions of the terraces, the
number of houses, and the orientation of the houses all depend on
probability as well (within a certain range, of course). Those
rules are definitely not enough if we want to generate a realistic
Inca site randomly, but they suffice as a rough demonstration of
the idea.
- The rules above are all hard-coded, which imposes a limitation on
the possible tasks that the system can handle.
- Users can load plan images in the program to create houses, walls,
and terraces. All the plan images are from [1], the book I used
when I went to Machu Picchu for the first time.
Results
A Randomly Generated Site
Another Randomly Generated Site
User Generated Site Based on a Plan
Another User Generated Site
One More User Generated Site
Discussions
Shape grammars in computation are a specific class of production systems
that generate geometric shapes [2]. It is able to create new design based
on the architectural rules summarized by designers and architects. In
Xkipche's case [3], the rules were summarized by archaeologists. Like the
Puuc buildings in Xkipche, Incan buildings have consistent designs that make
them suitable for shape grammar modeling.
Compared to Puuc buildings, Incan houses have less decorations and less
components in the facades. The variation in the rules mainly comes from the
different number of doors and windows. It is also possible to have
different types of front and side facade and the roof form can change as
well, which slightly increases the complexity of the rules. Inca
architecture has two other main elements besides its houses: Incan walls and
terraces. They play a very important role in city construction therefore it
is necessary to include them in the shape grammar rule base. However, since
I don't have enough information on how the Incas placed the wall inside their
villages or cities, I choose to let the user model the walls manually instead of
devising a formal representation of the wall placement.
I believe that modeling using shape grammar is probably more time consuming
compared to traditional modeling methods such as CAD. It is difficult to
design rules for complicated shapes, and the results may or may not be
satisfactory. For example, in the Xkipche paper, a large amount of
additional rules were created for the decorations with repetitive patterns.
When the pattern is less repetitive, shape grammar is not quite capable of
modeling those decorations. The Incan buildings in this project have simple
shapes, and it is easy to extract shape grammar rules. However, if we
consider the time spent on building the system to interpret the rules,
manual modeling can still outperform shape grammar.
One big advantage of shape grammar is the possibility of generating new
designs. The random generation mode in the project tries to demonstrate
this idea. If we encode our knowledge of city planning into shape grammar
rules, then it is easy for a person without that domain knowledge to
generate a sensible design using the system. This may not have any
practical use in archaeology, but can be useful in modern urban planning.
Reference
[1] Ruth M. Wright, The Machu Picchu Guidebook: A Self-Guided Tour
[2] Shape Grammar, Wikipedia,
http://en.wikipedia.org/wiki/Shape_grammar
[3] P. Müller et al., "Procedural 3D Reconstruction of Puuc Buildings in Xkipche,"
Proc. Eurographics Symp. Virtual Reality, Archaeology and Cultural Heritage (VAST 06), Eurographics, 2006, pp. 139–146.