FROM POINT CLOUDS TO ARCHITECTURAL MODELS: ALGORITHMS FOR SHAPE RECONSTRUCTION.

: The use of terrestrial laser scanners in architectural survey applications has become more and more common. Row data complexity, as given by scanner restitution, leads to several problems about design and 3D-modelling starting from Point Clouds. In this context we present a study on architectural sections and mathematical algorithms for their shape reconstruction, according to known or definite geometrical rules, focusing on shapes of different complexity. Each step of the semi-automatic algorithm has been developed using Mathematica software and CAD, integrating both programs in order to reconstruct a geometrical CAD model of the object. Our study is motivated by the fact that, for architectural survey, most of three dimensional modelling procedures concerning point clouds produce superabundant, but often unnecessary, information and are also very expensive in terms of cpu time using more and more sophisticated hardware and software. On the contrary, it's important to simplify/decimate the point cloud in order to recognize a particular form out of some definite geometric/architectonic shapes. Such a process consists of several steps: first the definition of plane sections and characterization of their architecture; secondly the construction of a continuous plane curve depending on some parameters. In the third step we allow the selection on the curve of some nodal points with given specific characteristics (symmetry, tangency conditions, shadowing exclusion, corners, … ). The fourth and last step is the construction of a best shape defined by the comparison with an abacus of known geometrical elements, such as moulding profiles, leading to a precise architectonical section. The algorithms have been developed and tested in very different situations and are presented in a case study of complex geometries such as some mouldings profiles in the Church of San Carlo alle Quattro Fontane.


THE 3D SURVEY
More and more powerful modern technologies and computer tools, in addition to increasingly more advanced and complex software, have made it possible to move forward in the automation of procedures and rapidity and simplicity of architectural survey operations.The so called 3D Survey, aimed at creating rendering models which are very close to the real ones, both in the three-dimensional form and in their visual and surface aspect, is set in this context (Remondino, 2011).Surveying techniques applied to the 3D survey call for the use of indirect methodologies, of range based type (topographic survey and through laser scanner) and image based type (conventional and non-conventional photogrammetric survey), combined with each other, and of direct methodologies of measurement in detail according to the survey traditional methods.These procedures consist of two different phases: survey and data capture phase and rendering and data processing phase.In the first phase different survey methods, topographic, photogrammetric and laser scanner tools, are used according to specific methodologies which call for a phase of setting of the survey making a both general and specific project, locating targets for georeferencing, placing the different measurement stations and connecting them together, capturing the different types of data, topographic points, photos, laser scans, direct measurements of each detail.The second phase calls for some data capture, necessary to obtain the rendering of a three-dimensional georeferenced model of the measured object, according to a series of steps which call for the alignment, overlapping and comparison among the measured points clouds, their noise reduction and simplification, the following definition of a triangulated mesh from the clouds, the mesh simplification, integration and completion and finally its mapping through high-definition images (see Figure 2).Although this process is very complex, it requires several specific skills, it is commonly adopted in survey operations by now, whether it be a very complex and big architectural monument or a smaller building.Which are the rendered object characteristics which can be obtained from a 3D survey?Some of its positive aspects are: first of all, the opportunity to extract metric dimensional information in every phase of the process, with absolute precision in the order of centimeter, if not of millimeter; the surface description through a triangulated mesh with a high-definition mapping, that would seem acceptable, to a first approximation; accessibility and usability; the possibility of extracting further specific piece of graphic drawings in a short while.Some of the negative aspects are: the uniformity and uniqueness of the model, which is not defined by single elements; the error and shift compared to the real model, due to the presence of noise on the datum and of gaps in the not accessible parts; the model complexity, such that different procedures and complex processing are required; the different accuracy of measures as distance changes; the approximation of the rendered from survey model compared to the real one.The whole process is characterized by some crucial steps, which concern both the cloud and the mesh processing and which qualify the survey and the consequent rendering.
The key elements of the procedures related to point clouds are: the points correspondence, the cloud alignment, the noise reduction, the detection of the best points.The basic elements for the definition of the mesh are: the mesh/object correspondence, the integration between image based mesh and range based mesh, the spike removal, the mesh simplification, the best shape detection, the texture projection on the mesh and the correspondence between texture and real model.
On the basis of these considerations, the fields where it is possible to optimize the whole process, improving the survey quality and the correspondence between rendered and real models and minimizing processing time and regular errors, are: point cloud noise reduction, the best shape detection and, above all, the phase which concerns the mesh definition, which isn't suitable for the architecture description, but for localized free form parts (decorations, plastic or sculptural elements etc.).
In the specific case of the architectural survey, the rendering model has to achieve two main purposes: the first one concerns the measurement of all the elements, i.e. the quantification of dimensional information, from general to specific, and the second one concerning the representation, i.e. the graphic description of the building characteristics according to universally recognizable architectural elements.To achieve these goals we have used a model, commonly defined as knowledge based model (Drap, et al., 2003;De Luca, et al., 2006), that replaces the triangulated mesh model in the case of architectural survey.

ARCHITECTURAL SECTIONS
The survey of an architectural building is, ultimately, an act of knowledge, so it is part of a complex and wider process of analysis and study (Docci, Maestri, 2009).Therefore, it is, clearly, fundamental to have an accurate knowledge based model of the building acquired trough archive sources, and awareness of the existence of multiple factors which influence the reading of collected data (peculiarity of materials, characteristics of implementation, different levels of decay, restoration works, etc.).
The working method we propose uses sections as main elements for the development of the model.An architectural section linked to the related extrusion path makes it possible, in theory, to build a three-dimensional model of any element, once its geometric characteristics are known.Consequently, from a model built this way, it is possible to extract sections along the different planes which describe the real object in his dimensional, formal and geometric characteristics.
In the framework of the different phases which organize and give substance to the survey, this test aims at verifying the actual potentialities of the used method applying it to the study of an architectural building whose interpretation is very complex: the Chiesa di San Carlo alle Quattro Fontane in Rome, by Francesco Borromini, and which had been already extensively studied (Canciani, et al, 2012).
The main purpose of our work was to verify the possibility of obtaining, through the application of processes described in the following paragraphs, sections which can be linked to the real shape of the surveyed elements, using the study of the architectural details as a starting point.
In the case in point, the main difficulty to define a vertical section is constituted by the peculiarity of the mouldings created by Borromini, who detaches himself from the sixteenthcentury treaties modifying geometries, profiles, combinations and proportional ratios of the single elements (Bösel, 2000;Milizia, 1781;Maestri, 2006;Portoghesi, 2001).So, it became essential to study, preliminarily, some detail drawings made by Borromini (in particular some of those kept in the Albertina in Vienna), like the Azr203, in which there are some unusual profiles (Azr 1268v) obtained connecting each other, without interruption, classic style mouldings (for example a cyma moulding and a scotia) or sinuous curves, plastically modeled, followed by real intaglios which fragment and multiply edges.
In these circumstances, the interpretation of data obtained firstly from the point cloud sections becomes more complex for two reasons: 1) for the presence of noise areas inside the cloud, due to the impossibility of surveying the most marked grooves or to errors which occur in the presence of the most fragmented corners; 2) because both the type of usable mouldings and the possibility of connecting them according to different proportional ratios are wider.In similar circumstances, it seems to be difficult to create a library of preconceived theoretical models, which can be defined simply exhaustive, tested in other case studies (De Luca, et al., 2006;Trevisan, 2005).

Related works
Point clouds study aimed at getting continuous and geometrically defined (parameterizable) sections set up problems which are commonly found in many applications.
Computer graphics and mathematics give some answers to the questions arising from reverse engineering and architectural survey (with the consequent questions about representation).Many different methods have been proposed over the years.
Here we briefly describe only some of the most relevant ones for our work.
In order to ease their reading they have been divided in three macro categories: Point clouds sections, 2D shape recognition and 3D shape recognition.

Point clouds sections:
Among the commercial software programs which have been tested (CloudWorks for Autocad, Geomagic, Rhinoceros and LupoScan) only some of them have a function that, given a plane of section, automatically gets a curve (Nurbs or polyline made of arcs and lines) with the minimal requirement of continuity (by the way, in many cases this fundamental condition is not satisfied).In some cases the positive conclusion of the process depends on point cloud size or otherwise on the possibility of setting parameters to determine whether the curve will be a Nurbs or made of lines or circular arcs.
In general, any software has positive and negative aspects, without however definitively solving the problem.
Other studies introduce interesting elements, such as for example the analysis of the "mean section" or the possibility of inserting units of measurement different from those of the decimal metric system (foot, palm, etc.) (Trevisan, 2005).Software programs arised from these studies work directly in CAD environment, or as plug-ins, but they require manual design of the section and rarely produce a best fit between points and the designed curve.In other cases there is a limit for the size of a point clouds to be imported, but one of the most common problems is related to the fact that the generating parameters of the section are uniformly applied to the entire section.In practice, in order to define line segments more coherent with the scanned object, the tolerance among segments has to be increased.This process involves the loss of important informations on details, particularly in the presencs of mouldings.In almost all tested software programs the parameters used to define the line section are: • Thickness, to define a volume around the plane where points are selected and possibly projected on the plane; • Tolerance, to control noise and alignment problems of different point clouds; • Length, minimal measure of the constructed segments; • Distance, minimal among the selected points.
Many studies deal with this subject.In some cases (Wu, et al., 2004) the construction of a three-dimensional model rely on a sequence of many nearby sections.The same method is applyed to mechanical or freeform objects (Kyriazis, et al., 2007;Protopsaltis, et al., 2010) with the goal of representing a generic shape, in the best possible way.The result is achieved with the use of different procedures such as the definition of the Convex Hull or the application of Voronoi diagram for the definition of concave parts.In most cases, the generated curves are B-spline of degree 3, because they are the closest to the representation of a freeform object and the simplest to compute.Nevertheless, the use of Bspline in the field of architectural survey is not the most appropriate.In fact, except for some frieze or sculpted groups, the requested section will be made, usually, by line segments and/or circular arcs.
3.1.22D shape recognition: some software programs, commonly used in architecture, have builted-in functions to recognise stright lines, circles, rectangles and/or squares and they can be applied both to point clouds and triangular mesh.The development processes of these shapes are however only partially automatic and the recognized shapes are much limited.The studies presented below, on the contrary, allow recognition of any 2D shape, also with very difficult conditions.The characteristic of these studies is that they were originated mainly for raster images analysis, are based on probabilistic analysis and are used to deal with reverse engineering problems.Generally, such studies have not been dedicated specifically to architecture and they don't consider its specific characteristic but they offer interesting procedural ideas.
In particular, for the present work, we have considered the procedure "recover and select" (Benko, et al., 2001;Leonardis, et al., 1997) and the use of circle written in Pratt's form (writing any segment as a circle and approximating a stright line with very large radius circle) (Pratt, 1987).
3.1.33D shape recognition: most of the studies and software programs commercially available on the identification of 3D shapes for applications in the reverse engineering and industrial sites survey field.In these cases the possibility of identifying automatically pipes, elbows, flanges, valves, reducers, tees and more, makes work very expeditious.A lot of these software programs identify elementary surfaces such as spheres, planes, cylinders and some of them are able to reconstruct objects dividing them in several parts.In the case of architectural buildings, problems are deeply different and these tools are not completely adequate.
Studies which deal with specifically to the cultural heritage are divided into two "families".The first one focuses on the decomposition of complex geometrical shapes in simpler and simpler shapes.In particular, in some cases (Schnabel, et al., 2007) the RANSAC (RANdom SAmple Consensus) method is applied searching for general geometric shapes, planes, spheres, cylinders, cones and tori, assigning a score based on the quality of the obtained surface.In other cases (Schnabel, et al., 2008) a topology graph that describes the neighborhood relations among the primitive shapes detected in the point-cloud data adds to the randomized research.The typology graph makes it possible to create a net of objects to which it is possible to assign some characteristics.The other family of studies, in which our work is included, concerns "Knowledge Based" or "HBIM" models.

The proposed procedure
In architectural survey methodologies (and not only that) it is common to adopt, by now, an approach based on the use of an expert system, that is a system formed by two components: a structured complex of knowledge based models, describing the morphological features of an object through geometrically constructed two/three-dimensional models, and a set of rules which describe the knowledge based model topological (reciprocal positioning, alignment on horizontal or given axis, etc.) and semantic (relationship among its parts, proportionment, etc.) features.We can cite, in the field of archeological survey, the method proposed by Drap, Senturier and Long (Drap, et al., 2003) for amphorae survey, defined by pre-established three-dimensional models; for architectural survey an interesting method is the one proposed by De Luca (De Luca, 2011), based on a semantic model structured on architectural orders, as the one that makes use of HBIM system (Murphy, et al., 2012), based on libraries of objects defined by historical and documentary investigation.In this context is placed the method based on an expert system proposed for the study of standardized elements such as Polonceau trusses (Canciani, 2005) is placed in this context.On the basis of the cited experiences and of some test made in the context of architectural survey, our procedure provides for the use of an expert system, where any single element is defined by the section and the extrusion path, as already mentioned in par.2.The method follows, for each analysed element, the following pipeline: 1) capture of the survey model (only entered point clouds); 2) filtering of the cloud, noise reduction, cloud alignment, definition of best points; 3) definition of constitutive elements ( e. g. pedestal, column and entablature), and of the sub-elements linked to them (base, shaft, capital); 4) description of every element according to geometric, topographic and proportional characteristics; 5) definition of the best section, and of the best path, explained below, using directly the point cloud; 6) comparison between sections of survey model and knowledge based model (see Figure.9); 7) construction of the 3D model related to the single element, using the knowledge based section, adapted to the best section, with the best path; 8) comparison between the final geometric model (restitution model) and the model constituted only by the point cloud (point survey model), to verify missing elements, damages, deformities compared to the hypothetical original configuration.This procedure makes it possible, substantially, to simplify, decisively, the definition process of the rendering model, avoiding the development of the triangulated mesh (which isn't calculated), to maintain, in any case, the measurability and representativeness characteristics of the rendered object, and, to describe this object through a hierarchical system structured according to single elements, to which a data information base can be linked.

Algorithms
The point cloud processing is done using Wolfram Mathematica software: data are first imported as text files of spatial coordinates, processed to get section curves, with marked relevant points, and then exported in .dxfformat to be used in rendering programs.
We used two different methods: • Choose the best section plane (automatically testing many different sections to reduce noise, maximize the number of relevant points or selecting a mean section).Select the set S of points at distance less than d from the plane, fixing d so that their projection on the plane has sufficiently high density.Determine a subset of ordered points of S which define a polyline that fits the points of S. Finally regularize the polyline to reduce the number of segments detecting straight lines, circular arcs and angular points (see Figure 9).• Choose the best section vertical plane and fix a stright line r on it.Select the set S of points in the spherical wedge centered at θ 0 and amplitude Δθ.To get the section curve fix a point C on r and consider the volumes V(θ 0 ,φ 0 ) in R 3 spanned by the solid angles with vertex in C, that is V(θ 0 ,φ 0 ) ≡ {P θ,φ : |θ -θ 0 |< θ inc , |φ -φ 0 |< φ inc } at fixed steps Δθ =2θ inc and Δφ =2φ inc .We then take the barycenter Q among the points of V(θ 0 ,φ 0 ) and project it to the plane of section.Differently from previous method, the problem remains three-dimensional.
In both cases the end points of the polyline are found thinking of the polar equation of a planar curve: taking the mean value for Q(φ) at an increasing angle with respect to a fixed pole C. Note that the selection of C is automatic, but results could depend substantially on the choice of this and other parameters.
In the case study of the dome, sections are vertical so we take r passing by the cloud barycenter and point C on r with height h = 1.6m (laser scanner) or h=16m (second level of coffers).
In the case study of the columns, sections are still vertical but we take the pole C sufficiently far from the column and at an intermediate height.In the second method, P lies inside V(θ 0 ,φ) in spherical coordinates if x, y, z = coordinates of (P-C) φ = polar angle with respect to C and then evaluate the barycenters Q(φ 0 ), varying φ 0 , of points inside V(θ 0 ,φ 0 ) and project them as on the plane of sections given by θ 0 .
To detect longer straight line elements we evaluate the normals n i of any consecutive pair of points P i and P i+1 on the ordered set of the polyline section and discard points P i for which the inclination between n i and n i+1 is smaller than a given error.

Column base
In order to test the effectiveness of the method, it was firstly applied to one of the coloumn bases which articulate the inner space of the church, in order to compare a series of sections obtained from the point cloud with the profile surveyed directly through a profilograph.In brief our work aimed at obtaining a knowledge section, from the direct survey, in order to compare it to the best section get from the point cloud according to the procedures described in the previous paragraphs.Therefore, every moulding was detected on the profile obtained from the direct survey through discontinuity nodes and it was classified, to a first approximation, according to two criteria: curvilinear mouldings, with or without inflection (o flex), and rectilinear mouldings.A detail analysis of the single elements, in order to define the geometric characteristics, followed.
A first sequence of mouldings, from the imoscapo down, which can be connected to classic-type geometries, emerged: upper Torus, Fillet, upper Scotia, Fillet Tondino Fillet, followed by a lower Scotia (which is, here, higher and less curved compared to classic models) which is linked without Fillet to the lower Torus, so, drawing a continuous curve.
The following step consisted in verifying proportional ratios among the analyzed elements, whose result showed a remarkable variation in the proportional ratio between the upper Torus and the sequence Fillet -Tondino -Fillet, which instead of the usual 3 to 1, have, here, the same height.Therefore, on the drawing obtained by the profilograph, in addition to the detection of contact nodes among the single mouldings, characterized by variation of the normals, maximum depth or overhang points (in case of respectively concave and convex mouldings) and flex points (in case of more complex mouldings) were determined.The comparison between the Knowledge section and the best section implies the detection of all the listed elements also on the latter (see Figure . 9).The individuation of the range in which the variation of the tangent to the normal occurs, for each molding, delimits the possibilities of geometric determination of the profile, which can be obtained from the point cloud through the application of specific algorithms.
In the specific case of the details created by Borromini in the Chiesa di San Carlo, this range is wider than the classic tradition moldings.The continuous comparison between computer data and real data was essential to avoid possible erroneous interpretations.The final result is a sequence of curvilinear and rectilinear elements which can be linked to the profile effectively created, and can be represented in scale 1:20 for the definition accuracy.

Impost cornice of the vault and ceiling coffer
Vice versa, the same point cloud doesn't render the profiles of the most far architectural elements with the same reliability.A sequence of moldings, located high up compared to the survey station, isn't intercepted in all its development and it is rendered with a certain percentage of noise areas.It being understood that there is the possibility of obtaining better results from scans made on planes placed at heights closer to the objects which need to be measured, one wanted to verify, in any case, the possibility of drawing the dome impost cornice.In this case, lacking the possibility of verifying directly the sequence of moldings, one relied on the study of iconographic archive documents.In particular, the survey drawing (Azr 203) made by Bernardo Borromini was analyzed .The architrave section, for the reasons already mentioned (distance and angle of the photo instrument, evident overhangs and recesses of the profile) was rendered in scale 1:50: this ratio makes it possible to neglect the smallest elements in favor of the graphic representation of only the main elements, which characterize it.The final result is a sequence of moldings fruit of an interpolation among data captured through the instrument, knowledge about the work and its author, and the things it is possible to see through a telephoto lens and generally through a photographic shot.The same procedure was followed in the drawing of ceiling coffers, moving the objective from the drawing to the dimensional definition of the sequence which characterizes the vault intrados.

CONCLUSIONS
Although the method we propose was tested for few elements and with very particular characteristics, peculiar to Borromini's work, we finally think that procedures for the extraction of sections directly from the point cloud can be a further step in the study of the 3D survey in the architectural field.As a matter of fact there are some ameliorative aspects which concern in particular: 1) the speed of operations; 2) the simplification and stability of algorithms for the shape For the second point, calculation algorithms are specifically devoted to the definition of architectural sections in their geometrical construction and identification of points relevant to the construction itself (angular nodes, maximum overhang nodes, inflection nodes).For the third point, just the comparison among significant points, extracted in the survey model and knowledge based model, makes it possible to, ultimately, improve, complete and correct the section, and also the path, in order to make the section corresponding to the real model.Limoges.

Figure 1 .
Figure 1.The San Carlo alle Quattro fontane vault.Photo picture

Figure 3 .
Figure 3. Detail of image based triangulated mesh

Figure 5 .
Figure 5. Portion of range based model (reflectance image)

Figure 7 .
Figure 7. Portion of range based model (section plan and point cloud sub selection)

Figure 8 .
Figure 8.The San Carlo column base.Detail of range based model with extraction of section

Figure 9 .
Figure 9.The San Carlo column base.Comparison between sections of survey model and knowledge based model a) marked points at a fixed distance from the plane of section; b) selected points from a) c) elaborated polyline with relevant nodes: 1 (angular points), 2 (maximum overhang points), 3 (inflexion points) d) knowledge based section with the same relevant nodes Benko P., Martin R.R., Varady T., 2001.Algorithms for reverse engineering boundary representation models.

Figure 10 .
Figure 10.The San Carlo column base.3d model created by extrusion of section on a circular path and a square path