A SCAN-TO-BIM WORKFLOW PROPOSAL FOR CULTURAL HERITAGE. AUTOMATIC POINT CLOUD SEGMENTATION AND PARAMETRIC-ADAPTIVE MODELLING OF VAULTED SYSTEMS

: Cultural Heritage has been significantly impacted by advancements in the Information and Communications Technology domains, which have inspired a strong multidisciplinary interest and enabled the development of innovative strategies for the preservation, management, and enhancement of the heritage itself. Notably, the digitisation process, which entails the acquisition of 3D data obtained through cutting-edge LiDAR and photogrammetric scanning techniques, is set up as an advantageous tool for producing an accurate representation of the historical buildings. In addition, point clouds and reliable HBIM models have caught the minds of the architectural community, and are now receiving huge backing from Artificial Intelligence. Such support is provided by procedures that link semantic features to structural and decorative elements. In this scenario, the following research is presented: the aim is to test an automated iterative process within a scan-to-BIM methodology, starting from automatic point cloud segmentation operations with open-source, model-fitting algorithms. This method will prove to be a solid support for the final phase of the 3D parametric/adaptive reconstruction that’s also compatible with BIM Authoring. The study focuses on various masonry vaulted systems. These types of structures are first examined using ideal models, which were perfectly discretised and set up by the user, and then employed as a starting point for validating the parameters of the RANSAC algorithm on point clouds acquired by laser scanners. These latter ones nevertheless have irregular geometries, making comprehension, analysis, and management far more challenging.


INTRODUCTION AND STATE OF THE ART
The application of digital models and point clouds has changed significantly over the past few years thanks to advancements in the field of Information and Communication Technology (ICT) regarding 3D data acquisition and management techniques (El-Din Fawzy, 2019;Remondino, 2011). Particularly, the development of LiDAR technology has led to sensors that are increasingly sophisticated and sensitive, enhanced data processing algorithms that can produce accurate and detailed numeric results, and improved access for businesses and professionals (Vatan et al., 2009;Wang et al., 2020). Furthermore, Structure from Motion (SfM) (Aicardi et al., 2018;Willis et al., 2016) redefined the field of Close-Range Photogrammetry (CRP) by creating 3D objects relying on modern image-processing techniques and portable, efficient digital cameras. There is a noteworthy use of these frequently integrated techniques and technologies (Aterini & Giuricin, 2020;Russo & Manferdini, 2014): this is seen in the field of Cultural Heritage (CH), where 3D models allow for the description, preservation and reproduction of historical and artistic objects (Balzani et al., 2017), enabling for a more accessible sharing of knowledge (Di Giulio et al., 2017;Yang et al., 2022); or even in the field of Architecture, Engineering, and Construction (AEC), where it may be applied to enhance planning, so as to spot issues ex ante with the very construction, thus increasing efficiency and cutting costs. The Scan to BIM methodology (Badenko et al., 2019;Rocha et al., 2020), i.e. the method that uses scanned point clouds of the existing building to capture information and form the metric basis for the development of a BIM and HBIM (Heritage Building * Corresponding author Information Modelling) model, has taken on an essential role (Antón et al., 2018;Hichri et al., 2013). Over time, the Level of Development (LOD) of a BIM modelwich has been defined in accordance with a selection of international standards (BIMForum & American Institute of Architects, 2019; The American Institute of Architecture, 2013) -has emerged as a key concept, particularly helpful for evaluating the quality and quantity of data entered into an architectural model during its development phases, with special attention to the Level of Information (LOI) and the Level of Geometry (LOG). Recently, there has been an increase in demand for rapid, automated solutions which may manage, optimise, and provide semantic information to point clouds for usage in HBIM (Croce et al., 2021;Macher et al., 2015). The accuracy and effectiveness of creating digital models are significantly enhanced by adding information to the point clouds, for as by identifying objects and their attributes. The segmentation and classification of 2D and 3D data is made achievable by Artificial Intelligence subsets, such as Machine Learning (Grilli & Remondino, 2019) and Deep Learning (Malinverni et al., 2019) performed in the CH environment, based on well-prepared training datasets. Several segmentation techniques are based on many principles, including discontinuity (edge-based), similarity of neighbouring points (region-growing), and attributes (attribute-based) (Xie et al., 2020) and so on. Additionally, there are mathematical modelfitting algorithms like the RANdom SAmple Consensus (RANSAC), which enables iteratively grouping points into primitive geometric shapes like the plane, cone, sphere, and cylinder (Schnabel et al., 2007).
The manual or automatic segmentation of point clouds can be applied to the analysis of vaulted masonry structures (Angjeliu et al., 2019;Lanzara et al., 2019), as also shown in this work, in order to separate and regionalise the points connected to the vault from the supports and piers on which it rests. As a result, an accurate representation of the structural geometry is generated, which allows for the enhancement of forthcoming modelling processes (Capone & Lanzara, 2019;Santagati, 2005).

METHODOLOGY
In order to test an automated process within a scan-to-BIM workflow, this research begins with a thorough analysis of the geometric genesis concerning specific types of vaulted structures as point clouds ( Figure 1). The non-deterministic RANSAC algorithm, implemented in the open-source software CloudCompare, was employed to carry out an automatic segmentation approach. The workflow involved computing point datasets gathered from the discretisation of regular surfaces (plane, spherical, cylindrical) referred to vaulting models (Rondelet, 1832;Saccardi, 2004;Zaccaria, 1983), and then applying those results to LiDAR point clouds with a comparable geometrical configuration. The study assessed the validation of the results as well as the creation of 3D models using open approaches, which encourage software interoperability, and BIM Authoring, which ensures better consistency and control despite data sharing.

Segmentation process
Seven different types of simple and composite masonry vaults, including the sail, the barrel, the barrel with lunettes, the trought, the mirror, the groin, and the hemispherical dome, the latter resting on drum and pendentives, are examined. The segmentation process involved a preliminary evaluation and adaptation of the RANSAC algorithm's parameters on the intrados surface of geometric models classified as "ideals" because they exhibit a perfectly regular and discretised shape. These models were generated in the CAD environment by first creating surfaces using the B-Rep (Boundary Representation) modelling, then they were converted into a point cloud with a point spacing of 0.001 m. The algorithm calculates a probabilistic and recursive estimation of inliers -from a dataset that also contains outliers, or points that are not included in the geometric model under consideration -which are collected in predefined subsets (minimal sets) whose distribution can be essentially traced back to a model of available geometric primitives. Testing the "ideal" models provided the values for the algorithm variables, which were then applied to clusters of points from LiDAR scans (achieved using FARO® Focus 3D 120), and thereby subsampled at 0.001 m ( Figure 2): i) Minimum support points per primitive, i.e. the number of point samples that controls the density and size of the inliers cluster. For each selected primitive, the value is inversely correlated with the number of point groups used to sample it. The threshold value below which the algorithm improperly distinguishes different primitive surfaces for the same geometry was found through experimental analysis. This value, which ranges between 0.4% and 2%, is directly proportional to the number of points in the dataset; ii) ε, i.e. the maximum distance value between points and primitive shape. The experimental value, ranging from 0.001 to 0.03, was assessed to determine the presence of ribs and groins, domes, pendentives, drums, and other typical geometric components. Due to the geometric discontinuity in LiDAR point clouds, this value was increased while still allowing the primitives to be completely fitted to the ideal point cloud; iii) α, i.e. the maximum angular deviation between the points' normal and the normal of the primitive surface. In relation to the chosen primitives, the parameter value enables the identification of inliers or outliers.
The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLVIII-M-2-2023 29th CIPA Symposium "Documenting, Understanding, Preserving Cultural Heritage: Humanities and Digital Technologies for Shaping the Future", 25-30 June 2023, Florence, Italy The threshold, which is here defined as 25°, is usually determined empirically based on the noise of the point cloud; iv) β, sampling resolution, i.e. the distance between neighbouring points: the experimental value ranges from 0.060 to 0.100. For irregularly sampled data, the value of this parameter can usually be reduced; v) overlooking probability, i.e. the probability that no better candidate is overlooked during sampling, resulting in an appropriate number of inliers for each primitive. A low experimental value of 0.010 was used in order to increase the result's reliability and determinacy; vi) r, i.e. the radius size of primitive shapes such as sphere and cylinder, according to the dimensions of the geometric surfaces' generatrices: sail) 1. radius of the hemispherical intrados surface (vault); barrel) 2. generatrix radius of the semi-cylindrical intrados surface (vault); ( lunette) 3. generatrix radius of the semi-cylindrical intrados surface (lunette) -4. generatrix radius of the semi-cylindrical intrados surface (barrel); trought) 5. generatrix radius of the semi-cylindrical intrados surface (pavilion) -6. generatrix radius of the semicylindrical intrados surface (barrel); mirror) 7. generatrix radius of the semi-cylindrical intrados surface (pavilion) -8. generatrix radius of the semicylindrical intrados surface (barrel); groin) 9. generatrix radius of the semi-cylindrical intrados surface (groin); dome) 10. radius of the hemispherical intrados surface (dome) -11. radius of the hemispherical intrados surface (pendentive) -12. generatrix radius of the semi-cylindrical surface (drum).
On both ideal and realistic models, Figure 3

3D Modelling
It was crucial to define an initial approach to geometric modelling based on Non-Uniform Rational B-Splines (NURBS) generators and polygonal directrices that geometrically define and delimit the analysed surfaces in order to make the segmentation procedures compatible with the pertinent encodings in open formats. The semi-automated 3D reconstruction found specific section planes related to the geometric genesis of the vaulted structures in the segmented clusters of the point cloud.
The interpolation of the points located on these planes was created using the CloudCompare software, considering an offset extension of 0,03 m. This operation was carried out using the concave hull clustering algorithm, which considered the starting point clouds' resolution and a grid with a pitch of 0,02 m ( Figure  4). Any possible anomalies caused by noise or interference in the point cloud were eliminated from the resulting polylines by decimation and vertex segmentation processes.
The profiles were obtained and integrated with multiple NURBS generators using CINEMA 4D by the MAXON software, while parameterising the UV subdivision for regular topological structuring (Figure 5a). The model was transformed from its basic 3D geometry using the BIM authoring tool Autodesk Revit, which allowed the association of polygonal surfaces with BIM elements (in this case, roofs) and the connection to management data and parameters (Figure 5b). Testing a second modelling approach, for each type of vaulted structure a generic adaptive metric model (.rfa family) was created using only Revit: this one thus could adapt to the uneven geometric properties of the scanned point clouds. The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLVIII-M-2-2023 29th CIPA Symposium "Documenting, Understanding, Preserving Cultural Heritage: Humanities and Digital Technologies for Shaping the Future", 25-30 June 2023, Florence, Italy As for the flexible components, adaptive shape handle points were created and linked to each other by splines and/or reference lines, so as to define the geometry (void or solid) -related to the type of vaulted structure -which needs to be adapted to the point cloud ( Figure 6). The distance relationships (height and overhang) between the points and the reference planes, plus the radius of the generating arches were all calculated based on the parameters and constraints that were set up for each model. Going into more detail, by creating a parameterisable geometric void to which the roof element was associated, it was possible to create the height parameters for the rises of the arches and the middle end point of the hemispherical structure, belonging to the sail vault (Figure 7a). Only the heights connected to the rises of the two generating arches that make up the semi-cylindrical structure were created for the barrel vault (Figure 7b). In order to build the lunette vault, other semi-cylinders were intersected with it using smaller but identically parameterised heights, similar to the individual lunettes ( Figure 7c). Contrary to conventional practice, the horizontal section plane was removed so as to generate the trought vault (Figure 7d) on the basis of the mirror vault model (Figure 7e). As for the latter, the radius parameter was bound to the apex height and span parameters in relation to the lowered pavilions, as shown in the equation below: Then, as for the groin vault, in addition to the heights related to the rises of the groins' generating arches, distance offset parameters at the wall arches were defined (Figure 7f). To conclude, as for the hemispherical dome, specific parameters relating to the heights of the pendentives, drum, and dome itself were set up, placing multiple adaptive points for adapting the model to the irregularities of the scanned surface (Figure 7g). Figure 7. Parametric adaptive families for the BIM models.

RESULTS
In the case of ideal models of vaulted structures, very accurate results were found by carefully selecting the specific values of the algorithm parameters, the type of primitive, and its geometric dimensions. When the algorithm was applied to LiDAR point clouds, some critical issues occurred regarding the extraction of shapes that did not exactly fit the pre-selected set of primitives. Hence, the parameter ε of the real structures was decided to be increased, in order to make up for their geometric irregularities: by doing so, a wider range of distances between the inliers, belonging to the primitives themselves, was obtained. The regions of points that were segmented automatically and correspond to the components of the real vaults were compared with the related ground truths that were manually segmented, taking into consideration the number of selected points ( Figure  8). The most significant flaws on real models may be seen in the dome pendentives (Figure 9), which are not exactly spherical and uniform, as well as in the barrel vault lunettes, ribs, and groins. Due to simple and complete geometric configuration, the cylindrical shape of the barrel vault and the spherical one of the sail vault, as well as the plane of the mirror vault appear to have a better identification. However, the results can be considered useful for subsequent digital modelling stages. In this regard, the geometric reconstruction process in open-mode provided a great topological mesh control, thus enabling an accurate UV mapping of the surfaces and a customisable polygonal resolution. The conversion of the 3D geometry within the BIM authoring software -along with the flexibility in choosing the software tools utilised, which prevented any sort of incompatibility between them -enabled the connection of information and management parameters. Through the creation of adaptive parametric families, the second approach to the BIM Authoring modelling allowed for more effective work and the creation of highly customised architectural elements, with higher flexibility than standard system families. The adaptive points and the control of parameters and constraints allowed a precise positioning of the families for the different configurations of the structures, thus saving time and increasing design efficiency. Through an analytical comparison with the point cloud, the geometric coherence of these reconstructions was verified. This revealed a few minor discrepancies (mostly within 0.06 m), which were caused by the typical irregularities of the detected intrados of the real vault and are consistent with the representative limits imposed by the BIM-oriented geometric nurbs regularity (Figure 10).  With the second modelling approach, greater discrepancies were discovered for some vault types, especially about the trought vault (average distance value of 0.07 m) and in the case of the dome, notably at the spherical pendentives (average distance value of 0.08 m) ( Figure 11).

CONCLUSIONS
A valuable technique for gathering geometrical and informative data, point cloud segmentation in the AEC and CH fields provides an accurate architectural sematisation, utilised for 3D reconstruction through procedures that may be integrated into BIM models. The advantages of automated segmentation over manual processes include faster processing times when dealing with huge amounts of data and an accurate repeatability, even for extremely complex shapes that can be challenging to segment manually. Nevertheless, automatisms require the algorithms to be calibrated in order to produce more trustworthy outcomes. In this work, the RANSAC method showed to be particularly effective for properly discretised ideal models, and even in the presence of irregular, noisy point clouds, it was still able to produce encouraging results. The meticulous selection of the parameters relied on an in-depth study of the geometric genesis and graphical representation of the elements under analysis, and it will be the focus of further research with reference to several types of vaulted structures, always in relation with the proper BIM models.