## 3 Algorithm Implementation
### Watermark Embedding  
The watermark information embedding process is shown in Figure 4.  
The watermark embedding steps are as follows:  
**Step 1**: Firstly, considering element addition and deletion in the BIM data, the stable structure elements, such as curtain walls, floor slabs, and walls, in the BIM data are identified for use as watermark carriers. The center point \(V_{i}\) of the enclosing box of each element is calculated using Equation (1) in Section 2.2, and added to the set \(V\), expressed as \(V=\{V_{1},V_{2},\ldots,V_{n}\}\), \(V_{i}=(X_{i},Y_{i},Z_{i})\), where \(n\) is the total number of watermark carrier elements. Secondly, taking into account the loss of coordinate accuracy and the aggregation characteristics of the BIM data, to establish the mapping relationship of the watermark for each element, a high decimal point of the coordinates of elements is selected according to Equation (2) in Section 2.4.  
Figure 4: The watermark information embedding process.  
Figure 3: Watermarked images before and after disarray.  
Finally, the elements are tested for movement, and the movable elements are added to the set \(S_{1}\), denoted as \(S_{1}=\{V_{1},V_{2},\ldots,V_{N}\}\), where \(N\) is the number of movable elements. The center points of the immovable elements are added to the set \(S_{2}\), denoted as \(S_{2}=\{V_{1},V_{2},\ldots,V_{M}\}\), where \(M\) is the number of immovable elements. The sum of \(M\) and \(N\) is the total number of elements \(n\).  
**Step 2**: The movable elements are perturbed in the X-axis directions to represent the watermark information using the parity of the X coordinates of the elements. To maintain the integrity and usability of the BIM data, perturbing elements in the \(Z\)-axis direction is avoided, as this may cause model generation errors. Firstly, the coordinate position is determined according to _Key_, and secondly, all the elements in the set \(S_{1}\) are traversed and perturbed according to Equation (5), which specifies the perturbation method. The elements are perturbed when the calculated value of the coordinate setting position does not match with the corresponding watermark information bit in order to embed the watermark information.  
\[X_{i}^{\prime}=\left\{\begin{array}{l}X_{i_{r}}\mod(X_{i}\times 10^{k},2)=W_{Index _{i}}\\ X_{i}+10^{-k},\mod(X_{i}\times 10^{k},2)\
eq W_{Index_{i}},W_{Index_{i}}=1\\ X_{i}-10^{-k},\mod(X_{i}\times 10^{k},\ 2)\
eq W_{Index_{i}},W_{Index_{i}}=0 \end{array}\right. \tag{5}\]  
where \(X_{i}^{\prime}\) denotes the coordinates of the element in \(S_{1}\) after embedding the watermark information, \(k\) is the watermark information embedding location, and \(Index_{i}\) and \(W_{Index_{i}}\) denote the watermark index and watermark bit, respectively.  
**Step 3**: The invisible characters are embedded into the immovable image elements of set \(S_{2}\). Before embedding the invisible characters, the invisible character code \(U\) is set to be embedded, and the attribute field of the element is set according to _Key_. Each immovable image element is iterated in the set \(S_{2}\), and the invisible character is embedded according to Equation (6) if the corresponding watermark bit is 1 and the attribute field of the image element does not already contain the invisible character \(U\). If the attribute field of the image element already contains the invisible character \(U\), no operation is performed.  
\[C_{j}^{\prime}=C_{j}+U \tag{6}\]  
where \(C_{j}\) is the original attribute field of the element in the set \(S_{2}\), \(C_{j}^{\prime}\) is the attribute field after embedding invisible characters, and \(U\) is the invisible character.