Last modified: 2015-08-27
Abstract
Introduction
Research on the structure, perception and use of architectural space and the built environment often makes use of computer software to analyse these spaces mathematically. While there are many useful packages for this, most of them are basically two-dimensional, such as the Python Spatial Analysis Library (2015) and depthmapX (2015), restricting themselves to a single spatial plane and leaving it up to the researcher to define what this plane represents. While this approach works for basically flat urban spaces, it breaks down when trying to take into account three dimensional, multilevel or sloping architectural and urban features.
Other approaches incorporate a limited z-coordinate as a Digital Elevation Model (DEM), where the model is divided into a grid and every grid square is assigned an elevation value. This allows for the calculation of viewsheds and other values in landscape and territorial applications, but again does not extend to detailed, small scale analysis of complex 3d space.
There are also applications that analyse 3d meshes and allow for a more fine grained analysis, studying visibility relations between three dimensional spaces, such as those developed by Culagovski, Green and Mora (2009) and Chang and Park (2011), among others. In general, these applications restrict themselves to the specific approach and problems of interest to the researchers who developed them, which, while to be expected, limits their usefulness for other researchers with different assumptions and methods. In this context, it’s useful to distinguish between applications, which present a simple, graphic or command line interface to the user, and allow a limited amount of predefined actions to be executed, and libraries, which are lower-level collections of code, that expose certain functions and classes for programmers to incorporate as needed in their own applications, with greater flexibility and freedom. There are many 2d spatial analysis applications, and some 2d analysis libraries, but no true 3d analysis libraries available for research about the built environment. This is the gap we seek to address.
In particular, it seems beneficial to create a library that would allow researchers to develop models and analytical methods for the exploration of three-dimensional buildings and built space, while simplifying the general problems of generating a 3d visibility model, thus allowing them to focus on their specific research objectives.
Methodology
We present the Python 3-Dimensional Visibility Analysis Library (Py3DV), a package for the analysis of detailed three dimensional models, with a focus on visibility network relationships in architectural, commercial, public space and landscape applications.
Being a library, it does not present a Graphic User Interface (GUI), but rather allows a researcher to use its methods within her own programs and scripts, thus making it simple to incorporate 3d analysis into her methodology and workflow.
This package enables the analysis of complex three dimensional meshes (not just digital elevation models), allowing a detailed representation and quantification of features such as overhangs, walkways, openings, bridges, trees or multiple floors.
To this purpose, we have developed a three dimensional visibility graph module that represents an input mesh as a series of tiles, correctly interpreting multiple levels, not just the uppermost exposed surfaces. It then derives a directed visibility graph where each node is a point 1.5 meters above each tile, and an edge exists between two nodes A and B if a ray between A and B doesn’t intersect the input mesh. This is an expansion of the Visibility Graph proposed by Turner, Doxa, O’Sullivan and Penn (2001), which was originally implemented as two dimensional. The mesh this graph is calculated from can be constructed in many popular modelling applications such as Rhinoceros3d, AutoCad, Sketch-up, etc., and imported as an STL file.
With this 3d visibility graph, we calculate a series of values, such as graph centrality measurements, clustering, cliques or other values that a researcher might be interested in. The resulting values can then be visualised as coloured three dimensional tiles overlaid on the original STL model or used to generate statistical analysis and visualisations.
We chose Python for development for its relative ease of learning compared to other languages such as C++, C# or Java, which has lead to its being the scripting language of choice for most CAD, GIS and animation packages, as well as being widely used in scientific and especially data-science applications, all of which greatly expand its usefulness for different sorts of research. We make ample use of existing Python libraries both for their stability and range of functionality, as well as for the familiarity many researchers will already have with said libraries.
Results
We have developed modules allowing the importation of Stereolithography (STL) models, the calculation of visibility graphs from these models, their representation using the Networkx library by Hagberg, Schult and Swart (2014), their graph theoretical analyses and the representation of these analyses as coloured tiles overlaid on the original models, which can be manipulated in three dimensions of exported for their visualisation in other CAD applications, as well as exporting the values for statistical analysis.
Each one of these steps is exposed to the user through a simple Application Programming Interface (API), allowing their adaptation and extension, which would allow, for example, swapping in different graph analysis or representation libraries, or analysis via different algorithms.
Though most of the library’s work so far has been done in relation to visibility relationships, it would be fairly straightforward to replace the 3d visibility graph with one representing another sort of relationship, for instance the effort required to walk from one point on a slope to another.
Discussion
The library, at its current level of progress, is already useful as an analytical tool that lets researchers access visibility analysis with a shallow learning curve. Further progress will extend its functionality and flexibility, as well as simplify its use.
It has a clear limitation regarding the size of the analysis grid. In terms of algorithmic complexity, the visibility graph generation process is O(n⁴), as the analysis grid size is n² and each grid square is checked against each other grid square. Graph centrality calculation algorithms are generally sub-quadratic, so the calculation of the base visibility graph is the limiting factor.
In practical terms, analysing a 50×50 grid on a 2.6 GHz Intel Core i5 Macbook with 8 GB RAM takes approximately 30 minutes. It should be possible to improve this speed by porting the visibility graph calculating functions to C or by the use of JIT optimisers such as those in PyPy (2015).
The Py3DV project will be open sourced on GitHub in order to make it available to any researcher who can find a use for it and invite other developers to contribute to the project. By being an open source project, it is our hope that it will be able to benefit from the contributions of other researchers, in order to improve and extend the libraries capacities for everybody’s benefit.
It is our intention to guide this new library’s development, adding new features and types of modelling and analysis, as well as expanding the range of visualisations it can produce and improving its integration with statistical and mathematical packages, in order to allow spatial researchers to create any sort of tool they require.
Keywords
References
Chang, D. and Park, J. Exploration of Isovist Fields to Model 3D Visibility With Building Facade. ARCHITECTURAL RESEARCH, Vol. 13, No. 3(September 2011). pp. 19-29.
Culagovski, R., Greene, M., & Mora, R. (2014). Development of 3D VGA tools: an application in a case of weak heritage in Valparaiso, Chile. Ingeniería e Investigación, 34(3), 31-36.
Varoudis, Tasos. depthmapX [Computer Software]. (2015) Available at: http://varoudis.github.io/depthmapX/
Hagberg, A., Schult,D. and Swart, P. “Exploring network structure, dynamics, and function using NetworkX”, in Proceedings of the 7th Python in Science Conference (SciPy2008), Gäel Varoquaux, Travis Vaught, and Jarrod Millman (Eds), (Pasadena, CA USA), pp. 11–15, Aug 2008
PyPy [Computer Software]. (2015). Available at: http://pypy.org/.
Rey, S. and Anselin, L. Python Spatial Analysis Library [Computer Software]. (2015). Available at: https://github.com/pysal/pysal.
Turner, Doxa, O’Sullivan and Penn. From isovists to visibility graphs: a methodology for the analysis of architectural space. Environment and Planning B: Planning and Design 2001, volume 28, pages 103 — 121