![](bg2.png)
rules.
One of the most developed area of shape grammar
application is urban design. Jos Nuno Beiro (Beirao,
2012) defined all the aspects of using shape gram-
mars in this field and successfully applied his theses
in practice. Although he mentioned that rules had be
hidden from the designer, he gave the designer some
freedom by using discernible names for the moves
and their parameters.
Analysis of the mentioned examples leads us to
the conclusion that Shape Grammars can be success-
fully applied in many fields. However, the graph
structures, which formally represent problems, are
based on small graphs or have limited numbers of
rules.
During our work on the project inspired by Anto-
nio Gaudi’s designs we have noticed a serious prob-
lem with graph processing efficiency. We work on
different types of structures, which are described by
large numbers of nodes. The project requires rep-
resentation of thousands or even millions of edges,
nodes and shapes which are not represented by lines.
Even the most advanced among the exiting meth-
ods are incapable to process such vast collections
data. Real-life application of shape grammars de-
mands their efficient implementation for shapes con-
sisting of thousands of elements.
Translation of shapes into graph grammars re-
quires many problems to be solved, including:
• Complexity reduction of designation of the left-
hand side of transformation rules: In a general
case, it is an NP-complete problem, just like sub-
graph isomorphism. But with some restrictions on
the application rule form and the generated graph
structure, it can be solved in a polynomial time
(cf. (Flasinski, 1990)).
• Introduction of a mechanism of parallel applica-
tion of the transformation rules with implicit syn-
chronization; cf. (Kotulski and Sedziwy, 2010).
However, the most basic and yet still open prob-
lem is proper representation of the shape elements.
The shape graph presented in Figure 1 consists of
two overlapping squares (basic elements). In this ex-
ample, the line segment (a, b) has been split into three
collinear segments (the other line segments also have
been split). The representation of relations among
them and segment (a,b) has a strong influence on the
implementation of the shape grammar.
This problem has been outlined by Grasl and
Economou (Grasl and Economou, 2011), the authors
of one of the best shape graph interpreters called
GRAPE. The efficiency of the line segment represen-
tation, with each line consisting of several segments,
will be considered here. The representation proposed
b
a
Figure 1: Collinearity problem in Shape Grammars.
in the following part of the paper has been compared
with two others – Grasl (Grasl and Economou, 2011)
and Kelles et al. (Keles et al., 2010) – based on the
classical Stiny shape grammar application for Chi-
nese ice-ray lattice design (Stiny, 1977).
2 COLLINEAR SEGMENTS
IMPLEMENTATION
One of the most important problems associated with
graph representation of shapes is the representation
of collinear shapes in a way that allows their use it
for the analogical relations for Bezir curve elements.
The maximum line segments are a set of lines created
by combining all collinear line segments that touch
or overlap. The most straightforward approach is to
map points to the nodes and segments to the edges. In
such a representation, if a line is divided into several
segments by a crossing line, it is difficult to designate
the other collinear segments. Note that two or more
connected collinear segments can appear in the trans-
formation rule as one segment.
To overcome this problem, Keles et al. (Keles
et al., 2010) join all node pairs in such lines. Unfor-
tunately, this approach results in creation of too many
edges. For n points along the line, n ·(n − 1)/2 edges
have to be created. Thus, even for a small grid of
lines (over a dozen intersecting lines), like the one
in Stiny’s ice-ray (Stiny, 1977), a large number of
edges is generated: 1653 edges for Chengtu Szee-
hwan, 1825 AD and 1392 edges for Hanchow, Szech-
wan 1875 AD. The mentioned examples of Chinese
lattice design creates a good background for evalua-
tion of the efficiency of the considered methods.
Grasl and Economou analyse 7 other representa-