Procedural Modelling of 3D Buildings within Predefined Spaces Using
Genetic Algorithm
Capstone Project – ART_803
Welsh School of Architecture
Cardiff University
May 2024
-Author –
Labiba Tasnim
C23051447
- Supervisor –
Wassim Jabi & Simon Lannon
5.1
5.2
5.3
5.4
5.5
1. Introduction
3D modelling in architecture has been transformed by Procedural Modelling as it offers automated and cost-effective solutions. Although costly and time-consuming, 3D modeling is essential to town planning, architecture, and historic preservation (Bojan Tepavčević & Stojaković 2013). Procedural modeling is particularly efficient as this process enables to building detailed urban settings efficiently (Adão et al. 2019). Procedural grammar and shape rules can handle the formation of complex architectural geometries, such as non-axis-aligned shapes, roofs, and volumetric forms that were previously difficult to model manually (Muller et al. 2006). However, only very few of these tools, i.e. DeCodingSpaces (a plugin for grasshopper) are designed to generate 3D urban environment based on set parameters though it does not provide optimized solutions (Koenig 2018)
3D modeling tools that are available in the present are limited to visualization, and lack robust optimization and automation features, particularly in 3D city layouts as they require manual adjustments. These tools are primarily intended for 3D visualization, with little support for evaluation and analysis of urban areas. They generate realistic 3D graphics from real-world LiDAR and GIS data. But managing complex urban settings, particularly intricate road networks, calls for both computational tools. (Makarouni [No date]).
3D procedural modeling for urban planning can be more efficient by incorporating parcel subdivision, clustering, and creating diverse layouts to fulfill different functional objectives. The use of GIS-based procedural modeling tools to improve urban design and planning processes, while giving a systematic method to creating diverse and productive urban environments can help improve functionality (Zhang et al. 2022). 3D modeling using computational methods include faster model generation and increased accuracy than a human (Toolify.ai 2023).
Advancements in procedural modeling technology hold potential to transform architectural design methods and urban planning approaches. Leveraging computational methods like genetic algorithms, reinforcement learning, etc. can help optimize building parameters, placement, connectivity while streamlining the design process. To improve spatial representation and placement of 3D buildings within predefined spaces and optimize generation, analysis, and design in urban planning and architecture, this research proposal explores the integration of genetic algorithm into procedural modeling.
2. Literature Study
Building a tool for 3D city visualization begins with literature review of procedural modelling, and genetic algorithms and how to combine these to maximize efficiency. Integration procedural modeling and genetic algorithms might lead to a highly efficient and optimized 3D city generation tool. The literature review will also reveal any existing research gaps in this area and provide an understanding of how to develop and automate rule-based modelling further.
2.1 Procedural modelling in City Design
Existing tools for modelling cities emphasize generating realistic urban environments. These tools use multiple methods like CGA shape grammar, agent-based simulations, L-systems to model cities more efficiently and optimally considering architectural rules (North Western University [No date]; ArcGIS CityEngine [No date]). Enhancement of the automation and optimization in urban design can be done effectively with procedural modeling using genetic algorithm, where the genetic algorithm can optimize the building placement, orientation, accessibility, and other building parameters (Vanegas et
al. 2012). A study by Saldaña (2020) explores the adaptability of classical architectural principals into systematic city planning with interactive street grid testing and conjectural model representation. The studies emphasize the significance of procedural modeling in urban design for creating intricate, visually appealing, and functionally accurate virtual 3D city models.
2.2 Genetic Algorithm
Genetic algorithm (GA) is a method inspired by natural selection, used to solve constrained and unconstrained problems. It includes iteratively improving a population of potential solutions using strategies such as selection, crossover, and mutation. And over time, the population "evolves" toward an optimal solution based on a fitness function (Mallawaarachchi 2017; MathWorks 2024) Potential solutions are represented as arrays of bits or other data structures in a GA. Each individual's fitness level is determined by comparing their performance to the problem's objective function (Kanade 2023).
2.3 Use of Genetic algorithm in architecture
Ariffin et al. (2017) combine the Interactive Genetic Algorithm (IGA) with other 3D model generation techniques to help enhance the production of intricate and aesthetically pleasing 3D models. Genetic algorithms are widely used in optimization because they efficiently explore a large range of options for optimal or nearly optimal solutions (Kabolizade et al. 2012). As these algorithms are inspired by natural selection processes, they provide benefits such as optimizing continuous and independent variables. They are also effective at large-scale optimization issues and can handle complex topologies (Kabolizade et al. 2012) Barriga et al. (2014) propose a strategy for optimizing building placement in Real Time Strategy games, specifically to enable defending players to withstand base attacks effectively.
3. Research Gaps
There are many available tools for procedural modelling but the only available tools (i.e. City Engine, Unreal Engine, Arc GIS) for urban planning seem to be primarily targeted to 3d visualization and do not provide optimized solutions. Any kind of analysis, assessment or optimization in these tools are completely manual and are based on LiDAR and GIS data. Another problem is, the process of building a city in these procedural modelling tools is manual as these tools don’t have proper understanding of complexities of the road networks, proximity, adjacency, and the relationship between different urban zoning. The aim of this research is to suggest ways to combine GA with procedural modelling to aid automation process while providing optimal solutions for urban development and insights into how the city may evolve over time.
4. Aim & Objectives
This project aims to develop a tool that will automate the process of generating non-overlapping 3D buildings within predefined locations, while taking the land use and the building regulations into account. In simple terms, this tool will automatically generate buildings within designated lands according to the land use and corresponding regulations, so users can get an idea of spaces in the city during the planning stage and how it may evolve over time. With that purpose in mind, the described project has a few simple objectives:
• Acquisition and analysis of land use map and building regulations.
• Optimization of building heights, volumes, orientations, based on set parameters
• Generation of building footprint from the land parcels.
• Assigning the optimized height to the footprints automatically.
• Placement of the buildings on the corresponding land while ensuring the buildings don’t overlap.
5. Methodology
The methodology can be split into three stages: firstly, data preparation and context representation, secondly, height optimization and lastly validation of the algorithm to see how it compares to the real world. The use of the selected open-source Python library, Topologicpy and PyGAD was due to their compatibility of these and the efficiency in management of time. Even though these are not industrial grade software and occasionally has difficulties handling complex geometry, combination of these libraries is highly customizable and aid in the optimization process, while providing a rough idea of the massing of the city.


Figure 2: A flowchart demonstrating the workflow for automated procedural modelling for urban environment (Author, 2024)
5.1 Data Acquisition and Analysis
Initially a land use map of a certain block of the city was collected from an online database named Digimap. Attributes and parameters like land use types, building regulations and parcel dimensions were extracted from the data and further research into building codes of the area.
5.2 Preparing the context [for the code see appendix 1]
The map was cleaned up using Topologicpy where the coplanar faces of the land parcels were removed to prepare the context for the algorithm.
5.3 Algorithm Development for Building Footprints [for the code see appendix 2]
Getting the initial building footprints are quite simple, it is based on the parcel dimension, shape, and the setback according to regulations of corresponding land use. The algorithm uses simply use TopologicPy to offset the edges of the land parcels inwards to generate the building footprint with maximum useable space.

5.4 Optimization of Building Heights and Volumes [for the initial code see appendix 3]
Application of GA to optimize the building height and volume according to floor are ratio (FAR) solar gain and prominence score of each building, as genetic algorithms are capable of mutating over many solutions to suggest an optimum or near optimum solution. The algorithm calculated solar gain for each building within the range of different heights, prominence score of each building so everything blends into the site in harmony and tries to maximize the FAR. Keeping all these into account a weighted fitness function was implemented to suggest optimum heights for each building in the site.

5.5 Assigning heights to the building footprints [for the initial code see appendix 4]
Once the building height is optimized, the vertices were translated in the Z direction as per the matching height and the wires can be used to add faces, so the buildings have volume. To generate each building on the corresponding land, the land parcels were iterated through and given heights that belong to the same index.


3: A representation of the model to be developed (Author, 2024)
6. Results




2 3 4




Figure 4: demonstration of the process for automated city generation (Author, 2024)
The genetic algorithm shows potential in generating realistic and optimized 3D city models from any land use map across different urban contexts. The algorithm explores a few parameters and converges on realistic solutions tailored to different city blocks’ unique constraints and objectives.
The key results and benefits of using the genetic algorithm includes:
• Effectiveness in generating realistic and optimized 3D city models in very less time.
• Ability to handle diverse urban contexts and constraints.
• Improvements in optimization of quantitative metrics like solar gain, FAR.
• Visually appealing and livable urban environments in the 3D visualizations.
• Potential for wider adoption in data-driven urban planning initiatives.






5: The algorithm provides different outputs in different contexts with each generation (Author, 2024)
7. Validation
For the validation process a small block in Mayfair, London was selected. The GA generates slightly different results than the real site, where all the buildings are very similar in height. Since parameters like solar gain and prominence score were included in the algorithm, a slight difference was expected.



8. Limitations and Scopes


The present function of the algorithm has several limitations as for now it only accepts three parameters. Additionally, the code could be made more robust and shouldn’t stop if some of the faces show errors. Furthermore, it lacks a user interface, which could increase the usability as not all urban planners are familiar with coding.
One prospect of this project could be adding all the parameters that affect the height of buildings in any given area, so the results are more reliable and promising. That way this algorithm can be used to minimize cost in visualization and optimization of urban settings. Moreover, this might lead to prospects of building a user interface by combining TopologicPy with Viktor ai instead of simply using Jupyter Notebook as that requires knowledge and understanding of coding.
The Viktor.ai platform provides a user-friendly interface for uploading models and running pythonbased applications. The application’s interface and workflow make it accessible to users without coding knowledge (Jabi 2023).
The combination of the algorithm with an user interface widens the possibilities of scalability of running energy simulations and automates the simulation process. Combining these approaches can enable the tool to be more efficient as it will be user friendly for people with no coding knowledge. Leveraging this platform’s capabilities may offer the users a more accessible and efficient platform for them to interact with geospatial and architectural data (VIKTOR 2023)
7. References
Adão, T. et al., 2019. Procedural Modeling of Buildings Composed of Arbitrarily-Shaped FloorPlans: Background, Progress, Contributions and Challenges of a Methodology Oriented to Cultural Heritage. Computers, 8(2).
ArcGIS CityEngine, n.d. About CityEngine. [Online]
Available at: https://doc.arcgis.com/en/cityengine/2019.1/get-started/get-started-aboutcityengine.htm
[Accessed 20 03 2024].
Ariffin, M. K. b., Hadi, S. & Phon-Amnuaisuk, S., 2017. Evolving 3D Models Using Interactive GeneticAlgorithms and L -Systems. s.l., s.n.
Barriga, N. A., Stanescu, M. & Buro, M., 2014. Conference: Workshop on Artificial Intelligence in Adversarial Real-Time Games, AIIDE. s.l., s.n.
Bojan Tepavčević & Stojaković, V., 2013. Procedural modeling in architecture based on statistical and fuzzy inference. Automation in Construction, Volume 35, pp. 329-337.
Kabolizade, M., Ebadi, H. & Mohammadzadeh, A., 2012. Design and implementation of an algorithm for automatic 3D reconstruction of building models using genetic algorithm. International Journal of Applied Earth Observation and Geoinformation, Volume 19, pp. 104-114. Kanade, V., 2023. What Are Genetic Algorithms? Working, Applications, and Examples. [Online]
Available at: https://www.spiceworks.com/tech/artificial-intelligence/articles/what-are-geneticalgorithms/amp/ [Accessed 2024].
Koenig, R., 2018. Urban Simulation with Grasshopper for Rhino3D. [Online]
Available at: https://toolbox.decodingspaces.net/urban-simulation-with-grasshopper/
Makarouni, E., n.d. 8 Top 3D Modeling Tools for Architects and Designers. [Online]
Available at: https://architizer.com/blog/practice/tools/top -tech-tools-for-architectural-3dmodeling/ [Accessed 7 March 2024].
Mallawaarachchi, V., 2017. Introduction to Genetic Algorithms Including Example Code. [Online]
Available at: https://towardsdatascience.com/introduction-to -genetic-algorithms-includingexample- code- e396e98d8bf3 [Accessed 2024].
MathWorks, 2024. What is Genetic Algorithm. [Online]
Available at: https://www.mathworks.com/help/gads/what-is-the-genetic-algorithm.html [Accessed 2024].
Muller, P. et al., 2006. Procedural Modeling of Buildings. ACM Transactions on Graphics, 25(3), pp. 614-623.
North Western University, n.d. Procedural Modeling of Cities. [Online]
Available at: https://ccl.northwestern.edu/rp/cities/index.shtml [Accessed 2024].
Saldana, M., 2020. An Integrated Approach to the Procedural Modeling of Ancient Cities and Buildings. Digital Scholarship in the Humanities, Volume 30, pp. 48-63.
Toolify.ai, 2023. The Advantages and Limitations of AI in 3D Modeling. [Online]
Available at: https://www.toolify.ai/ai-news/the-advantages-and-limitations- of-ai-in-3dmodeling-4384 [Accessed 2024].
Treeck, C. v. & Rank, E., 2006. Dimensional reduction of 3D building models using graph theory and its application in building energy simulation. Engineering with Computers, Volume 23, p. 109–122.
Vanegas, C. A. et al., 2012. Inverse Design of Urban Procedural Models. SIGAsia.
VIKTOR, 2023. Digital Solutions in HVAC Design: Benefits of Topologic and Early-stage Optimization. [Online]
Available at: https://www.viktor.ai/blog/114/digital-solutions-hvac- design-benefits-topologicearly-stage- optimization [Accessed 21 03 2024].
Zhang, M. et al., 2022. GIS Based Procedural Modeling in 3D Urban Design. ISPRS Int. J. GeoInf., 10(11).
Appendix 1. Preparing context

Appendix_2. Building Footprints

Appendix_3. Height optimization






