# 3D Facial Plastic Surgery Simulation: Based on the Structured Light
## 2 Materials and Methods
### Feature-Based 3D Facial Metamorphosis
#### 2.3.2 Mesh Deformation of 3D Facial Model Based on Finite Element  
The 3D plastic surgery simulation system can use the method of mesh deformation to simulate the surgical effects of microplastic surgery, such as facial filling and fine-tuningfacial features. Since the face structure has a large number of soft tissues, the algorithm should be able to simulate the deformation state of the facial soft tissue. In addition, the accuracy of algorithm deformation should be solved to improve the accuracy of mesh deformation. Based on the above two points, this paper chose the finite element method to deform the mesh. Firstly, the algorithm must analyze the appropriate and stable driving model standards based on the model's morphological characteristics and organizational structure. Then, establish a mapping relationship between the robust driving model and its mesh. Finally, solve the equation according to the deformation control equation to make the driving model drive the mesh to realize deformation [31; 32].  
The key point of the deformation algorithm is how to establish a robust mapping relationship. The key connection between the grid and the driving model can be summarized in the following two points: starting from all the vertex \(q\) of the driving model, find the corresponding vertex \(q^{\prime}\) on the base mesh, and calculate the displacement vectors \(v\) of vertex \(q\) and \(q^{\prime}\).Then, finding the nearest vertex \(q\) to the vertex of the driving model on the base mesh is defined as \(q^{\prime}\). When the simplification ratio of the driving model is \(0<d<1\), the vertex of the driving model can correspond to the vertex of the mesh one by one, and there is no need to calculate the corresponding relationship; when the simplification ratio is not 1, the specific process of solving the vertex \(q\) and the associated positions \(q^{\prime}\) of the driving model is as follows:  
Firstly, find the mesh surface \(N_{S}\) which is closest to the vertex \(q\) of the driving model on the base mesh, the corresponding point \(q^{\prime}\) of vertex \(q\) can be expressed as a linear combination of three vertexes on the triangular surface \(N_{S}\). Considering the time complexity, this paper first uses the method of comparing one by one to find the nearest vertex \(q_{S}\) of the base mesh from vertex \(q\). Then through the topological relationship of the base mesh, find all the triangular surfaces connected to the vertex \(q_{S}\), and calculate the distance between the vertex \(q_{S}\) and each triangle surface; the triangle surface with the smallest distance is \(N_{S}\).  
Assuming that \(q_{1}\), \(q_{2}\) and \(q_{3}\) are the three vertexes of \(N_{S}\), the vertical projection point from \(q\) to \(N_{S}\) is \(q_{p}\), and \(q_{p}\) satisfies the following equations:  
\[q_{p}=aq_{1}+bq_{2}+cq_{3} \tag{4}\]  
\[a+b+c=1 \tag{5}\]  
\[\big{(}q-q_{p}\big{)}\cdot(q_{2}-q_{1})=0 \tag{6}\]  
\[\big{(}q-q_{p}\big{)}\cdot(q_{3}-q_{1})=0 \tag{7}\]  
The values of \(a\), \(b\), and can be calculated by solving the above four formulas, and the position of point \(q_{p}\) can be obtained at the same time. Through the above step, the mapping relationship between the driving model and the triangular mesh can be established, and then the shape of the corresponding mesh can be changed by controlling the driving model; that is, the mesh deformation can be realized.