Computational Generation of Hutong Neighbourhood Maps A shape grammar for procedural modelling to represent the historical urban structure

Yuyang Wang1, Asterios Agkathidis2, Andrew Crompton3 1,2,3University of Liverpool 1,2,3{Y.Wang179|a3lab|Andrew.Crompton}@liv.ac.uk

The Hutong neighbourhoods, composed of Chinese courtyard dwellings (), are historically and socially significant urban spaces that embody traditional Chinese philosophy. There is a global interest in these spaces many of which face oblivion, this study presents a formal grammar for parametrically generating Hutong neighbourhoods, which replicates the morphological characteristics of historic cases. This research investigates traditional principles of urban planning of ancient Beijing, based on examples on the historical map Qianlong Jingcheng Quantu, to derive the lost design rules. These rules are then used to build up a procedural modelling process, which reveals the development of Beijing urban structure from Yuan (1271-1368) to Qing (1368-1911) dynasty. The grammar presented in the procedural modelling process contributes to the understanding of the generation of Hutong neighbourhoods. In support of traditional Chinese urban design, the grammar will be translated into an algorithm to be implemented in a computational environment by visual scripting that will generate new instances of Hutong neighbourhoods.

Keywords: urban morphology, Siheyuan neighbourhood, procedural modelling, shape grammar

BACKGROUND formed due to population increase, after which they Hutong neighbourhoods are historically and socially were composed of variants of a vernacular dwelling significant part of Chinese urban heritage that em- type- Chinese courtyard housing (Siheyuan). Since bodying traditional Chinese philosophy. The ur- these neighbourhoods usually existed between two ban area of ancient Beijing was divided into four- Hutong (), they were called Hutong neighbour- sided sectors as residential neighbourhoods under hoods, whose basic units are Siheyuan. A typical Si- the constraint of an orthogonal grid system. Dur- heyuan consists of axially aligned courtyards sym- ing the , these neighbourhoods were re- metrically surrounded by individual buildings, con-

Rule based systems and shape grammar - Volume 2 - eCAADe 39 | 303 nected by orthogonally located corridors, walls, and yards of Siheyuan into five categories to understand gates, as illustrated in Figure 1. how the different Siheyuan layouts were deformed to adapt themselves in the various site contexts within the Hutong neighbourhoods (Figure 2). Figure 1 One common conclusion of these studies is that Beijing Siheyuan, the rules underlying the evolution of Hutong neigh- Ma, 1999. bourhoods are complex. However, computational approaches are powerful to make generative rules explicit and to develop the design iterations. The Shape Grammar, invented by George Stiny (1980) to interpret the generative rules of objects graph- ically, was implemented by Rudi Stouffs (2018) us- ing algorithms developed in Rhino/Grasshopper en- vironment. An analytical shape grammar has its ad- vantage in straightforwardly demonstrating the mor- phological iteration of shapes, which was employed It is noted that current architects lack physical ex- to explain historical styles or languages of designs in amples to study their design knowledge. Duan’s procedural modelling approaches, such as ‘Rome Re- (2007, 2016) measuring surveys indicate most his- born 2.0’ project (Dylla et al., 2008) and urban blocks torical Siheyuan and Hutong neighbourhoods have of nineteenth-century Camden London Flora et al. been damaged and even destroyed. Meanwhile, it is (2018). noted there is an increasing interest in Hutong neigh- Figure 2 bourhood and Siheyuan, but, due to the linguistic A section of difficulties in understanding historical literature, it is Qianlong hard for architects and urban designers to learn the Jingcheng Quantu original design knowledge of traditional Chinese ar- (Qianlong Capital chitecture (Di, 2016). To explicate the lost historical Map, 1750) design principles for contemporary architects and ur- indicating the ban designers and provide a tool for rapidly gener- urban planning of ating Hutong neighbourhoods replicating the tradi- historical Beijing is tional morphological characteristics may help them based on a grid in their design work. system. Since the Hutong neighbourhoods were com- posed of Siheyuan dwellings containing a large num- ber of variants, morphological studies of the neigh- bourhoods were linked to the typological analysis of Siheyuan. Li (2009) revealed the principles explain- ing how the archetype of Siheyuan evolved variants that compose Hutong neighbourhoods on Beijing’s AIMS, METHODS, AND MATERIALS orthogonal grid. Similarly, Liu (2019) investigated Our overall aim is to investigate the design rules many Siheyuan precedents within five Hutong neigh- underlying historical Hutong neighbourhood design bourhoods drawn on Qianlong Jingcheng Quantu in order to translate them into an algorithmic tool (Qianlong Capital Map, 1750) by classifying the court- to generate variations of traditional Beijing Hutong neighbourhoods. To achieve this aim, the following

304 | eCAADe 39 - Rule based systems and shape grammar - Volume 2 questions are addressed: entation, as demonstrated in Rule 2a in Figure 3. We defined these neighbourhoods as ‘Type A Neigh- • How could the historical rules of Hutong neigh- bourhood’ (TAN). It is noted that the form of some bourhood generation and development be neighbourhoods was re-planned in the Qing dy- translated into a shape grammar to simulate nasty. In the south-north orientation, two neigh- its procedural modelling? bourhoods were combined as a whole and were di- • How could such a shape grammar be imple- vided into three new neighbourhoods, with an al- mented as an interactive algorithmic tool in ley width of 10.01 metres between each of the two a computational environment to generate Hu- adjacent new neighbourhoods as shown in Rule 1 tong neighbourhood variants replicating their in Figure 3. We defined these new neighbourhoods original morphological characteristics? as ‘Type B Neighbourhoods’ (TBN). The neighbour- The current paper is focusing on the first question. hoods planned in the (TAN) were di- The derivation of rules come from historical litera- vided into 67.67x67.67m Siheyuan plots. Although ture (E, 1739, and Song, 1369) and secondary sources the development of neighbourhoods in the Qing dy- from other studies, such as the morphological studies nasty changed the depth of both Siheyuan plots and on Hutong neighbourhoods by Li (2009), Li and Wang neighbourhoods, the width remained. Rule 2b repre- (2006), Liu (2019), and Ni (2009). The Qianlong Cap- sents the division of a TBN into Siheyuan plots. ital Map recorded the urban plan of Beijing around 1750 at a scale of 1: 650, including all the Hutong Defining Siheyuan plots neighbourhoods and they contained. This Division of plots into sub-plots. A Siheyuan plot in map is also used for rules derivation. the Yuan dynasty could be divided into two to four sub-plots in the east-west orientation. Each sub-plot THE HUTONG NEIGHBOURHOOD GRAM- could include several courtyards aligned in south- north orientation (Type A sub-plot, TASP) or an empty MAR space (Type B sub-plot, TBSP). Based on this finding, By observing the Qianlong Capital Map, it is noted Li and Wang’s (2006) investigation of examples on that there were a large number of Hutong neigh- the Qianlong Capital Map concluded on several types bourhood variants, which resulted in the diverse ur- of sub-plots. As shown in Rules 3 in Figure 4, there ban structure of ancient Beijing within its orthog- are six dividing patterns, in which the plot is consti- onal grid system. We chose the most representa- tuted of one or two sub-plot types. We found that tive the east-west oriented Hutong neighbourhoods, the width of most TBSP is within the range or much from the Yuan dynasty to be our case study. smaller than TASP. Therefore, we define the width of TASP ranges from 12 to 35 metres and TBSP from 5 to Generation of Hutong neighbourhoods 12 metres. The six division patterns of the plots are plan and Siheyuan plots defined as Rules 3a to 3f respectively. In the Yuan dynasty, each neighbourhood’s depth (length in south-north orientation) was planned to Sub-plot combination. Some TASPs and TBSPs were be 67.76 metres and its width (length in east-west combined to regenerate new sub-plots. According orientation) was 677.6 metres. The Hutong alley be- to Liu’s investigation (2019) of selected Siheyuan ex- tween two adjacent neighbourhoods was 9.24 me- amples shown on the map, we inferred the principles tres wide. These key urban elements and dimen- that one TASP could be combined with one adjacent sions are determining the initial shapes of the Hu- TBSP to become a combined sub-plot, called Type AB tong grammar. Each neighbourhood was averagely sub-plot (TABSP). Then the TABSP could be used to divided into ten plots aligned in an east-west ori- construct a Siheyuan. This combination is defined as

Rule based systems and shape grammar - Volume 2 - eCAADe 39 | 305 Figure 3 Rule 1 trasnforms TAN into TBN and Rule 2 divides TAN/TBN into plots.

Rule 4a and Rule 4b, shown in Figure 4. Since the TAB- south orientation, constrained by the depth of the SPS are wider than other types, it enables a Siheyuan neighbourhood, is 3 or 4 in most cases. For simpli- to be built on it and contains two courtyards in the fication, we assume it is 4 in TAN and 3 in TBN. The east-west orientation. Normally, on a TABSP, a set of number in the east-west orientation, constrained by courtyards are aligned in a south-north orientation, the width of the sub-plot, is 2 or 3 mostly. We define it with a side courtyard next to these courtyards in par- as 3 if the width is bigger than 20 metres, otherwise allel and connecting the south and north boundaries. 2. Rule 5 is defined as the disaggregation of TABSP Sub-plot disaggregation and recombination. The or TASP. Considering the neighbourhood depth and Siheyuan with a side courtyard usually belonged type of sub-plot, the rule includes variants such as to rural upper-class owners. In many cases, the Rule 5a, Rule 5b, Rule 5c, and Rule 5d. The recombi- TABSP disaggregated into many smaller sub-plots, nation of two TABdSPs is defined as Rule 6a and two called a Type ABd sub-plot (TABdSP), on which a TAdSPs is defined as Rule 6b. Except for the above one-courtyard Siheyuan is constructed. The disag- disaggregation, there was another mode that a TASP gregation may also happen to some TASPs, whose separates into two Siheyuans by dividing the bound- disaggregated sub-plot is called a Type Ad sub-plot ary of the second and the third courtyard, in which (TAdSP). Two Type Ad sub-plots or two Type Abd the original type of each courtyard remains. This is sub-plots adjacent in north-south orientation may defined as Rule 7. We call the separated sub-plot on be recombined to become a new sub-plot, called the south side as Type ASS sub-plot (TASSSP) and the Type Ad2 sub-plot (TAd2SP) and Type ABd2 sub-plot one on the north as Type ASN sub-plot (TASNSP). The (TABd2SP) respectively. In the disaggregation, the rules are shown in Figure 4. number of generated TAdSPs or TABdSPs in a north- These Siheyuans built on disaggregated sub- plots are clustered, in which many Siheyuans are not

306 | eCAADe 39 - Rule based systems and shape grammar - Volume 2 Figure 4 Rule 3 divides a plot into sub-plots; Rule 4 and Rule 6 re-combine sub-plots; Rule 5 and Rule 7 disaggregate sub-plots; and Rule 8 shrink sub-plot edges to generate an alley.

Rule based systems and shape grammar - Volume 2 - eCAADe 39 | 307 adjacent to the urban fabric. To create access to these on a TAdSP or TABdSP usually contains one courtyard Siheyuans, the west and east edges of disaggregated (defined as Rule 11a), on which no shape iteration sub-plots shrink to give space to generate a small happens on the plan view, while on a TAd2SP or a south-north oriented alley. The alley may cross the TABd2SP two non-standard courtyards connected in neighbourhood to connect the alleys on the south a north-south orientation, is defined as Rule 11b. Si- and north side of the neighbourhood or not cross. To heyuan built on a TASSSP always divides the site into simplify, we assume that an alley crosses the neigh- two courtyards: a standard one on the north and a bourhood in all cases. In the shrink, as defined in Rule non-standard one on the south. This iteration is de- 8, the movement distance of each edge is different, fined as Rule 12a. On the contrary, on a TASNSP the which makes the alley geometrically irregular. division may allocate a non-standard courtyard on the north and a standard one on the south, which is Courtyard division and type definition defined as Rule 12b. The type of sub-plot determines After the sub-plot type is defined, it is divided into the courtyard division by defining courtyard types courtyards depending on the Siheyuan to be built on and numbers, which, consequently, determines the the sub-plot. When describing the word ‘courtyard’ type of the Siheyuan. in the Siheyuan context, it usually means the space enclosed by walls, which includes both the open Moving the edges of the courtyard courtyard space and all the buildings surrounding In the initial neighbourhood planned in the Yuan dy- that space. In many cases, some parts of the ‘court- nasty, the south and north edges of each Siheyuan yard’ are not completely enclosed by walls. Instead, plot were ideally divided into segments from the cor- the rear boundary of a building is extended in east- responding edges of the neighbourhood, which are west orientation to define the boundary of a court- straight lines, enabling the elevations of Siheyuans yard. Borrowing the idea of categorizing courtyard arrayed smoothly. After the reconstruction in the into types based on the courtyard location, the room Qing dynasty, the edges of many Siheyuans have type that a courtyard contains (Wang et al., 2019), been moved to a south-north orientation, which we classify courtyard types as northern boundary caused the courtyards adjacent to the urban fab- courtyard (NBC), southern boundary courtyard (SBC), ric in south-north orientation to extend or shrink. east side courtyard (ESIC), west side courtyard (WSIC), The shrinking and extension are defined as Rule standard courtyard (SC), and non-standard courtyard 13 and Rule 14 respectively. The movement of (NSC). A TASP is used to build a Siheyuan with 3 or edges also took place to the east and west edges of 4 courtyards aligned in a north-south orientation, non-standard courtyards and boundary courtyards. in which the southernmost and northernmost ones These edges could move in east or west directions to are non-standard courtyards while the middle one or extend or shrink the courtyard area. Since Siheyuans two are standard courtyards. The only difference be- were adjacently aligned in the east-west, this move- tween as TASP a TABSP is that a side courtyard is ad- ment consequently influences adjacent Siheyuans. ditionally aligned to the east or west. Generation of In this movement, the east edge of the courtyard a three-courtyards Siheyuan on a TASP is defined as moves to the east or the west edge moves to the west Rule 9a and a four-courtyards one as Rule 9b. Three to extend the courtyard area, and the correspond- courtyards with an east side courtyard on a TABSP is ing adjacent Siheyuan’s edge moves accordingly to defined as Rule 10a, three courtyards with a west side shrink its area. This took place in courtyards adjacent courtyard as Rule 10b, four courtyards with an east alleys. The movement is defined as Rule 15, as shown side courtyard as Rule 10c, and four courtyards with in Figure 6. a west side courtyard as Rule 10d. A Siheyuan built

308 | eCAADe 39 - Rule based systems and shape grammar - Volume 2 Figure 5 Rule 9-12 divide a sub-plot into courtyards.

Figure 6 Rule 13-14 defines shrink or extension of a boundary courtyard in north or south and Rule 15 defines the shared edge movement of two adjacent courtyards in east-west.

Rule based systems and shape grammar - Volume 2 - eCAADe 39 | 309 Figure 7 Rule 16-20 defines room layout patterns.

Figure 8 Rule 21 defines room movement; Rule 22 defines room rotation; and Rule 23 defines entry gate location patterns.

Room layout pattern west boundary. A standard courtyard normally con- Borrowing the approach of Wang et al. (2020) to cat- tains a primary room on the north and two secondary egorize courtyard type, the room layout patterns on rooms pairwise axisymmetric about the courtyard’s the courtyard are identified based on two criteria: central axis. This layout contains more variants re- courtyard location (on the southernmost, on the mid- garding the criteria of the existence of wing rooms dle, and on the northernmost) and the room type(s) and secondary wing rooms. Secondary room com- the courtyard contains. Specifically, a boundary ponents have not been considered in this research courtyard normally contains an east-west crossing due to their low importance in Siheyuan. For non- row room, which is located on the south if the court- standard courtyards, the determination of the room yard lies on the south boundary while it is located on layout was improvised by craftsmen. We concluded the north if the courtyard lies on the north bound- on eight variants by observing examples on the Qian- ary. Boundary courtyards may also contain one or long Capital Map. The generation of room layout pat- two secondary rooms. Similarly, a side courtyard con- terns in the plan view is defined as Rules 16-20, as tains a south-north crossing row room, which locates shown in Figure 7. on the east if the courtyard lies on the east boundary while it locates on the west if the courtyard lies on the

310 | eCAADe 39 - Rule based systems and shape grammar - Volume 2 Figure 9 The procedural modelling process of two Hutong neighborhood examples.

Location of building elements means the rooms could be slightly moved and ro- The algorithmic underlying Gongcheng Zuofa Zeli tated. The movement is defined as Rule 21 and the (Structural Regulation, 1734) defines a parametric sys- rotation is defined as Rule 22, as shown in Figure 8. tem that generates variants of single buildings, many The location of the Siheyuan entry gate is deter- of which are the rooms in a Siheyuan. Once the mined by the urban fabric. For most Siheyuans it is rooms are generated, they are located according to located in the southeast of the front courtyard. If the layout patterns shown in Figure 7. The constraint the south edge of the site is not connected to urban of the layout pattern to room location is loose, which space such as a Hutong alley or a street, the entry

Rule based systems and shape grammar - Volume 2 - eCAADe 39 | 311 gate is located elsewhere. There is a sequence to rank Dylla, K, Fisher, B, Muller, P, Ulmer, A and Haegler, S the priority of four patterns of entry gate location, re- 2008, ’Rome Reborn 2.0: A Case Study of Virtual City garding the urban fabric context. The sequence is Reconstruction Using Procedural Modeling Tech- niques’, Computer Graphics World, 16(2008), pp. 62- east of south edge> south edge of east edge> south 66 of west edge> west of north edge. Four patterns of E, E 1739, Ba Qi Tong Zhi [The eight banners annals], Qing location of an entry gate are defined as Rule 23a, Rule dynasty of , Beijing 23b, Rule 23c, and Rule 23d, as shown in Figure 8. Flora, R, Polly, H and Andrew, H 2018, ’The Use of Histori- Once the rules are captured, the grammar for its cal Data in Rule-Based Modelling for Scenarios to Im- procedural modelling is constructed. The Figure 9 prove Resilience within the Building Stock’, The His- toric Environment: Policy & Practice, 9(3-4), pp. 328- shows the procedural modelling process of two Hu- 345 tong neighbourhoods, which includes 12 steps. Li, J 2009, ’Qianlong Jingcheng Quantu Zhong de Heyuan Jianzhu Yu Hutong Jiefang Kongjian Tanjiu DISCUSSION AND CONCLUSION [research of courtyard building and Hutong neigh- borhood modes on the Qianlong Capital Map]’, Jour- Re-visiting historical design with a computational nal of China Architectural History, 2, pp. 249-282 perspective can inspire us not just to design the con- Li, D 2016, Computational Re-interpretation of Heritage temporary world by exploring new forms but also to Architecture, Ph.D. Thesis, University of Liverpool inherit traditional architectural knowledge. This pa- Liu, D 2019, ’An Intensive Analysis of the Typical Ur- per revealed the mathematical considerations em- ban Micro-Fabrics of Beijing in Middle Qing Dynasty: bedded in the generation of Siheyuan neighbour- Taking the Area in Northeast of the East Four Arch- ways in Qianlong Jingcheng Quangtu for Example’, hoods by a shape grammar corresponding to their in Jia, J (eds) 2019, Jianzhu Shi [Architectural History] original generative rules, which grasped the essence Vloume 43, China Building Industry Press, Beijing, of understanding their historical iteration. In future pp. 130-152 work, the rules of the proposed grammar will be im- Ma, B 1999, Beijing Siheyuan Jianzhu [Beijing Siheyuan plemented in Rhino 3D/Grasshopper environment to Building], Tianjin University Press, Tianjin procedurally generate the virtual three-dimensional Ni, Y 2009, Study on Typology of Beijing Hutong Siheyuan, China Building Industry Press Hutong neighbourhood models. The Grasshopper Song, L (eds) 1369, Yuan Shi [history of Yuan dynasty], script, in association with the grammar, is a new way of China, Beijing to understand Hutong neighbourhoods. Meanwhile, Stiny, G 1980, ’Introduction to shape and shape gram- in support of Hutong-style neighbourhood design, mars’, Environment and Planning B: Planning and De- the script could be a digital tool to generate neigh- sign, 7(3), pp. 343-351 bourhood models. Stouffs, R 2018 ’Where Associative and Rule-based Approaches Meet a Shape Grammar Plug-in for Grasshopper’, Proceedings of the 23rd CAADRIA, pp. REFERENCES 453-462 Anon, Anon 1733, Gongcheng Zuofa Zeli [Structural Reg- Wang, Y, Agkathidis, A and Crompton, A 2020, ulations]., Qing Dynasty of China, Beijing ’Parametrising historical Chinese courtyard- Chan, C and Xiong, Y 2007, ’The features and forces dwellings: An algorithmic design framework for the that define, maintain and endanger Beijing court- digital representation of Siheyuan iterations based yard housing’, Journal of Architectural Planning Re- on traditional design principles’, Frontiers of Archi- search, 24 (1), pp. 42-64 tectural Research, 9(9), pp. 751-773 Duan, B 2007, Beijing Hutong Zhi [Beijing Hutong Chroni- cle], Beijing Press, Beijing Duan, B 2016, Beijing Siheyuan Zhi [Beijing Siheyuan Chronicle], Beijing Press, Beijing

312 | eCAADe 39 - Rule based systems and shape grammar - Volume 2