 Research
 Open access
 Published:
Automatic modeling of the current state components of ancient buildings based on 3D deformation algorithm
Heritage Science volumeÂ 12, ArticleÂ number:Â 341 (2024)
Abstract
Ancient buildings possess significant artistic and cultural value. The digitization of these structures is a crucial aspect of their restoration, providing foundational data for subsequent stress and health analyses. However, creating accurate models of ancient buildings is a challenging endeavor, even for experienced researchers, especially when dealing with a large number of structures. A pressing issue that needs addressing is how to quickly obtain accurate models of ancient buildings while ensuring both precision and efficiency. Currently, one of the more precise methods for reconstructing models of ancient buildings involves the use of scanned point clouds and manual reconstruction through modeling software. However, this method suffers from poor accuracy and low efficiency, making the modeling process complex and timeconsuming. In this article, we will refer to the model generated from the point cloud of real components as the "current state model", and the unforced mesh model of the ancient building as the "standard model". An algorithm is proposed to construct the current state model of ancient buildings by guiding the deformation of the unforced standard model using the scanned point cloud model. First, this paper designs an automatic modeling method for ancient building components as the foundational data before deformation, addressing the issue of low modeling efficiency for ancient buildings. Second, it proposes a method for automatically calculating deformation control point pairs based on the characteristics of ancient buildings, solving the problem of manually locating control points. Finally, the proposed adaptive weight Laplacian deformation algorithm is applied to deform the standard model into the current state model.
Introduction
Wooden ancient buildings refer to historical structures primarily constructed using wood as the main building material. These buildings typically utilize components such as wooden columns, beams, and planks, connected through mortise and tenon joints or nails. They are widely distributed globally, with notable examples in East Asia, Northern Europe, and North America.
East Asia, including China, Japan, and Korea, is home to a large number of wooden buildings. Chinese ancient buildings are renowned for their unique structures and artistic styles. In Northern Europe, Norwegian wooden stave churches and traditional Finnish wooden houses hold significant historical and cultural value. Early wooden buildings in North America reflect the architectural styles and techniques of the colonial period.
Wooden ancient buildings document the development and evolution of human architectural techniques. They reflect the social, cultural, and technological levels of different periods, containing rich cultural connotations. These structures embody traditional craftsmanship, aesthetic concepts, and values, showcasing the superb skills of ancient artisans.
Ancient Chinese buildings are a vital part of Chinese civilization, carrying thousands of years of cultural heritage and possessing significant research, economic, and artistic value. Most Chinese ancient buildings are wooden structures, which have experienced various degrees of deformation over time due to internal and external factors. This deformation has impacted their structural health, leaving some ancient buildings in precarious conditions. Therefore, restoration has become imperative.
With the continuous advancement of technology, 3D digital modeling of ancient buildings has become an indispensable technique for their protection and restoration. This technology allows for the detailed threedimensional digitization of the real structure and textures of ancient buildings. Additionally, it facilitates segmentation, modeling, measurement, and analysis to assess the health of these structures. Moreover, it enables reconstruction, management, display, and design modification in a virtual environment, providing comprehensive and reliable data for the preservation and restoration of ancient buildings. In the field of forward modeling of ancient buildings, 3D models constructed based on the parameters, dimensions, and structural characteristics of ancient buildings that align with the design models are typically referred to as "standard models." In the field of reverse modeling of ancient buildings, the primary method currently involves using 3D laser scanning technology to capture actual models that reflect the state of the building at the time of data acquisition. These models are commonly referred to as "current state models". In the current 3D digital modeling of ancient buildings, the primary approach is the reverse modeling mentioned earlier. The constructed current state models are crucial for assessing the health status of ancient buildings. Although 3D laser scanning technology can quickly obtain point cloud data of the building, this data cannot be directly used for health analysis of ancient buildings. Many researchers manually model by referencing point clouds through software, but this method involves steps such as point cloud segmentation, local modeling, extrusion, and connection. Additionally, point clouds obtained through ground laser scanning often have data gaps, and even the complete parts are only surface point clouds, lacking the mortise and tenon structures that connect the components of ancient buildings. Therefore, manual modeling based on software is timeconsuming, laborintensive, and fails to ensure accuracy. It is well known that Chinese ancient buildings are constructed according to certain architectural principles. Based on partial parameter and structural information, their standard models can be rapidly constructed (Hu et al. [1] Rapid reconstruction of the current state model of ancient building components by threedimensional deformation algorithm). If the scanned point cloud is used as a guide to transform the standard model into a current state model through a 3D deformation algorithm, it can address the issues of accuracy, efficiency, and completeness in the modeling of current state models for ancient buildings.
In recent years, many scholars have conducted indepth research on various deformation algorithms. Several methods focus on deforming 3D models using information from 2D sources. For instance, in 2016, Qiang et al. [2] introduced a deformation algorithm that first extracts natural lines such as contours, principal axes, and crosssections of the model. These lines are then compared with real images to find corresponding reference lines, which are used to guide the model's deformation. The strength of this method is its ability to improve deformation accuracy, but its weakness is its unsuitability for complex geometric features of ancient building models. In 2020, Pang et al. [3] proposed an algorithm for deforming 3D models driven by 2D image contours. First, the algorithm uses similar triangles to obtain the deformation points on the contour line of the 2D image and the control points of the 3D model's 2D contour line, then pairs them as corresponding points. Finally, it deforms the model using a rigid mesh deformation algorithm. However, due to various factors affecting numerous components of ancient buildings, they are often nondetachable, making it difficult to obtain 2D images. Additionally, deformation positions on wooden components of ancient buildings might exist at multiple angles, necessitating multiangle 2D images for accurate deformation. This results in a substantial workload when dealing with the deformation of numerous wooden components. In 2022 Yu et al. [4] is based on the twodimensional fabric projection to generate a threedimensional fabric drape mesh, connecting the 2D contour and the model 3D boundary by constructing two neural networks, and then using the trained neural network to infer the 3D boundary based on the 2D projection to generate six triangular mesh models with different densities, and then using Laplace deformation and Poisson deformation drive to realize the 3D model deformation, which is complicated to operate, and the accuracy of deformation relies on the correctness of the projection of the 2D fabric and the inference of the 3D boundary from the 2D projection. In 2023 Ni et al. [5] proposed a new method for modeling human muscles and their deformation. Based on magnetic resonance imaging (MRI) data, the outer contour lines of the muscles are extracted using the generated slice images, and then the corresponding contour lines are connected with the optimal matching points of the images of the neighboring layers to construct the 3D geometrical 5 model of the muscles; then the mapping between parameters is established by defining the muscle features in layers relationship, and realize the deformation of muscle keeping volume. The advantage of this algorithm is the high accuracy of the model, but the disadvantage is that the model deformation is driven by the contour lines of the 2D image, and the model deformation needs multiple angles, which is not applicable to the deformation of a large number of ancient architectural components.
Neural networkbased approaches offer innovative solutions for 3D deformation. In 2018, Kurenkov [6] used 2D images as input sources for 3D reconstruction through a deformation network. This method involves complex operations in the network training phase and requires a large dataset. Additionally, the shooting angle of the input 2D images affects the reconstruction results, making it unsuitable for deforming ancient building models. In 2019, Naziha et al. [7] proposed a 3D mesh deformation algorithm based on a neural network structure using genetic algorithms and multiresolution analysis. The advantage of this algorithm is its high deformation accuracy after training. However, it requires a large dataset and has high training costs. In 2020, Wu YJ [8] employed deep learning techniques to construct a SliceNet network, which shares 2D deconvolution parameters. This network sequentially sorts individual images to generate 2D slices of 3D shapes. However, this method requires a substantial 3D dataset and presents certain limitations in model deformation choices, making it less suitable for ancient building components, among others.
Several methods are focused on mesh deformation with parameter constraints. In 2009, Huang et al. [9] proposed an improved barycentric interpolation method. This method effectively deforms objects by embedding the target object into a coarse control mesh and then deforming the target object accordingly through interpolation. While this method is suitable for 2D image objects embedded in planar triangular meshes, it requires 3D objects to be embedded into tetrahedral meshes, which is a complex operation. In 2011, Li et al. [10] proposed a new method for customizing 3D clothing by establishing shape constraints through crosssections on both reference and target body models. The control points around the reference body model were divided into five tetrahedral meshes, which could work together. Finally, the constrained volumetric Laplacian deformation was used to fit the reference body model to the target body model. This method's advantage lies in its high deformation accuracy, but in the context of ancient buildings, the original data is in the form of point clouds, and the effectiveness of point cloud meshing is influenced by many factors. In 2013, Li L et al. [11] proposed an improved wrinkle modeling method using a shape control function. This method generated a global model based on a set of facial landmark deformations from a generic model, and then used the extracted points and curves for deformation, further optimizing nonfeature areas and other facial organs locally. The advantage of this algorithm is its detailed modeling of features, but the details are only present on the surface. In contrast, ancient buildings, such as those with intricate interlocking wood structures (dougong brackets), have internal detailed components that cannot be captured or considered in the deformation process. In 2016, Du et al. [12] proposed a volumetric graphbased rigid mesh deformation algorithm. The advantage of this algorithm lies in its ease of use and the enhancement of model rigidity. However, its drawback is that volumetric graphs of ancient buildings are challenging to obtain, making it unsuitable for constructing simulation models of ancient buildings. In 2017, Chen et al. [13] presented a controllable rigidity mesh deformation algorithm, which allows for flexible control and adjustment of the model's shape rigidity. However, this algorithm distributes deformation to local small meshes, which contradicts the deformation characteristics of wooden structures under load. Consequently, it fails to accurately transform the standard model of ancient buildings into the current state model. In 2020, He et al. [14] proposed a parameterized 3D facial model editing algorithm. This algorithm uses multiple 3D facial models with different expressions as input, pairing the source and target models one by one to establish vertex correspondences between the registration models. The 3D source model is then converted into 2D, deformed through interpolation, and finally restored to the corresponding 3D model using a model recovery algorithm. The advantage of this algorithm is its high accuracy. However, its complexity in operation and the potential accuracy loss during the meshing process when using 3D laser technology to quickly obtain the true point cloud of ancient buildings makes it less suitable for ancient building deformations. In 2021, Fang H [15] proposed a greedy algorithm based on grouping and circular constraints (GCB) to improve the efficiency of the mesh deformation. By incorporating the concept of multiple meshes, the algorithm approximates the computational error on the fine mesh to the error on the coarse mesh and randomly divides all boundary nodes into N groups; then, the local maximum radial basis function (RBF) interpolation errors of the active groups are used to approximate the global maximum interpolation errors of all boundary nodes, thus reducing the number of RBFsupporting nodes, and thus it avoids interpolation of all the boundary nodes for interpolation. After N iterations, the interpolation errors of all boundary nodes will be calculated once, which allows all boundary nodes to contribute to the error control. The advantage of this algorithm improves the reduction of interpolation error. The disadvantage is that the radial basis function itself is not suitable for threedimensional deformation with the ancient architecture, and the texture of the ancient architectural model may be destroyed.
Other methods: In 2017, Selim, Mohamed et al. [16] proposed a new volumetric mesh deformation method based on incremental radial basis function (RBF) interpolation. This method introduced two incremental approaches to solve the RBF equation system: a block matrix inversion method and a modified LU decomposition method. The advantage of this deformation algorithm is that it reduces the complexity of solving the equation system and accelerates the deformation process. However, its drawback is that it does not handle local deformations well. In 2019, Guan et al. [17] studied the widely used triangular mesh parameterization problem, focusing on three weighting schemes: mean Laplacian weights, LaplacianBeltrami weights, and median weights. They implemented barycentric mapping and analyzed the parameterization results based on the deformation variables of triangles. The results indicated that median weights are the optimal weighting scheme for barycentric mapping. In 2022, Du et al. Â [18 a new 3D contact reconstruction algorithm, the algorithm captures the haptic flow of contact deformation through sensors using optical algorithms of computer vision and realizes full resolution deformation tracking on the haptic surface, the advantage is that the accuracy is high compared to other methods, the disadvantage is that the algorithm is based on 3D point cloud reconstruction, so it is not possible to estimate the internal structure of the reconstructed model.
Based on the aforementioned points, the 2Ddriven 3D deformation techniques have limited capability in handling fine details, making it difficult to accurately control the shape of objects. Neural networkbased deformation techniques and parameterconstrained mesh deformation methods are not wellsuited for deforming ancient architectural structures and often result in texture loss. To address the issues present in the aforementioned methods, this paper employs a scanned point cloud model as a guide. By leveraging the symmetry characteristics of ancient architectural components, we deform standard components of ancient buildings to obtain a complete and highprecision model of the current state of these structures. This approach facilitates the 3D reconstruction of point clouds for large wooden components in ancient buildings, providing fundamental data for the study and preservation of historical architecture (Fig. 1).
Methodology
This paper uses the standard mesh model of ancient architectural components as a foundation, guided by scanned point cloud data. By applying the adaptive weighted cotangent Laplace algorithm, it achieves a complete current model that adheres to the construction principles of ancient architecture while closely matching the actual condition of these structures. Consequently, it realizes the automatic, highprecision, and complete reconstruction of the current state models of ancient architectural components.
The technical route of this paper is illustrated in the following diagram: The overall objective is to utilize point cloud data to drive the deformation of the standard model into the current state model. By summarizing the construction knowledge of ancient buildings, component modeling functions are written to generate standard models; threedimensional laser scanning is used to obtain point clouds of the existing components of the ancient buildings. The foundation of this process is the component standard model and the component point cloud data. First, based on the symmetry characteristics of ancient architectural components, the central axes of the standard component model and the point cloud model are fitted. At the equidistant points along the two axes, the perpendicular planes are obtained, and equidistant radial lines are generated centered on these perpendicular points. Next, local fitting of the point cloud is performed, and collision detection methods are used to obtain the intersection points of the corresponding radial lines with both models, which serve as the homologous control points for 3D deformation. Finally, the adaptive weighted cotangent Laplace algorithm is applied to deform the standard component model into the current state model. This method breaks away from traditional forward modeling thinking by using quickly constructed standard component models of ancient buildings and deforming them into scanned point cloud models, thereby achieving rapid reconstruction of complete current state models of ancient architecture.
Automatic construction of 3D standard models
BIM models as crucial data for the digital preservation of ancient architecture. Currently, the creation process of BIM models for ancient architecture is cumbersome, timeconsuming, and laborintensive. To address this, we have employed secondary development with Revit to convert construction parameter rules of ancient architecture into computer language, enabling the automatic construction of standard components for ancient buildings. Among the components of ancient architecture, the DouGong bracket is the most complex. To automatically construct a DouGong bracket, one only needs to input parameters such as the "DouKou" (the opening size of the DouGong) and the form of the DouGong bracket. For example, to construct a DouGong bracket, one can determine the number of tiers, the basic components, and the overlapping positions based on traditional construction knowledge. By combining these with the "DouKou" parameters, an automatic construction of the DouGong bracket model can be achieved. For other components like Eaves pillars, Beams, and Lintel, the standard models can be automatically constructed by inputting basic "DouKou" information, form grades, and parameters of the building's width or depth. If the actual information of the ancient architectural components (such as the real number of tiers in a DouGong bracket or special construction techniques) does not match the summarized rules, relevant information should be input. This includes slicing processed point clouds and using random sample consensus algorithms to fit circles to obtain fundamental architectural parameters like depth, width, and column diameter. The model can then be modified to resemble the simulated DouGong model closely. For components lacking actual information, standard models can be quickly obtained by directly applying the construction rules of ancient architecture. This process is illustrated in Fig.Â 2, with the framework flow shown in Fig.Â 3.
Automatic control point extraction method
The identification of corresponding control points is crucial for the implementation of deformation algorithms. In current methods of automatically extracting control points, whether based on image projection or 3D model sampling, both data sets need to be precisely aligned. Achieving perfect alignment is challenging for two relatively deformed data sets. The standard model in this study is constructed based on point cloud parameters, ensuring geometric alignment between the standard model and the component point cloud. Given the strict, standard, and symmetrical geometric structures of ancient architectural components, this paper leverages these characteristics to obtain uniformly distributed corresponding control points without the need for registration. By exploiting the geometric symmetry of these structures, we can identify corresponding control points directly.
Eaves pillars, Beams, Lintel, and DouGong brackets are representative of the main wooden components of ancient architecture. Here, we illustrate the process using Eaves pillars as an example (Fig. 4)
Axis feature extraction
After obtaining the standard model and the point cloud model of ancient architectural components, the standard component is divided equally based on the size of its bounding box. Subsequently, a corresponding Zcoordinate threshold is set. Using Eq.Â (1), points on the central axis are calculated, and the central axis of the standard model is fitted using a random sample consensus (RANSAC) algorithm based on the model's vertices.For the component point cloud model, initial processing steps include downsampling and denoising the point cloud. Following this, the mathematical model of the point cloud is fitted using the RANSAC algorithm to extract the central axis of the point cloud.
Calculation of corresponding point pairs
For the axes obtained from the two data sets in 2.2.1, we select N point pairs. By creating N perpendicular planes through these points along the axis, we take each point as a starting point and generate M bisecting rays from a specific initial direction on each plane. By calculating the intersections of these Mâ€‰Ã—â€‰N rays with both models, we can obtain the corresponding point pairs for the two models (Fig. 5)
For the intersection of rays and models, we use collision detection methods. Specifically, for the intersection of rays and point clouds, we employ the "GridBased Collision Detection Method for Line and Point Cloud." The basic idea is to gridify the part of the point cloud that the line intersects by fitting local surfaces to approximate the point cloud. This involves dividing and reassembling the point cloud using a triangular mesh data structure. This approach transforms the intersection region between the line and the point cloud into a triangular mesh region on the local surface. Then, using the raytracing algorithm [13], the triangular region is traversed to obtain point (P). The calculation method involves finding the intersection point by solving the equation of the line and the plane equation of the triangular facet. To determine if the intersection point lies within the triangle, the sum of the areas formed by the intersection point and the three vertices of the triangle is compared to the area of the triangle itself. In Fig.Â 6, within a single 3D coordinate system, the triangular facet ( ABC) intersects with the line ( L), and the intersection point in space is ( P).
As shown in Figs.Â 7 and 8, using the above method, we obtained the model control points \(i\) and the corresponding deformed point cloud control points \({i}{\prime}\).The numbers in Figs.Â 7 and 8 only represent the order of the control point pairs in each respective figure (Fig. 9).
3D model deformation methods
In ancient architectural components, the 3D models of elements such as eave columns and beams are relatively simple. Algorithms like the Cotangent Laplacian, Median Laplacian deformation, and Mean Laplacian deformation can achieve good deformation results. However, the Median Laplacian deformation algorithm can cause structural distortions, and the Mean Laplacian deformation can result in some loss of shape features. For handling more complex models such as dougong (interlocking wooden brackets) and moon beams, which contain more detailed features, the Cotangent Laplacian algorithm is more effective. It better preserves shape features and the deformation of finer structures, allowing for reasonable deformation of local features that characterize ancient architectural styles. Therefore, to accommodate the deformation of various components in ancient architecture to the greatest extent, we adopt the Cotangent Laplacian deformation algorithm in our deformation process. This method constructs a Laplacian matrix from the 3D model, using it to obtain local information for each vertex. By considering both local information and global deformation, the algorithm achieves the desired 3D model deformation. The Laplacian deformation algorithm formula is given by Eq.Â (2).
The cotangent weights for the nonzero offdiagonal elements (\({L}_{ij}\)) and the diagonal elements (\({L}_{ii}\)) of the Laplacian matrix are given as follows, shown in Eqs.Â (3) and (4). Here, (\({l}_{ij}\)) is the length of the edge (\({v}_{i}, {v}_{j})\)), and (\({S}_{i}\)) is the area of the Voronoi region of vertex (\({V}_{i}\)), which is the area enclosed by the perpendicular bisectors of the lines connecting (\({V}_{i}\)) to its neighboring vertices.
Once the Laplacian matrix \(L\) is determined, the \(\delta\) coordinates can also be calculated.
In the Laplacian deformation algorithm, it is necessary to apply a uniform weight coefficient to the control points of the 3D standard model and the deformation points. Without this, the deformation could result in the control points being excessively fitted, leading to the loss of local features. The weight coefficient significantly impacts the deformation effect of the 3D model. Therefore, we introduce a constraint weight (\({W}_{anchor}\)) for the control points.
Finally, solve the overdetermined system of equations. At this point, the deformation process is complete.
Control point constraint weight adaptive algorithm
To address the extensive model deformations in ancient architecture and achieve optimal deformation effects, this paper proposes an adaptive method for control point constraint weights. This method continuously adjusts the control point constraint weight coefficient ( \({W}_{anchor}\)) based on the precision of each model deformation. Ultimately, this results in a model with the best deformation effect.
Model deformation precision evaluation method
After the deformation of the standard component models in ancient architecture, this paper uses the Root Mean Square Error (RMSE) as the evaluation metric for model deformation precision. In the following text, RMSE will represent the Root Mean Square Error, which is a specific form of RMSE. The calculation formula is provided as Eq.Â (8).
Adaptive Iterative Method for Anchor Point Constraint Weight Coefficient
To automate the model deformation process and achieve the optimal deformation effect for standard components of ancient architectural models, it is necessary to adjust the weight coefficient (\(W\)) (referred to as the constraint weight coefficient below). By comparing and iterating, the best weight coefficient is obtained. The adaptive method for the weight coefficient is described below:

(1) Basic control point pairs are established, and parameter initialization is required. The initial value of the weight coefficient (\(W\)) is set to 1, and (\(k\)) is a userdefined threshold. The step size (\(\Delta \text{W}\)) is set to 0.1 by default, and it can be adjusted based on subsequent evaluation metrics.

(2) Convert the standard model data from the previous deformation into point cloud data. After registering it with the scanned point cloud, calculate the root mean square error (RMSE). Here, (\({v}_{i}\)) represents the new vertices of the deformed model, and (\({p}_{i}\)) represents the nearest points in the point cloud to (\({v}_{i}\)), as shown in Eq.Â (9).
$$RMSE=\left{v}_{i}{p}_{i}\right i\in E$$(9) 
(3) Increase the control point constraint weight using the step size (\(\Delta \text{W}\)) and repeat the calculation from step (2). Compare the new RMSE (\({RMSE}_{new}\)) obtained from the deformation result with the previous RMSE (\({RMSE}_{old}\)). If the new RMSE is lower than the previous one, the accuracy is improved, and the weight coefficient should continue to decrease. If the new RMSE is higher, the registration accuracy has decreased, and the weight coefficient should be increased.
$${W}_{new}=\left\{\begin{array}{c}\begin{array}{cc}{W}_{old}\Delta \text{W}& {RMSE}_{old}\ge {RMSE}_{new}\end{array}\\ \begin{array}{cc}{W}_{old}+\Delta \text{W}& {RMSE}_{old}<{RMSE}_{new}\end{array}\end{array}\right.$$(10) 
(4) Determine if the difference between the RMSE values from two consecutive iterations is within the threshold (\({K}_{threshold}\)). If it is within the threshold and the RMSE is lower than the initially set threshold, the RMSE is considered converged, and the final deformation result is output. If the RMSE does not converge, adjust the step size (\(\Delta \text{W}\)) for the control point constraint weight. The range of the threshold (\({K}_{threshold}\)) in Eq.Â (11) should include the values adjacent to where the RMSE changes direction, as shown in Eq.Â (12).
$${\Delta \text{W}}_{new}=\left\{\begin{array}{cc}{\Delta \text{W}}_{old}/2& RMSE\in {K}_{threshold}\\ {\Delta \text{W}}_{old}& RMSE\notin {K}_{threshold}\end{array}\right.$$(11)$$K_{{threshold}} \, = \,\left\{ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {K_{{min}} = RMSE_{i} } & i \\ \end{array} \in E~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} \\ {\begin{array}{*{20}c} {K_{{max}} = RMSE_{i} } & {i \in {\text{max}}\,\,\left[ {RMSE_{{i  1}} ,RMSE_{{i + 1}} } \right]} \\ \end{array} } \\ \end{array} } \right.$$(12) 
The initial parameters are set is described below: the weight coefficient is 1, and the step size (\(\Delta \text{W}\)) is set to 0.1. Initially, the weight is decreased. After several deformations, due to the larger step size, there will be some fluctuation in the RMSE range. The threshold ( \({K}_{threshold}\)) is determined through the accuracy range fluctuations. If the RMSE falls within the threshold range multiple times, the step size (\(\Delta \text{W}\)) is set to 0.05 to meet the requirements for a more precise deformation result. During subsequent deformations, (\({K}_{threshold}\)) is updated. The range is selected based on the minimum RMSE value (highest accuracy data points) from the maximum and minimum values of the data points. After each data fluctuation, the difference in the range of (\({K}_{threshold}\)) is calculated to see if it exceeds the set accuracy. If it does, the result is output. If it does not, the step size is continuously adjusted, updating the weight coefficient for further deformations, and the range is updated accordingly. In this paper, the weight coefficient 1/10 is used as the initial step size. When an RMSE reversal occurs, a step size of 1/2 is used as the new step size for reverse weight changes. This process iterates step by step until the RMSE stabilizes, i.e., the variation is less than the set threshold (k), resulting in the final weight, RMSE, and deformed model.

(5) The optimal control point constraint weight coefficient (\({W}_{\text{anchor}}\)) is obtained based on multiple consecutive RMSE values within a certain threshold. The flowchart for calculating the optimal control point constraint weight coefficient is shown in Fig.Â 10.
Experiment and analysis
Experimental platform and tools
In this paper, we use the opensource Open Scene Graph (OSG) library and the Câ€‰+â€‰â€‰+â€‰programming language (MS Visual Studio 2017) to build the experimental platform. The Eigen library's Cholesky decomposition is utilized to solve sparse matrices. OSG is used as a tool for displaying 3D models. Additionally, the Point Cloud Library (PCL) is employed along with point cloud processing software for tasks such as point cloud denoising and downsampling.
Experimental data
To validate the correctness and feasibility of the proposed method, this paper uses laboratory data of columns, beams, eaves purlins, and bracket sets from ancient architecture as experimental data. Standard component models of ancient architecture were constructed based on traditional building techniques. These models were then subjected to a certain degree of deformation and converted into point clouds. The resulting point cloud models served as the scanned point cloud models. In the case of columns, beams, and eaves purlins, only the deformable parts that could be scanned were deformed due to the inability to scan internal structures. For bracket sets, where internal structures cannot be scanned, only the external parts of the models were deformed. This setup is illustrated in Fig.Â 11.
Automatic generation of control point pairs
After obtaining the standard model of ancient architecture and the scanned point cloud of its components, the method described in Sect.Â Automatic Control Point Extraction Method is applied to start constructing control points and deformation points. The process begins by fitting the central axis of the mesh model and the point cloud, then dividing the height into six equal parts. At each divided (z)coordinate, the (xy)plane is viewed from above. Rays at 90Â° intervals are cast, performing collision detection with the mesh model. The parts where the rays intersect the point cloud are used to create local fitting surfaces, followed by collision detection. These intersections are designated as control points and deformation points. Due to the complexity of bracket set components, additional control point pairs are added to ensure deformation accuracy. FigureÂ 12 illustrates the generation of control point pairs for the four types of components.
Adaptive weighted cotangent Laplacian algorithm
Based on the obtained model control points and the actual deformation points on the point cloud (considering that the point cloud scans of ancient architecture are inevitably deformed due to age), control point pairs are formed. These pairs are used to construct a Laplacian matrix for solving the deformations. The adaptive weights of the Laplacian are iteratively calculated to achieve the final deformation results. The results are then compared with those obtained using the mean Laplacian deformation method and the Gaussian spline deformation method. Figures comparing the deformation results of the Gaussian spline, mean Laplacian, and the proposed method are presented in Fig.Â 13.Â The relevant deformation data are analyzed and displayed in Tables 1, 2, and 3.
From Figs.Â 14, we can observe the number of iterations and the trend of the best iteration accuracy RMSE for the deformation of ancient building components. These results show that after multiple iterations, the method in this paper achieves good performance in handling the deformation of eaves pillars, beams, lintels, and DouGong brackets. The reduction in error is particularly significant in the deformation of eaves pillars and lintels. In Tables 1, 2, and 3, under the same deformation data, the RMSE of the ancient building components using this method is lower than that produced by the other two deformation algorithms, while also accounting for local detail features. Therefore, the method proposed in this paper is more suitable for the automatic deformation of ancient buildings.
Comparative analysis
This section analyzes the results of the proposed method and compares them with representative deformation algorithms, namely Gaussian splines and mean Laplacian. To investigate the impact of the number of vertices and control points on the weight coefficients and deformation accuracy, a controlled variable method was employed. Experiments were conducted with the number of vertices and control points as the variables. The comparative experimental data are presented in Tables 1, 2, and 3.
The results indicate that the proposed method significantly improves the deformation accuracy compared to the other two deformation methods. Specifically, when the number of vertices is increased and adaptive weight deformation is applied, there is a notable enhancement in the weight coefficients of the control points compared to the deformation results without an increased number of vertices. The same improvement is observed with the increase in the number of control points.
By examining the data in the tables, it is evident that the proposed method consistently outperforms the Gaussian splines and mean Laplacian methods in terms of accuracy. The enhanced performance is particularly evident when both the number of vertices and the number of control points are increased, demonstrating the robustness and effectiveness of the proposed approach in achieving highprecision deformation results for ancient building components.
From Tables 1, 2, and 3, it can be observed that the RMSE of the proposed method is consistently lower across all component models compared to the mean Laplacian and Gaussian spline methods. Specifically, the errors of the mean Laplacian and Gaussian spline methods are approximately 77.36% to 245.90% and 413.21% to 693.44% higher than the proposed method, respectively. Additionally, as the number of vertices increases, the RMSE of the proposed method generally decreases. For instance, when the number of vertices of the eaves pillar increases to 4556, the RMSE decreases to 0.0031; when the number of vertices of the beam increases to 5139, the RMSE decreases to 0.0050; when the number of vertices of the lintel increases to 4286, the RMSE decreases to 0.0041; and when the number of vertices of the DouGong bracket increases to 6704, the RMSE decreases to 0.0079, which represents a reduction of 15.96% to 41.51% compared to TableÂ 1. Similarly, when the number of control points increases, the RMSE of the proposed method also generally decreases. When the number of control points for the eaves pillar increases to 40, the RMSE decreases to 0.0023; for the beam, it decreases to 0.0044; for the lintel, it decreases to 0.0029; and for the DouGong bracket, it decreases to 0.0070, representing a reduction of 25.53% to 56.60% compared to TableÂ 1.
Based on the comparative analysis in Fig.Â 15, it is very clear that the deformation accuracy of the proposed method is significantly higher than that of the other two methods for the same components. Under the same conditions, increasing the number of vertices or control points and applying adaptive deformation will similarly reduce the root mean square error obtained through registration. This consistent improvement demonstrates the effectiveness of the proposed method in achieving lower RMSE values and higher deformation accuracy for ancient building components, whether by increasing the number of vertices or control points.
Real data experiment analysis
To validate the authenticity of the proposed algorithm, real standard models of ancient buildings and scanned point cloud models were used as examples. Due to the complexity of obtaining point cloud data for DouGong brackets, which are located above eaves pillars or lintels and separated by partitions, this validation focused solely on columns and beams.
In this study, we collected and analyzed experimental data from the column and beam structures of the Hall of Supreme Harmony (Taihe Dian), a representative building of the Ming and Qing dynasties' imperial palaces. The structural characteristics of the Hall of Supreme Harmony hold significant historical and architectural value, as shown in Fig.Â 16.
This experiment serves as a crucial step in demonstrating the practicality and effectiveness of the proposed method in accurately modeling and analyzing realworld ancient building components. The Hall of Supreme Harmony's data provided a robust basis for evaluating the method's performance in a realworld context, further highlighting the importance of preserving and understanding historical architecture through advanced computational techniques.
The Hall of Supreme Harmony has a width of 37.2 m and a length of 64 m, as shown in Fig.Â 17 The timber structure exhibits overall symmetry. Columns, as the vertical support components of the building, primarily bear the weight of the upper structure and transfer it to the foundation, forming the skeleton of the entire structure.
In the experimental data, the inner eaves columns, characterized by their symmetry, are slightly narrower at the top and wider at the bottom, enhancing stability and loadbearing capacity. Beams, which are lateral support components, span between the columns, supporting the roof and floor loads and transferring these loads to the columns. The beams and columns are connected using mortise and tenon joints, eliminating the need for additional components; the experimental data excluded the locations of these joints. Lintels function as horizontal support members, typically placed above doors and windows, to distribute and bear the weight of the upper structure, preventing it from directly pressing on the door and window frames. Dougong is a transitional component between columns and beams, primarily used to bear the weight of the roof and transfer it to the columns. Additionally, DouGong bracket plays a role in reinforcing and stabilizing the structure.
Due to the limitations of the 3D laser scanner, the top data of the beams in the Hall of Supreme Harmony is missing. Therefore, the corresponding positions at the top of the components were marked. When calculating the RMSE for registration, the nonmarked parts of the components were converted into point clouds. To ensure the accuracy of the comparative results, each component was converted into a point cloud consisting of 100,000 points. In Fig.Â 18, the green point cloud represents the real component point cloud, while the red point cloud represents the deformed component point cloud. The actual results are presented in TableÂ 4.
Discussion
In this paper, we generated a current state model of ancient architecture by iteratively deforming a point cloud model, guided by a standard model and scanned point cloud data, through continuous adjustment of control point weights. Compared to existing deformation methods, our approach addresses issues of deformation accuracy, efficiency, and model integrity.
Unlike manual deformation methods used in application software, our method is implemented using code, ensuring the deformation process is fully automated. This eliminates human error in selecting control points and significantly improves both accuracy and efficiency. Compared to previous work [1], our method offers several advancements:

(1)
Rapid Modeling of Standard Models: We have built upon the rapid modeling techniques for ancient architectural standard models from earlier work.

(2)
Point CloudDriven Deformation: Previous methods relied on image contourdriven 3D model deformation. In contrast, our method uses point cloud models to drive the deformation, resulting in higher precision.

(3)
Adaptive Weight Iterative Deformation: Our method introduces adaptive weight iterative deformation, requiring less manual intervention and further enhancing accuracy and efficiency.
In summary, our method not only enhances precision and efficiency but also automates the deformation process, making it a significant improvement over both manual methods and previous research.
Future research will explore several directions:

(1)
Data Fusion: Combining 3D laser scanning technology with other data acquisition methods, such as UAV photogrammetry and Geographic Information Systems (GIS), to enrich the data sources for ancient architecture models. This integration will improve the comprehensiveness and accuracy of the models.

(2)
RealTime Processing: With advancements in hardware technology, realtime processing of large point cloud datasets and model deformation will become feasible. This will enable dynamic monitoring and assessment of ancient buildings, significantly enhancing the timeliness and effectiveness of cultural heritage preservation efforts.

(3)
Interdisciplinary Collaboration: The preservation of ancient buildings is not just a technical issue but also involves history, culture, and art. Future research can strengthen collaboration with archaeologists, historians, and cultural heritage experts to develop more comprehensive protection and restoration plans.

(4)
Application Expansion: Beyond ancient buildings, other fields such as modern architecture, industrial heritage, and natural landscapes face similar challenges in digital modeling. Applying our method to these areas can widely enhance the applicability and dissemination of modeling technologies.
By pursuing these directions, future research will continue to advance the precision, efficiency, and applicability of digital modeling techniques for a variety of heritage and contemporary structures.
Conclusion
With the advancement of 3D laser scanning technology and deformation algorithm techniques, the digital restoration of ancient architecture is also continuously developing. Simulated models of ancient buildings have long become crucial data for cultural heritage protection units. In the near future, all ancient buildings will undergo digital preservation. Although the methods for modeling ancient architecture have become increasingly diverse and sophisticated, modeling accuracy and efficiency still require better solutions for further optimization in the face of a large number of ancient buildings.
Addressing the above issues, this paper proposes an automated modeling method for ancient architecture. Firstly, we use the existing method for automatically generating standard components of ancient buildings, which can achieve the extraction of parameter information from point clouds and then automatically generate standard components of ancient buildings. Secondly, we propose a method for automatically calculating model control point pairs, solving the efficiency issue of manual searching. Finally, we present an improvement based on the Laplacian deformation algorithm, achieving automatic iterative deformation of model control point weights and addressing the problems of model deformation accuracy and modeling efficiency.
Currently, compared to the existing two deformation methods, our proposed method has proven advantages in deformation accuracy and modeling efficiency. The deformation results can provide fundamental data for the health assessment and restoration of ancient buildings. Our research method offers new ideas and approaches for the modeling of simulated models of ancient architecture, holding significant scientific research value and practical significance.
Availability of data and materials
No datasets were generated or analysed during the current study.
References
Hu CM, Zhu ZY, Xia GF, Liu X, Ma XJ. Rapid reconstruction of the current state model of ancient building components by threedimensional deformation algorithm. Survey Mapping Sci. 2023;48(08):163â€“8.
Qiang F, Chen XW, Su XY, Fu HB. Natural lines inspired 3D shape redesign. Graph Models. 2016. https://doi.org/10.1016/j.gmod.2016.01.002.
Pang M. Research on threedimensional model deformation technology. North Central University, 2020.
Yu ZC, Zhong YQ, Gong RH, Xie HY, Azmat H. Generating threedimensional drape model based on projection and mesh deformation. J Text Inst. 2022;113(8):1739â€“49.
Ni N, He KJ, Wang L, Jiang JF, Chen ZM. Computer methods in biomechanics and biomedical engineering, 2023: 113.3
Kurenkov A, Ji JW, Garg A, Viraj Mehta, G. Deformnet: Freeform deformation network for 3d shape reconstruction from a single image 2018 IEEE Winter Conference on Applications of Computer Vision (WACV). IEEE, 2018: 858â€“866.
Naziha D, Chokri BA. Multimother wavelet neural networkbased on genetic algorithm and multiresolution analysis for fast 3D mesh deformation. IET Image Proc. 2019. https://doi.org/10.1049/ietipr.2019.0343.
Wu YJ, Sun ZX, Song YC, Song YC, Sun YH, Shi JL. Slicenet: Slicewise 3D shapes reconstruction from single image. ICASSP 2020â€“2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2020: 1833â€“1837.
Huang J, Chen L, Liu XG, Hu J. Efficient mesh deformation using tetrahedron control mesh. Proceedings of the 2008 ACM symposium on Solid and physical modeling. 2008.
Li JT, Lu GD. Customizing 3D garments based on volumetric deformation. Comput Indust. 2011. https://doi.org/10.1016/j.compind.2011.04.002.
Li L, Liu L, Peng C, Gao BL. Computeraided 3D human modeling for portraitbased product development using point and curvebased deformation. ComputAided Des. 2013. https://doi.org/10.1016/j.cad.2012.08.007.
Du ZJ, Zhang H. Asrigidaspossible mesh deformation based on volumetric graph. J Comput Aided Des Graph. 2016;28(02):218â€“27.
Chen SY, Gao L, Lai YK, Xia SH. Rigidity controllable asrigidaspossible shape deformation. Graph Models. 2017. https://doi.org/10.1016/j.gmod.2017.02.005.
He LG, Pang M, Kuang LQ, Chang M. Developing a parametric 3D face model editing algorithm. IEEE Access. 2020;8:167209â€“24.
Fang H, Zhang H, Shan FL, Tie M, Zhang X, Sun JH. Efficient mesh deformation using radial basis functions with a groupingcircularbased greedy algorithm. J Comput Phys. 2021;433: 110200.
Mohamed MS, Roy PK, Ahmed SS. Incremental approach for radial basis functions mesh deformation with greedy algorithm. J Computat Phys. 2017;340:556â€“74.
Guan YR, Oliver VK, Guan YQ. Research and implementation of triangle mesh parameterization method based on barycentric mapping. J Beijing Univ Posts Telecommun. 2019;42(05):83â€“90.
Du Y, Zhang G, Wang MY. 3D contact point cloud reconstruction from visionbased tactile flow. IEEE Robot Autom Lett. 2022;7(4):12177â€“84.
Funding
This research was supported by the National Natural Science Foundation of China (42171416, 41401536).
Author information
Authors and Affiliations
Contributions
CH and GF conceived the presented idea and put forward experimental suggestions. ZY conducted and refined the analysis process and wrote the manuscript. XL and XM are responsible for proposing amendments to the manuscript and giving the research significance of the paper. All authors approved the final manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated in a credit line to the data.
About this article
Cite this article
Hu, C., Zhu, Z., Xia, G. et al. Automatic modeling of the current state components of ancient buildings based on 3D deformation algorithm. Herit Sci 12, 341 (2024). https://doi.org/10.1186/s40494024014553
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s40494024014553