# 3D Point Cloud Completion Method Based on Building Contour Constraint Diffusion Probability Model
## 1 Introduction  
Urban-scale real-world 3D construction is becoming an important direction in the digital era of urbanization, with widespread applications in smart cities, urban planning, and surveying [1; 2; 3]. 3D point cloud can map information about the geometric shape, surface features, and spatial distribution of buildings in the real world into digital data [4], making them a crucial data source for real-world 3D construction. However, laser LiDAR point clouds may have non-uniform density distribution due to laser scattering, and point clouds generated by photogrammetry can be influenced by lighting conditions, weather, equipment accuracy, and other factors, leading to potential differences in the accuracy and consistency of point cloud data. On the other hand, both of these methods can result in missing point cloud data in certain areas due to occlusion by objects, leading to incomplete geometric information about buildings. Therefore, to correctly fill in missing building point cloud data, point cloud completion has become a crucial duty as a preprocessing approach for point clouds [5]. Generative Adversarial Models (GAN) [6], Variational Auto-Encoders (VAE) [7], Normalization Flow (NF) [8], and Denoising Diffusion Probabilistic Models (DDPM) [9] have achieved significant success in content generation task. Building upon these generative models, research has explored methods for point cloud completion based on GANs [10; 11], VAE models [12], flow-based models [13], and diffusion-based models [14]. While these methods have made progress in certain aspects, they also have inherent limitations. For instance, GAN-based methods can be challenging to train due to the need for training two networks, leading to unstable training processes and potential convergence issues. VAE-based models may generate building shapes that are not sufficiently smooth, partiallyattributed to injected noise and the use of element-wise measurements like the squared error. Training times for flow-based models can be lengthy, and they may not perform well in generating sparse point clouds. DDPM-based models, with their high stochasticity in the noise injection and denoising process during training, may struggle to deterministically control the generation of geometric point clouds in missing areas of buildings. To deal with these problems, we propose the building contour constraint diffusion probabilistic model for complementing building point clouds. By constructing the contour-constrained shape latent codes for the missing regions, the constrained point cloud generates the diffusion probabilistic model point cloud generation process, so that the complementary point cloud of the missing regions is close to the geometric features of the original building. This method not only recovers missing parts from incomplete point cloud data but also maintains consistency with the building's geometric characteristics and contours. Here is an overview of our approach: First, we use the RANSAC [15] to fit the building's point cloud into multiple surface polygons. Next, we group individual buildings into one or more clusters based on predefined polygon correlation constraints. Then, we project the roof and wall polygons of clusters with missing areas onto the ground plane and use geometric transformations to construct closed polygons, forming contour-constrained regions. Finally, the extracted contour-constrained region is encoded into a latent code representing its shape distribution, which is then fused with the latent code of the incomplete building point cloud. This fused representation is used in the reverse diffusion process to complete the point cloud. Here are our primary contributions:  
(1) For clustered segments with missing parts, we construct constraint regions by projecting wall contour lines and roof edge contour lines onto the ground plane.