TRIANGULAR MESH APPROACH FOR AUTOMATIC REPAIR OF MISSING SURFACES OF LOD2 BUILDING MODELS

3D city models are increasingly being used to represent the complexity of today’s urban areas, as they aid in understanding how different aspects of a city can function. For instance, several municipalities and governmental organisations have constructed their 3D city models for various purposes. These 3D models, which are normally complex and contain semantics information, have typically been used for visualisation and visual analysis purposes. However, most of the available 3D models open datasets contain many geometric and topological errors, e.g., missing surfaces (holes), self-intersecting surfaces, duplicate vertices, etc. These errors prevent the datasets from being used for advanced applications such as 3D spatial analysis which requires valid datasets and topology to calculate its volume, detect surface orientation, area calculation, etc. Therefore, certain repairs must be done before taking these models into actual applications, and hole-filling (of missing surfaces) is an important one among them. Several studies on the topic of automatic repair of the 3D model have been conducted by various researchers, with different approaches have been developed. Thus, this paper describes a triangular mesh approach for automatically repair invalid (missing surfaces) 3D building model (LOD2). The developed approach demonstrates an ability to repair missing surfaces (with holes) in a 3D building model by reconstructing geometries of the holes of the affected model. The repaired model is validated and produced a closed-two manifold model.


INTRODUCTION AND MOTIVATION
3D city models are increasingly being used to represent the complexity of today's urban areas, as they aid in understanding how different aspects of a city can function (Vitalis et al., 2019). For instance, several municipalities and governmental organisations have constructed 3D city models for various purposes, some of them have been reported in studies such as Singapore (NRF, 2018) (Gobeawan et al., 2018), Brisbane city in Australia (Alatalo et al., 2017), Vienna city in Austria (Agugiaro, 2016), Lyon city in France (Nouvel et al., 2015), Rotterdam city in the Netherlands (Boeters et al., 2015), New York City in the United States (Chaturvedi et al., 2015), Istanbul city in Turkey (Buyuksalih et al., 2013), Berlin city in Germany (Carrión et al, 2010), and Stuttgart city in Germany (Ewald & Coors, 2005). Semantically enriched 3D city models have the potential to be powerful hubs of integrated information for computer-based urban spatial analysis. The 3D city models, which contain 3D data of urban objects like buildings, roads, and waterways, may serve for various applications. Some notable applications are smart cities as reported by Ruohomäki et al., (2018) and Chaturvedi & Kolbe, (2016), noise propagation as studied by Lu, Becker, & Löwner, (2017), emergency response, solar power as reported by Biljecki et al., (2017), shadows cast as studied by Herbert & Chen, (2015), routing analysis as studied by Hildebrandt & Timm, (2014), change detection as studied by Sharkawi & Rahman, (2014), 3D cadastre as studied by Van Oosterom, (2013), facility management as studied by Zlatanova & Beetz, (2012), visibility analysis as studied by Yang, Putra, & Li, (2007), visualisation for navigation as studied by Musliman, Rahman, & Coors, (2006), communication of urban information as studied by Döllner, et al., (2006), and urban planning.
To allow for the development of advanced applications, a 3D city model should describe the geometry and attributes of all the individual elements that are typically present in a city. Therefore, 3D city models require a proper data standard for realising efficient 3D data analysis, management, interaction, visualisation, update, and storage. One of the main practices for storing and exchanging 3D city models is through CityGMLas an international standard established by OGC (Groger et al., 2012). CityGML is an open data model and XML-based data exchange format describing the most relevant urban and landscape objects along with their spatial and non-spatial attributes, relations, and their complex hierarchical structures in five levels of detail (LoD).
There is a huge concern for realising 3D city models to be fully implemented in the industrial area which is the issue in 3D data quality. As highlighted by Stoter et al. (2020) and Biljecki et al. (2019Biljecki et al. ( ), (2016, most of the available 3D city models open datasets contain many geometric and topological errors, e.g. duplicate vertices, missing surfaces, self-intersecting volumes, etc. For 3D models to be used as an input in most city simulation and modelling software, the models should be geometrically and topologically valid. Often, these errors are not visible at the scale on which the datasets are visualised, and some users are unaware of the issue due to the models appear to be valid in the software viewer. Therefore, the validation process means the need to check whether a given 3D primitive respects the standardised definitions ISO 19107 -an international standard of geometry data model. Biljecki et al. (2016) highlighted those common types of geometric errors are normally to be found in 3D models datasets (consist of 3.6M buildings), and most of the datasets are invalid and perfectly valid datasets are very rare to be found. Hence, validation of the 3D models geometry and the detection of the errors can be achieved through several tools such as Val3Dity (Biljecki et al., 2019), and CityDoctor (Wagner et al., 2013). These validators can validate CityGML datasets regarding their semantic and geometrical correctness or regarding their geometric-topological consistency. Figure 1 shows the types of geometries (primitives) used in 3D city models (CityGML). There are many different errors in 3D city models, of which some are common across multiple datasets. The common errors found in 3D data validation are geometries not properly snapped, invalid semantics, non-planarity, and invalid polygon orientation. For instance, a common cause for invalid solids geometries are gaps, the intersection between surfaces, degenerated edge and surface primitives, and non-manifold situations which result in a non-watertight solid. Thus, Stoter et al. 2020 stated that there is a need for implementing an automatic repair technique to handle these problems, and a 3D model should be validated and repaired before it can be further used (Ledoux, 2013, Biljecki et al. 2016).
3D repair has become an important topic in recent years because of the increasing availability of 3D city models worldwide. Therefore, this paper describes a triangular mesh approach for automatically repair invalid 3D models but focussing on the repairing LOD2 solid building model. The remainder part of the paper is structured as follows; Section 2 the related works, Section 3 the triangular mesh approach, and Section 4 Conclusion.

THE RELATED WORKS
The following sub-sections describe the major recent works in the 3D city modelling quality aspects, particularly on repairing and reconstructing an invalid 3D building model.

Local repair method
Among the earliest study in repairing 3D city models were investigated by Alam et al. (2014). He described a local method that checks and iterates through all polygons and solids for specific errors. The details explanation of the method is as followsif any defects are encountered, then local repair techniques are applied. For example, on the polygon level, the method is able to repair the problem of self-intersection and consecutive vertices. Furthermore, the method can repair the shell and solid with the multiple connected components, simple self-intersections (overlapping polygons), and face orientations. However, the method was unable to repair automatically the overused edges (i.e. edge bounding more than 2 faces) as shown in Figure 2.
(a) Self-intersections (b) Non-manifold vertex Figure 2. Some limitations of the detect and local repair method (Alam et al., 2014).

Voxelization of Polygonal Mesh
A voxel-based repair method takes a different approach to the polygonal model (e.g. as experimented by Alam et al., 2014), however, the voxel method can be considered as equivalent to the volumetric methods as described by Attene et al., (2013). In general, the voxel approach works as followsthe input of the 3D model converted into 3D binary grids by morphological operators and disregarding of inner shells to produce a manifold result. The following figure illustrates the voxelization of the 3D model. Figure 2. The voxelization repair concept for 3D building model (Mulder, 2015). Figure 3 shows another repair method called Shrink-wrapping as reported Zhao et al. (2013). The method is based on graph which applies a constrained tetrahedralization on all faces of the model and its convex hull. The method produces a volumetric representation that made up of polyhedron (i.e. a 3D shape with flat polygonal faces, straight edges and sharp corners). The method also utilizes a heuristic carving process for deleting unnecessary polyhedron from the model.

Shrink-wrapping Method
The Zhao et al., (2013) method able to effectively repair the gaps, self-intersections, and holes in the LoD2 CityGML datasets. The resulting repair technique produces some unwanted shapes as illustrate in Figure 13. In addition, the Shrink-wrapping method is sensitive to floating point arithmetic. The rounding of point precision may result in triangles being decomposed into edges or vertices, makes the building model invalid. Finally, the occurrence of overlaps in the input model may produce small errors. The Shrink-wrapping method for automatic repair of invalid 3D models has some advantages -the surface semantics remains intact and maintains the original geometry of the input 3D models. Figure 3. Illustration of the Shrink-wrapping method (Zhao et al. 2013).

Summary of the related works
In addition to these existing repair methods and algorithms, most of the contemporary 3D model repair research and development has been focusing on the repairing of generic 3D models (LoD2), common geometric errors (gaps, consecutive points, self-intersection, non-manifold edges, semantic attributes preservation, tilted surface, etc.), and volume-based models. Although, these approaches are important, as they provide solution to automatically fix most of the geometric errors found in 3D city models. However, the capability of the existing repair methods for 3D buildings models are still limited to be recognise as a general solution. Therefore, there is a need to conduct, at an advanced level, a systematic study to improve the repair algorithms of 3D models by developing a repair framework for more complex structure such as LoD3 (with windows and doors) and also indoor components. However, this paper initially describes the experiment on the repairing technique -triangular approach for missing surfaces.

THE TRIANGULAR MESH APPROACH
Triangular meshes are used widely to represent an object in 3D modelling. A triangle mesh is a type of polygon mesh comprises a set of triangles (typically in three dimensions) that are connected by their common edges. It is a collection of cells: vertices, edges, and triangles. Each edge is the line segment between 2 vertices and is relatively open. The 3D building model (see Figure 4) normally stored as a polyhedron (a threedimensional shape with flat polygonal faces). In order to carry out a repairing process, the target model must be converted into 3D triangular mesh.

Validate 3D Model
Geometry of the 3D model need to be validated to check whether it respects the standardised definitions (ISO 19107 -International standard of geometry data model). For instance, existence of holes and non-watertight boundary in the model. The val3dity tool (Ledoux, 2019) was used to perform the validation on the data model. The tool is an open-source software to validate 3D primitives according to the international standard and outputs a report that identify the errors as shown in Figure 5 below. Figure 5. Report of geometry validation shows an error existed in the model.
Based on the validation report obtained, it is shows that the model has geometric error which is due to the existing holes in the model. Figure 6 shows several locations of the errors due to missing surfaces which create the holes in the model.

Fixing the Geometry
In the triangle-based approaches, the holes are patched by dealing with the triangles directly. Holes with regular boundary over a relatively planar region can be patched via planar The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLVI-4/W3-2021 Joint International Conference Geospatial Asia-Europe 2021 and GeoAdvances 2021, 5-6 October 2021, online triangulation. Figure 7 shows the algorithm developed based on triangulation method for repairing 3D model due to the holes error (missing surfaces).

Algorithm: Triangulation of polygon
Step 1: Read surfaces of 3D model Step 2: Access vertices (v) of the surface Step 3: Calculate number of triangles △total can be formed: △total = total_vertices -2 Step 4: Connecting the vertices: where, n is the number of triangles formed.
Step 5: Loop Step 4 until n == △total Step 6: Goto Step 2 for another surface Figure 7. Triangulation technique to repair holes in 3D model.
In the repairing process, geometrically invalid data is identified, and the algorithm is used to cover the hole with newly created triangles. Then new model can be regenerated so that is it in closed-two manifold condition. Euler's formula for triangulation is used to calculate and detect any non-manifold model. The formula is derived as:

T−E+V=2, for a simple closed surface
Where, T triangles, E edges and V vertices.
Next, we need to detect the holes in the triangular mesh model. Since a vertex-based data structure is used in this work, all boundary vertices can be identified by checking the numbers of their triangles and edges. For example, if the two numbers of a vertex are not equal, the vertex is a boundary vertex. In the triangle-based approaches, the holes can be patched by dealing with the triangles directly. Holes with regular boundary over a relatively planar region can be patched via planar triangulation:

v[n+1] and v[n+2]
Where, v is the vertices, and n is the current number of triangles formed.
After the model is repaired, it will then re-validate to confirm the error is removed and watertight model is obtained. Figure 8 shows the outcome of the implemented repair method, after revalidate the model, there is no error exists, and the watertight solid model is obtained.

CONCLUSION
In this paper, we proposed a triangular mesh repair algorithm for filling holes (missing surfaces) in 3D building model. The outcome shows that, the repaired model demonstrate new surfaces are added to cover the holes. After re-validate the model, report from the val3dity tool shows that no error detected, and watertight model was obtained. The work from this paper is our initial outcome for the development of automatic repair method for 3D city model. As discussed in the Section 2, most of the existing repair methods and research has been focusing on repairing generic 3D solid models, and common geometric errors (gaps, consecutive points, selfintersection, non-manifold edges, semantic attributes preservation, tilted surface, etc.). Although, these approaches are important, as they provide solution to fix some geometric errors found in 3D city models. However, the capability of the existing repair methods for 3D building model are still limited (indoor and complex structures) and require more studies to produce a complete repair solution which is our future work.