MODELLING OF INDOOR ENVIRONMENTS USING LINDENMAYER SYSTEMS

: Documentation of the “as-built” state of building interiors has gained a lot of interest in the recent years. Various data acquisition methods exist, e.g. the extraction from photographed evacuation plans using image processing or, most prominently, indoor mobile laser scanning. Due to clutter or data gaps as well as errors during data acquisition and processing, automatic reconstruction of CAD/BIM-like models from these data sources is not a trivial task. Thus it is often tried to support reconstruction by general rules for the perpendicularity and parallelism which are predominant in man-made structures. Indoor environments of large, public buildings, however, often also follow higher-level rules like symmetry and repetition of e.g. room sizes and corridor widths. In the context of reconstruction of city city elements (e.g. street networks) or building elements (e.g. fac¸ade layouts), formal grammars have been put to use. In this paper, we describe the use of Lindenmayer systems - which originally have been developed for the computer-based modelling of plant growth - to model and reproduce the layout of indoor environments in 2D.


INTRODUCTION
Documentation of the "as-built" state of building interiors has been gaining importance in the recent years, especially with upcoming applications like indoor navigation and location-based services and the improvement of applications like evacuation and disaster management.The most prominent method for base data acquisition in indoor environments nowadays is laser scanning, resulting in massive amounts of points.The automatic interpretation of such data with the aim of deriving CAD/BIM models or ground plans -despite the existence of data gaps and inaccuracies -still is subject to research.Many published approaches rely on architectural rules like predominantly planar structures or the well-known Manhattan world constraints.However, a) interior architecture does not always follow the Manhattan world constraints, and b) man-made indoor structures show higher-level architectural rules like the repetition of distances between walls of corridors or rooms (i.e.repeated room/corridor width) and a dependency between the external building shell's center line and the layout of corridors, among others.
As has been shown for e.g.grammar-supported fac ¸ade modelling (Becker, 2009), the integration of such higher-level constraints helps to improve the reconstruction process.For several years, grammars have been put to use in the area of city modelling: the repetitiveness found in building fac ¸ades as well as the "natural growth" structure of street networks can be modelled using split grammars, or Lindenmayer-(L)-systems, respectively.In indoor modelling, we translated those concepts to L-systems describing the corridor structure and split grammars to describe the noncorridor space being split into rooms by walls which depend on the corridor outline (Becker et al., 2013) (see also section 1.1).
Here, instead of using two different grammar concepts, we propose the use of a set of L-systems to model such constraints in the context of 2D modelling of the interior structure of large public buildings showing some kind of repeated structure (e.g.hotels, office buildings, hospitals).This paper describes the definition of the L-systems and the derivation of their rules' parameters and probabilities from data (section 2).The proof of concept is done using the fairly simple data set (see figure 1) which was also used in (Becker et al., 2013) (see section 3).The integration of the Lsystem with sensor data (like wall segments or areas of free space from lidar point clouds) is subject to future work (see also section 4).

While initially developed for the formal description of lan-
The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLII-2/W7, 2017 ISPRS Geospatial Week 2017, 18-22 September 2017, Wuhan, China guages, many researchers have described how to apply grammars in the procedural production of geometry.To this end, among others, shape grammars (Stiny and Gips, 1972), Lsystems (Prusinkiewicz and Lindenmayer, 1990), and split grammars (Wonka et al., 2003) were developed.
Parish and Müller's works (Parish andMüller, 2001, Müller et al., 2006), mark first adaptations of such rule-based production systems for city modeling.The authors describe the procedural generation of complete city models by generation of street networks and building fac ¸ades using L-systems and split grammars, respectively.While useful for visualizations, movies, and games, the rules and parameters to be used by the grammars were handcrafted by experts and, apart from some maps describing the population density of the city to be developed and the topography, no further data was used.
Müller further developed the concepts to be employed in the context of reconstructing building fac ¸ades from images (Müller et al., 2007).Also other image-based fac ¸ade reconstruction methods using a split grammar were presented, e.g.(Brenner and Ripperda, 2006).Furthermore, (Becker, 2009) describes the use of a split grammar for fac ¸ade reconstruction from lidar data, deriving the parameters in areas with complete data and using the grammar to support the reconstruction of complete models in areas with incomplete data.More recent works like (Demir et al., 2016) show that there is still an ongoing interest in outdoor procedural city modelling.
In the context of indoor modelling, a similar trend can be observed.Early works describe the fully procedural generation of plausible indoor space subdivisions for residential houses (Hahn, 2006, Marson and Musse, 2010, Mirahmadi and Shami, 2012) or other buildings (Gröger and Plümer, 2010).
More recent developments aim at the integration of sensor data and can be found in the adaptation of a Palladian grammar by (Khoshelham and Díaz-Vilariño, 2014) and our previous work combining a split grammar (Peter et al., 2013, Philipp et al., 2014) and an L-system (Becker et al., 2013).While (Khoshelham and Díaz-Vilariño, 2014) -building on the Palladio grammar described in (Stiny and Mitchell, 1978) -employ a small set of general rules to support reconstruction from complete lidar point clouds, their approach does not enable for a description of repeated structures and thus does not need to learn grammar parameters from data beforehand.In contrast, our previous work employs higher-level rules whose parameters and probabilities have to be derived from data in the same manner as in Becker's grammar-supported fac ¸ade reconstruction approach (Becker, 2009).In turn, the method is able to predict the distribution of corridors and wall splits based on their probabilities and thus can be employed to support reconstruction in areas of sparse data.The most recent developments in indoor procedural modelling are found in the publications by Loch-Dehbi, Dehbi, Gröger, and Plümer.In (Loch-Dehbi et al., 2016), for example, they describe the prediction of a building's floor plan using logical and stochastic reasoning.Currently, their approach is able to produce impressive results despite integrating only a very low amount of data like room areas and room numbers, but the integration of other observations seems feasible.

METHODOLOGY
In residential houses spaces of different use are often openly connected or combined.Furthermore, room sizes vary depending on their use.For example, often one big room being used as dining and living area will be complemented by smaller private rooms.
Here, we concentrate on large public buildings whose structure follows different usability constraints.Mostly, many small, separate spaces (used e.g. as offices, hotel rooms, hospital rooms) are connected to a system of corridors connecting the different parts of a floor.This is due to reasons like the need for an efficient use of the available space and the accessibility to windows within the majority of rooms.The latter reason explains the corridors often being found close to the building's external shell's center line and/or parallel to it as well as the majority of rooms having a direct connection to the external building shell and the corridors.
These observations motivate the way we model the elements of an indoor environment.Figure 2 depicts those elements: In red, the building's external shell is visible, its center line is depicted with a red dashed line (see section 2.1).The location of a segment of the corridor's center line can be expressed by an angle, an offset, and its length.The corridor walls are shown in yellow, the corrdidor's center line dashed yellow.The locations of the corridor's walls, in turn, are expressed depending on the corridor center line using an offset and their length.
Furthermore, there are two types of walls: Walls which depend directly on the corridor and the external shell (green) and walls which do not depend on the corridor only (grey).Due to usability constraints (e.g.efficient placement of furniture), walls depending on the corridor frequently connect to the corridor in a fixed angle, often 90 degrees.Using this angle, the distance between two consecutive walls, and the external shell (or a fixed length), the location of corridor-depending walls can fully be described depending on the corridor's center line.Walls which do not depend on the corridor directly (grey) can be expressed in reference to the wall they depend on using a set of (angle, length) tuples.
If doors follow a pattern (e.g. the door center is always located in one meter distance from the room's left wall), their locations can be encoded using the distance from a wall along the corridor center line.

Center lines
It is obvious that center lines are a crucial element of our approach, as the corridor system is produced using the external shell's center line as reference and the walls are expressed using the corridor center line, in turn.Originally, we had planned to compute center lines by using a skeletonization approach like iterative thinning (Zhang and Suen, 1984) or the distance transform (Felzenszwalb and Huttenlocher, 2004) resulting in the external shell polygon's medial axis.Also, the straight skeleton, possibly with modifications described in (Haunert and Sester, 2008) seemed to be valid options.However, those approaches are -in varying amounts -too much affected by small structures in the polygon outline (which would affect all dependent parts).
Thus, we developed a new method to extract the center line of a polygon.Currently, the approach needs the polygon to be ringlike in order to define the hole and outer boundary, but in the future we plan to extend it to simpler polygons.The following steps are carried out in order to compute the center line (for a result see figure 3): 1. Project the vertices of each hole contour to all other contours along the normal vectors of the hole contour's edges, connect each vertex with its projection Lindenmayer-(L)-systems were developed to formalize the description of plant growth and to reproduce its processes using computers.The aptly-titled book "The algorithmic beauty of plants" (Prusinkiewicz and Lindenmayer, 1990) gives a good introduction to L-systems and their application to produce realistically-looking models of plants by modeling their growth processes.In addition to simple deterministic, context-free Lsystems also stochastic L-systems (using probabilities for the rules to be applied) and context-sensitive L-systems (constraining the application of a rule to a specific context within the system) are described.
The main two synthesis strategies in the context of L-systems are node rewriting and edge rewriting.In node rewriting a rule is applied to a node, causing its replacement by a sequence of the shape "node (edge node)" where several (edge node) tuples may be produced in order to make the original node a branching node (see figure 4).In edge rewriting (see figure 5), in contrast, a single edge is replaced by the sequence "edge node edge".Node rewriting causes the system to grow longitudinally, whereas edge rewriting can be used to grow laterally (especially if combined with node rewriting using the newly added nodes).All of the L-systems we put to use are deterministic and contextfree.Thus, the choice of the rule to be applied is neither determined by a probability nor is it determined by the type of the non-terminal to be rewritten or the type of other present non-terminals (i.e. the context of the non-terminal).However, the parameters of the rules are determined by probabilities, similar to the L-systems described in (Parish and Müller, 2001) and (Becker et al., 2013).Parameters and their probabilities encode the specific layout of the building's interior architecture.
We use the following systems to describe the architectural layout of an indoor environment: The CorridorSystem enables to "grow" the corridor center line by node rewriting.The rewriting process uses the parameters angle and offset (defined using the external shell center line as reference) and length.The growth of the CorridorSystem is constrained by the external shell with which the derived corridor center line edges are not allowed to intersect or coincide.In the context of the CorrdidorSystem, the center line nodes and edges are terminals.However, they serve as input axioms for the Corridor-WallSystem as well as the WallSystem.
The CorridorWallSystem defines corridor parts with the same width using edge rewriting based on the edges defined by the Cor-ridorSystem.To this end, the parameters length and offset (i.e.corridor width) are employed.The necessity to be able to produce a valid corridor shape (according to the parameters) within the bounds of the external shell constrains the CorridorWallSystem, but also implicitly the growth the CorridorSystem.
WallSystem: Locations of walls depending on the corridor are defined using edge rewriting along the edges defined by the Cor-ridorSystem.The WallSystem's productions are bound by a) the results of the CorridorWallSystem's productions, and b) the external shell.The origins of wall structures not depending on the corridor will be defined by a further edge rewriting step using the corridor-depending walls as input.The remaining structure of the walls not depending on the corridor is produced using node rewriting.

DoorSystem:
The locations of door centers are defined using a distance to a wall along the corridor center line and can be produced using edge rewriting.

Extraction of parameters and probabilities
In order to describe the structure of a specific indoor environment using the L-systems, the rules' parameters and their probabilities have to be extracted from data.For our proof of concept (see section 3) we used a CAD plan, however, in future work we will investigate the usability of sensor data like lidar point clouds for this purpose.
The steps to derive the parameters and probabilities are as follows: Firstly, compute the external shell and corridor center lines.Secondly, relate the edges of the corridor center line to the closest external shell center line edge.Collect the corridor edges' lengths as well as the angle and offsets (of their start and end nodes) between corridor center line and the respective external shell center line edge.Identify the probabilities of reoccurring angles, offsets, and lengths using a histogram (weighted by the lengths).Compute the final parameters as the mean values of the histogram's bins.
Relate the corridor's walls to the corridor center line and collect their lengths and the offsets from the corridor center line.Compute the probabilities using a histogram as in the case of the corridor center line; compute the final parameters as the mean values of the histogram's bins.
Extend the walls to the corridor center line and collect the angles with respect to the corridor center line and the distances between intersection points.Compute the probabilities and parameters using a histogram as in the case of the other parameters.
An example for the parameters and probabilities of the Corri-dorSystem of the data set shown in figure 1 can be seen in figure 6.

Synthesis of possible indoor layouts
To synthesize a possible indoor layout using a given external shell and L-system parameters and probabilities, the following steps are carried out: 1. Compute the external shell center line 2. Generate a starting node for the corridor center line using offsets from all edges ei originating from a randomly picked node of the external shell center line 3. Per ei pick angle and length parameters for the node rewriting process at the current corridor center line node; generate a new corridor edge ec and its end point nc 4. Accept or reject ec after evaluating its validity by (a) checking for the validity of nc's offset, (b) testing for intersections of ec with the external shell polygon, and (c) trying to produce a valid corridor wall layout (which may not intersect with the external shell polygon) by rewriting ec using the CorridorWallSystem.
5. If no valid ec is found after a maximum number of iterations: extend ec until a valid offset to the closest external shell edge is found; if still no valid offset is found generate a new ec at the closest node of the external shell center line.
6.If nc is outside a branch/corner cell (of the external shell's center line): find the next edge to follow as the edge closest to ec's end node; Else: follow all the edges connected to the contained nodes 7. Generation of the corridor center line is stopped once all ei were followed.The application of the WallSystem's part describing non-corridordependent walls as well as the DoorSystem are subject to future work.

EXPERIMENTS AND RESULTS
For a proof of concept of the method, we used the steps described in section 2.3 to extract the parameters and probabilities of Lsystem describing the dataset depicted in figure 1.The resulting (parameter, probability) tuples for the CorridorSystem are shown exemplarily in figure 6.As can be seen, long corridor segments (combined probability of 32 and 34 metres length: 85%) parallel to the reference edge (0 degrees: 99%) have the highest probability.The angles of -90 and 90 degrees result from the corridor narrowing in the upper central part and the resulting change in the corridor's center line.Various offsets are possible with -0.014 metres being the most probable with nearly 50% probability.
Figure 6.Parameters and probabilities for the CorridorSystem of the data set shown in figure 1 Using the extracted parameters and the external shell we ran the process to synthesize possible indoor layouts as described in section 2.4.One possible result is depicted in figure 7.As the integration of the L-system with sensor data is subject to future work (see section 4), the only constraint used for the synthesis was a minimum room depth of 2.5 metres.This results in certain Corri-dorSystem offsets not being used for certain areas (e.g. the -0.014 metres offset for the side wings).
It is clear that a quantitative evaluation of the results does not make sense as the indoor layout is fully produced using the probabilities derived before.Examining the result visually, it can be seen that, despite the fact that no data was used, the resulting interior layout looks reasonably plausible.The narrowing corridor in the upper central part of the image, however, is very unlikely (see the combined probabilities of +-90 degrees angles and of 1.22 metres length) and is not reproduced without further data supporting it.The smaller subdivisions of some of the corner rooms in figure 1 are currently not modelled within the grammar's parameters as they are non-corridor-dependent wall structures.
Figure 7.A result from our approach

CONCLUSIONS AND FUTURE WORK
We have shown that our approach of using L-systems is able to reproduce the architectural layout of a given interior environment well without the need to use two different grammar concepts as in our previous work.
The development of the approach is ongoing work.In the future, apart from testing the approach with more complicated building layouts, various aspects will be investigated.
Firstly, the split grammar we previously used to model wall splits is able to describe not only globally repetitive patterns (like the probability of a certain room width), but also local repetitions (like room A always followed by room B).As in the case of the split grammar, such characteristics could be integrated by conditional probabilities between different parameters of the Lsystems.Alternatively, the current context-free L-system could be replaced by a context-dependent system.
Furthermore, the description of doors and wall structures which do not directly depend on the corridors has to be further developed.Also, the simple histogram-based method in use for the inverse procedural modelling, i.e. the extraction of parameters and probabilities, most probably has to be replaced by a more sophisticated method.
Most importantly, we will investigate the usability of the proposed grammar concepts to support the reconstruction from sensor data, as well as the extraction of the grammar's parameters from sensor data which expectedly will be more inaccurate and noisy than the CAD plans used in this paper.Data sources to be investigated range from the room polygons derived from pedestrian traces described in (Becker et al., 2013) to locations of windows from fac ¸ade models, free space/wall segments extracted from point clouds, and room polygons or possible wall locations found in photographed evacuation plans (Peter, 2015).The products derived from the data will define two sorts of input for the derivation of hypotheses from the L-systems: a) "place a wall here" (e.g.wall locations extracted from point clouds or evacuation plans), and b) "do not place a wall here" (free space extracted from pedestrian traces, point clouds, or evacuation plans; locations of windows found in fac ¸ade models).Depending on their reliability and the probabilities of the grammar parameters, an overall probability for the synthesis of the elements will be derived.

Figure 1 .
Figure 1.Ground truth plan of a floor of the Computer Science building, University of Stuttgart, as used in (Becker et al., 2013); orange: corridors Figure 3. External shell center line (blue dashed), corner (red) and branch (green) cells

Figure
Figure 4. Node rewriting

8.
Compute the final corridor center line edges by extension and intersection of edges close to each other and by merging collinear edges 9.As corridor-depending walls can only be constructed where an external shell wall is available, valid areas for such walls along the corridor's center line are identified by projecting the closest external shell wall to the corridor center line edge.10.Apply the WallSystem to the valid areas along the final corridor center line's edges: (a) Compute the starting nodes of corridor-depending walls (b) Generate the walls replacing the starting nodes by edges using the WallSystem's angle parameter (c) Compute the walls' start and end points by intersection with the corridor walls and the external shell polygon, respectively