# 3D Point Cloud Completion Method Based on Building Contour Constraint Diffusion Probability Model
## 3 Methods
### Contour Constraint
#### 3.1.3 Constructing Contour Constraint Polygons  
Due to the difficulty in handling wall contours in three dimensions and the mutual influence of edges of various subparts, each building subpart is sequentially projected onto the ground plane \(V_{horizon}\) to generate a two-dimensional constraint outline, which is then projected onto the roof plane to construct the contour constraint polygons.  
As shown in Figure 5, taking the subpart \(Z_{a}\) with missing data as an example, the associated polygon is projected onto the ground plane as \(V_{horizon}\), the wall polygon is projected as a straight line \(\left\{L_{1}^{\left(W^{\left(Z_{a}\right)}\right)},L_{2}^{\left(W^{\left(Z_{a }\right)}\right)},\cdots,L_{b}^{\left(W^{\left(Z_{a}\right)}\right)}\right\}\) on \(V_{horizon}\), and the roof polygon is projected as a roof projection polygon on \(V_{horizon}\). Regular edges \(\left\{\begin{array}{ll}L_{1}^{\left(R^{\left(Z_{a}\right)}\right)},L_{2}^ {\left(R^{\left(Z_{a}\right)}\right)},\cdots,L_{p}^{\left(R^{\left(Z_{a} \right)}\right)}\end{array}\right\}\) of the projection polygon are retained along with irregular curves \(\left\{\begin{array}{ll}S_{1}^{\left(R^{\left(Z_{a}\right)}\right)}, \cdots,S_{q}^{\left(R^{\left(Z_{a}\right)}\right)}\end{array}\right\}\), if they exist (otherwise, the roof has no missing areas). \(p=\left\{1,2,\cdots\right\},q=\left\{1,2,\cdots\right\}\).  
First, by projecting the regular edges \(L^{\left(R\right)}\) of the roof projection polygon associated with subpart \(Z_{a}\) onto the ground plane, we generate the contour constraint polygon \(U^{\left(R\right)}\). As shown in Figure 6a, within the roof projection polygon of subpart \(Z_{a}\), the extension segments \(L_{1}^{\left(R\right)^{\prime}}\) and \(L_{4}^{\left(R\right)^{\prime}}\) are obtained by extending the roof regular edges \(L_{1}^{\left(R\right)}\) and \(L_{4}^{\left(R\right)}\) on the side intersecting with the irregular curve \(S^{\left(R\right)}\) at point \(P_{0}\). Projecting lines passing through \(L_{1}^{\left(R\right)^{\prime}}\) and \(L_{4}^{\left(R\right)^{\prime}}\) along the \(z\)-axis direction onto the roof plane results in intersecting segments \(L_{1}^{\left(R\right)^{\prime\prime}}\) and \(L_{4}^{\left(R\right)^{\prime\prime}}\), which, along with \(S^{\left(R\right)^{\prime}}\), form the contour constraint polygon \(U^{\left(R\right)}\).  
Figure 5: Projection diagram of \(Z_{a}\) onto the horizontal plane \(V_{horizon}\).  
Next, by projecting the wall polygon associated with subpart \(Z_{a}\) onto the ground plane as the straight line \(L^{(W)}\), we generate the contour constraint polygon \(U^{(W)}\). As shown in Figure 6b, within subpart \(Z_{a}\), the wall polygon's projected straight lines \(L_{1}^{(W)}\) and \(L_{4}^{(W)}\), which are closest to the midpoints of \(L_{1}^{(R)^{\prime}}\) and \(L_{4}^{(R)^{\prime}}\), are translated to intersect at points \(P_{1}\) and \(P_{5}\), generating the contour edges \(L_{1}^{(W)^{\prime}}\) and \(L_{4}^{(W)^{\prime}}\) for the missing areas. Then, by projecting \(L_{1}^{(W)^{\prime}}\) and \(L_{4}^{(W)^{\prime}}\) along the \(z\)-axis direction onto the roof plane, we obtain intersecting segments \(L_{1}^{(W)^{\prime\prime}}\) and \(L_{4}^{(W)^{\prime\prime}}\), which, along with \(S^{(R)^{\prime}}\), form the contour constraint polygon \(U^{(W)}\).