L-system Formulation

Pailou L-system

When starting from the bottom cap of Toukungs and the middle of the central entrance, their topologies are similar to branching trees. L-system is a string rewriting mechanism based on designed production grammars [PL90] which can be expressed as an ordered triplet G= ❬V,Ω,P❭ where V is a set of alphabets, Ω is the axiom, \ie, a word, and P is a set of production grammars. The following table provides the interpretation of those commonly used symbols in our representation while we also incorporate with parameters to extend its modeling abilities. Research generally use it to model branching structures, and therefore, we derive our own L-system grammars to represent both structures with the following considerations. 1) During production, we can easily modify scale ratios and use them to define the frame of Toukungs and Pailous. 2) Production applies in parallel to generate a string whose terminal symbols contain positional and geometric information. As a result, we formulate the relationship among components with derived parameters and procedurally model them with the parametric L-system for efficient, controllable, flexible, and portable modeling abilities in the following paragraphs.

Table. This lists those commonly used L-system symbols for their corresponding Turtle interpretation.


Architects stack ∏-shaped entrances upwardly and align them laterally. Then, they append decorative components, such as flower boards and Quetis, at the corresponding lintels and pillars while requiring auxiliary components to support appending ones, such as an extra lintel is added to support appending flower boards. As shown in the following figure (a), we first decompose the component graph into consisting entrances, expressed as a layout chart in the following steps. We start at the central lintel-pillar combination. At each combination, while there is an extra pillar connected to its lintel, we add an upward entrance. Similarly, while there is an extra lintel connected to its pillar, we append a lateral entrance. We set the traversing combination at the next available upward and lateral ones, and repeat the traversing until we reach the top end of all branches.

Fig. (a) shows that we start traversing from the central entrance (G11) upwardly to the above entrance (G12) and laterally to the neighboring entrance (G21). Recursively, we can find the one (G22) above the G2 entrance. From (b) to (d) demonstrates our L-system string formulation, we iteratively insert the string segments for Pp11, Pp12, Pp21, and Pp22. Each Pp appends string segments for its corresponding pillar, lintel, and decorative components.


After determining all upward and lateral entrances, we can procedurally write out the parametric L-system string and build the corresponding Pailou as shown in the above Figure (b), (c), and (d). Our current implementation builds the clipped roofs, eaves roofs, middle Toukungs, and side Toukungs on the fly. They are represented them with RC(p), RE(p), TM(p), and TS(p) where p represents their corresponding parameters. Pillars, lintels, inscribed boards, pillar bases, Quetis, Yundans, booklet pillars, and flower boards are loaded as pre-modelled 3D models. They are represented with MP(i,p), ML(i,p), MIB(i,p), MPB(i,p), MQ(i,p), MY(i,p), MBP(i,p), and MFL(i,p) respectively where i indicates the i-th 3D model. Combining both procedural and geometric representations, which are imported and constructed as a whole, allows us to compute the desired position, orientation, and scale along with the corresponding geometric model. For example, we can import a model for the pillar base and generate it according to the turtle interpretation while we use the roof modeling tool proposed by Huang [HT13] to procedurally design roofs and generate them as a whole according to the turtle interpretation. We first initiate the L-system string from the central entrance, G1, as Ω=Pp11. Then, we first add the string segments for the pillar and lintel of CP(i,p,x,r) and CL(i,p,x,r) where CX=T(x)R(r) MX, T(x) indicates the translation of x, R(r) indicates the rotation of r, and MX is the production string for the object, such as MP for a pillar. For simplification, the following neglects i, p, x and r from the denotation. At the same time, we also add decoration components of a Queti, flower boards, booklet pillars, and a Yudan. This point also initiates G12 and G21 entrances, Pp12 and Pp21. Therefore, Pp11=CP CL CQ CY CFB CFB CFB CBP CBP CBP Pp12 Pp21. In the next iteration, Pp12 produces the pillar, lintel, Toukungs, and others while Pp21 produces the entrance and its appending structures. By repeating the process, we can generate the entire corresponding L-system string. In other words, our system first inserts the central main entrance and its decorative components. Then, we append the above and neighboring entrances. The process repeats until there is no entrance above or next to the current active one. The following figure provides the complete L-system production process for this example.

This shows our derived parametric L-system production grammars for the exemplar Pailou. αXWij, αXHij, αXDij, αUpij, and αSideij are user-specified parameters for each entrance where αXWij, αXHij, and αXDij represents width, height, and depth scale ratio for the X component for the entrance ij, and X are all components for the entrance. MPB, MP, ML, MFB, MQ, MY, TM, TS, RC, RE are the primitive of the pillar base, pillar, lintel, flower board, Queti, Yudan, middle Toukung, side Toukung, clipped roof, and eaves roof respectively.


Toukung L-system

Generally, we can procedurally decompose a middle Toukung (Bottom) and a side Toukung (Top) into three parts: capping, repeating, and supporting where the capping initiates the construction, the repeating repeats the fundamental structures to increase the level and height, and the supporting directly contacts and supports the roof.

From (a) to (d) demonstrates our L-system string formulation in different iterations for a 4-level middle and side Toukungs while the color of a connecting point marks a production rule such as yellow marks the production rule of PS1 and PM1 for the side and middle Toukungs.

When carefully observing Toukungs, we can decompose them into three parts, capping, repeating, and supporting, as shown in the above figure. The capping part consists of the cap, which produces the base to start the construction, along with a level of bracket sets as shown in the above figure. The repeating consists of levels of bracket sets along with Angs to extend the structure outward. The supporting consists of a set of brackets and Noses to support the roof.


Side Toukungs need to support the eaves corners where they must elongate one side asymmetrically while the inner half has similar structures as those in middle Toukungs. Accordingly, we derive two different parametric L-system grammars for the middle and side parts respectively. Our current implementation generates caps, axial-oval bracket arms, axial-long bracket arms, Angs, and noses using pre-modelled 3D models while representing them as MCa(i,p), MAO(i,p), MAL(i,p), MAn(i,p), and MNo(i,p). We first initiate the middle part at the cap as shown in the bottom of Fig.8(b). In order to simplify our discussion, we use left-right to denote the direction from left to right according to the view of Fig.8 while using out-in to denote the direction from the far side of the view to the near side. The cap also links to left-right and in-out axial-oval sets denoted as PM1, and thus, Ω=CCa PM1 (1). In the second iteration, we generate all four axial-oval arms, CAO. Each left-right arm links with an in-out axial-oval set and an Ang/nose depending on whether it is the last level, PM2, while each in-out arm connects to an in-out axial-long arm, PM5. Thus, PM1 (β)=CAO CAO CAO CAO PM2(β+1) PM5 PM5. In the third iteration, PM5= CAL generates an axial-long arm. PM2 generates an in-out axial-oval set and an Ang/nose while the Ang links to an in-out axial-oval set and an Ang/nose depending on whether it is the last level, PM3, in order to support the roof. We express PM2 and PM3 as follows.

And PM4=CAO CAO CNo. The process repeats until reaching the destined level. The following figure provides the complete L-system production grammars.

This shows our derived parametric L-system production grammars for the middle Toukungs. NTL is the number of production iterations and we set it to be 5 by default. αCa, αCC, αAOAA, αAOLA, αAOAV, αAOLV, and αAn are user-specified parameters. MAn, MCa, MNo, MAo, and MAL are the primitive of Ang, Cap, Nose, axial-oval arm and axial-long arm respectively.


We first initiate the side part at the cap as shown in the top of Fig. 8 (b). In order to simplify our discussion, we use the side arm to denote the arm extending in the eaves' direction and the in, our, left, and right arms to denote the arm respectively in the far, near, left, and right sides of the viewer. The cap also links to left-right and in-out axial-oval sets and denoted as PS1. Additionally, in order to support the eaves corner, there is an extra arm rotating 45 degrees around the y axis. Therefore,Ω=CCa PS1 (1). In the second iteration, we generate all five axial-oval arms, CAO. The in arm connects with an in-out axial-oval set and an Ang/nose depending on whether it is the last level, PS2. The out arm links with an axial-oval arm, PS6, and an Ang/nose depending on whether it is the last level, PS2. The left arm connects to an Ang/nose depending on whether it is the last level, PS2. The right arm links with an axial-long arm, PS8. The side arm connects with three Angs/noses depending on whether it is the last level, PS4. Thus, PS1(β)=CAO CAO CAO CAO CAO PS2(β+1) PS2(β+1) PS6(β+1) PS8 PS4. In the third iteration, PS2 propagates and generates as the one described in Eq.1. PS2 generates an Ang/nose while the Ang connects to an Ang/nose depending on whether it is the last level, PS9.

PS4 generates three Angs/noses, while the in and left arms each connect to another Ang/nose depending on whether it is the last level, PS4, and the side connects to three Angs/noses depending whether it is the last level, PS4. Therefore,

PS5= CNo generates a nose. PS6 generates an axial-oval arm, CAO, and the arm links to an axial-oval arm, PS6, and an Ang/nose depending on whether it is the last level, PS2.

PS8= CAL generates an axial-long arm. The process repeats until reaching the destined level. The following figure provides the complete L-system production grammars.

This shows our derived parametric L-system production grammars for the side Toukungs. NTL is the number of production iterations and we set it to be 5 by default. αCa, αCC, αAOAA, αAOLA, αAOAV, αAOLV, and αAn are user-specified parameters. MAn, MCa, MNo, MAo, and MAL are the primitive of Ang, Cap, Nose, axial-oval arm and axial-long arm respectively.


User-controlled Control Parameters

In addition to structural components and topological layouts, parameters are also important to vary their appearance. Since our system connects all components in an axis-aligned manner, we can use an axis-aligned bounding box (AABB) for manipulation. We create each pre-modelled model, whose front facing the minus depth direction, center at the origin, and three AABB dimensions are 1, respectively. While plugging into our procedural process, the modeling dimensions of AABBs are expressed in terms of the pillar height of their corresponding entrance, HPij, where i and j is the index of the entrance, and the pillar height of the central entrance is a user specific parameter, ω. In other words, these dimensions may vary from one entrance to another depending on their pillar height. Generally, architects uniformly scale those extended upward and laterally with αUpij and αSideij embedded with the pillar icon. For example, HP12Up11 HP11, and HP21Side11 HP11. Since traditional pillars are cylinders, the scale ratios for their width and depth are the same and modified simultaneously using αPWij. The cross section of a lintel is generally a square, and the ratios are also modified simultaneously using αLHij. The roof dimension is related to the size of middle and side Toukungs under it, and details are given in next paragraphs. We can compute the center of each component according to its belonging entrance along with the corresponding pillars and lintels. For example, the center of the right pillar of the central entrance is equal to (-EW-0.5PW,0.5PH,0.5PW).


Similarly, we can also express the dimension of each Toukung element as the ratio to the pillar height. Architects may have axis-oval and axis-long arms of two different lengths for the parallel and perpendicular direction of the roof ridge. There are six different control parameters: the width ratio of the connecting point and the length ratio of an Ang, an axis-oval arm perpendicular to the roof ridge, an axis-oval arm parallel to the roof ridge, an axis-long arm perpendicular to the roof ridge, and an axis-oval arm parallel to the roof ridge to the pillar height denoted as αCaij, αCCij, αAnij, αAOAAij, αAOAVij, αAOLAij, and αAOLVij. The following neglects ij for simplification. We can calculate roof's width and depth ratios to the pillar height as αRWLW+2((NTL-3)αCaAn) and αRD=2((NTL-3)αCaAn), respectively where αLW is the width ratio of the entrance. Users can choose these parameters arbitrarily, but traditionally, there are only a few harmonic sets for various Pailous [Wan92]. This work uniformly sets 7/61, 10/12, 6/7, 1/1, 1/2, 4/5, 1/5, 3/2, 9/2, 33/20, 12/5, 37/20, and 67/20 as default for αPW, αEW, αLH, αLW, αUp, αSide, αCa, αCC, αAn, αAOAA, αAOAV, αAOLA, and αAOLV of all entrances.

In the left, each level contributes αCa in height, and thus, it is total height is (NTL+1)αCa as shown in the left while each extra level after 3 contributes αCC in depth, and thus, it is total depth is (NTL-3)αCC + αAn. The width is αAOLV. Similarly, the side extension is (NTL-3)αCC + αAn.