Methods, apparatus, computer equipment and storage media for reconstructing 3D models
By constructing a parallel architecture of a mass-spring model and using a graphics processor for computation, the problem of balancing physical realism and computational efficiency in existing 3D model reconstruction methods is solved, achieving efficient and realistic 3D model reconstruction suitable for real-time interactive and rendering applications.
Patent Information
- Application Number
- CN202510530310.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2045-04-25
AI Technical Summary
Existing 3D model reconstruction methods have significant shortcomings in balancing physical realism and computational efficiency, making it difficult to meet the needs of real-time interaction, especially in collision detection, dynamic external force response, and large-scale parallelization support for complex mesh models.
By constructing a mass-spring model, iterative calculations of assigned parameters are performed using a parallel architecture of a graphics processor. Combining physical forces and parallel computing, the geometric mesh is reconstructed to simulate the deformation process of an object in a physical environment, and collision detection and non-penetrating constraint processing are performed.
It achieves efficient and realistic 3D model reconstruction, balancing computational efficiency and physical realism, meeting the needs of real-time interaction, and improving the accuracy and stability of the simulation.
Smart Images

Figure CN120472116B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of modeling technology, and specifically to methods, apparatus, computer equipment, and storage media for reconstructing three-dimensional models. Background Technology
[0002] With the rapid development of computer graphics, virtual reality, and animation, the demand for simulating the deformation of 3D objects in realistic physical environments is becoming increasingly urgent. Currently, mainstream methods are mainly divided into geometry-based deformation (such as skeletal animation and free deformation) and physics-based deformation (such as mass-spring systems and finite element analysis). Geometry-based methods achieve deformation by manipulating control points or skeletons; while computationally efficient, they ignore physical properties, resulting in a lack of realism in the deformation. Physics-based methods simulate deformation through physical equations; while highly accurate, they are computationally complex, posing challenges to real-time performance and stability.
[0003] Existing methods suffer from significant shortcomings in balancing physical realism and computational efficiency: geometry-based methods, by neglecting mechanical properties, struggle to simulate complex force behaviors; physics-based methods, limited by high computational complexity, numerical instability, and hardware resource consumption, fail to meet real-time interactive requirements. Furthermore, existing technologies lack sufficient support for collision detection, dynamic external force responses, and large-scale parallelization of complex mesh models, further restricting their application in real-time rendering and interactive scenarios. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, apparatus, computer equipment, and storage medium for reconstructing three-dimensional models to solve the core problem that existing geometric modeling techniques cannot simultaneously achieve physical realism, computational efficiency, and real-time performance.
[0005] In a first aspect, embodiments of the present invention provide a method for reconstructing a three-dimensional model, the method comprising:
[0006] Read the data structure of the original 3D model corresponding to the target object;
[0007] Initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain the mass-spring model;
[0008] Physical forces are applied to each vertex in the mass-spring model, and the iterative calculation of the assigned parameters is performed through a parallel architecture to obtain the updated assigned parameters;
[0009] The geometric mesh of the particle-spring model is reconstructed according to the updated assignment parameters to obtain the target particle-spring model, wherein the target particle-spring model is used to simulate the deformation process of the geometric shape of the target object in the physical environment.
[0010] Furthermore, the initialization of the assignment parameters corresponding to the data structure in the original 3D model to obtain the mass-spring model includes:
[0011] Extract the vertex list, edge list, and face list from the data structure;
[0012] Assign corresponding mass parameters and velocity vectors to each vertex in the vertex list, and assign corresponding dynamic parameters to each edge in the edge list and each face in the face list to obtain the assigned parameters;
[0013] The corresponding mass-spring model is constructed using the assignment parameters corresponding to the data structure in the original three-dimensional model.
[0014] Furthermore, applying physical forces to each vertex in the mass-spring model includes:
[0015] Obtain the type of force applied to the vertices in the mass-spring model;
[0016] The graphics processing unit is used to calculate the magnitude of each force type, and a physical force is constructed based on the force type and the corresponding magnitude.
[0017] The physical forces are accumulated to each vertex in the mass-spring model through a global memory sharing mechanism.
[0018] Furthermore, the step of performing iterative calculations of the assignment parameters through a parallel architecture to obtain the updated assignment parameters includes:
[0019] An update task is generated based on the data structure of the mass-spring model;
[0020] The update task is divided into a first thread block and a second thread block, wherein the first thread block is used to update the position information of each vertex in the vertex list, and the second thread block is used to update the velocity vector of each vertex in the vertex list;
[0021] Boundary constraints are applied to the vertices in the vertex list that are in a fixed state, and the first thread block and the second thread block are used to perform iterative calculations of the assignment parameters to obtain the updated assignment parameters.
[0022] Furthermore, the step of reconstructing the geometric mesh of the mass-spring model based on the updated assignment parameters to obtain the target mass-spring model includes:
[0023] Identify the geometric mesh of the mass-spring model;
[0024] The normal vector of the geometric mesh is recalculated using the updated assignment parameters to obtain the updated normal vector;
[0025] Monitor whether the vertex displacement and the number of iterations of the mass-spring model have reached the preset convergence condition;
[0026] When the preset convergence condition is met, the geometric mesh of the mass-spring model is reconstructed based on the updated normal vector to obtain the target mass-spring model.
[0027] Furthermore, the method also includes:
[0028] The motion trajectory of the vertex in the target mass-spring model is predicted, and the prediction result is obtained.
[0029] Based on the prediction results, potential collision vertices are selected from the vertices in the target mass-spring model;
[0030] A non-penetrating constraint is applied to the potential collision vertex, and the potential collision vertex is adjusted to the collision surface. The velocity vector and position information of the potential collision vertex are corrected by the normal vector of the collision surface to obtain the corrected assignment parameters.
[0031] Furthermore, the method also includes:
[0032] The surface normal vectors and vertex normal vectors in the target mass-spring model are calculated in parallel using a graphics processing unit.
[0033] The texture coordinates of the corresponding vertex are dynamically adjusted based on the displacement of the vertex normal vector.
[0034] Determine whether there is mesh deformation anomaly during the reconstruction of the mass-spring model based on the changes in the surface normal vector;
[0035] When mesh deformation anomalies exist, the geometric mesh of the target mass-spring model is re-partitioned.
[0036] Secondly, embodiments of the present invention provide a three-dimensional model reconstruction apparatus, the apparatus comprising:
[0037] The reading module is used to read the data structure of the original 3D model corresponding to the target object.
[0038] An initialization module is used to initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain the mass-spring model.
[0039] The update module is used to apply physical forces to each vertex in the mass-spring model and perform iterative calculations of the assigned parameters through a parallel architecture to obtain the updated assigned parameters.
[0040] The reconstruction module is used to reconstruct the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain the target mass-spring model, wherein the target mass-spring model is used to simulate the deformation process of the geometric shape of the target object in the physical environment.
[0041] Thirdly, embodiments of the present invention provide a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0042] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that cause a computer to perform the method described in the first aspect or any of its corresponding embodiments.
[0043] The method provided in this application has the following beneficial effects:
[0044] The method provided in this application standardizes the topological relationships of vertices, edges, and faces to ensure the integrity and compatibility of model data, providing a structured foundation for subsequent physical property assignment and high-precision calculation. By assigning physical properties such as mass and elasticity coefficients to geometric elements, the geometric model is transformed into a physical mechanics model, namely a mass-spring model, achieving a deep integration of physical laws and geometric deformation, balancing computational efficiency and simulation realism. A parallel architecture is used to perform distributed calculations of vertex forces and motion equations, significantly reducing the computation time of complex mesh models, breaking through the bottleneck of traditional serial calculations, and meeting real-time interaction requirements while ensuring numerical stability. The vertex positions of the mass-spring model are dynamically updated and the mesh topology is reconstructed. Physical constraints and energy convergence mechanisms ensure the continuity and rationality of the deformation process, ultimately outputting a high-fidelity target mass-spring model that conforms to real physical laws, providing core data support for real-time rendering and interactive applications. Attached Figure Description
[0045] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0046] Figure 1 This is a flowchart illustrating a method for reconstructing a three-dimensional model according to an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the physical simulation process of a three-dimensional model according to an embodiment of the present invention;
[0048] Figure 3 This is a structural block diagram of a three-dimensional model reconstruction device according to an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] According to embodiments of the present invention, a method, apparatus, computer device, and storage medium for reconstructing a three-dimensional model are provided. It should be noted that the steps shown in the flowcharts in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0052] This embodiment provides a method for reconstructing a three-dimensional model. Figure 1 This is a flowchart of a three-dimensional model reconstruction method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0053] Step S11: Read the data structure of the original 3D model corresponding to the target object.
[0054] It's important to note that the target object refers to the object whose geometric shape needs to be simulated during deformation in a physical environment; the original 3D model is its digital representation. The 3D model contains a list of vertices, edges, and faces. These data structures comprehensively describe the geometric information of the 3D model and form the basis for subsequent calculations and simulations. Relevant data, such as the vertex, edge, and face lists, is read from the file or data source storing the original 3D model data. These data structures are extracted from the data source using appropriate data reading functions or tools, preparing for subsequent processing and calculations of the 3D model.
[0055] Step S12: Initialize the assignment parameters corresponding to the data structure in the original 3D model to obtain the mass-spring model.
[0056] In this embodiment of the application, step S12 includes the following steps A1-A3:
[0057] Step A1: Extract the vertex list, edge list, and face list from the data structure.
[0058] Specifically, after reading the data structure of the original 3D model corresponding to the target object, specific data access and extraction functions or operations are used to retrieve the vertex list, edge list, and face list from the data structure storing the 3D model data. The vertex list stores the spatial coordinates of all vertices in the 3D model, such as V = {x l |l=1,2,...,N p}, where x l =(x l ,y l ,z l ) T Let N be the vertex spatial coordinates. p The vertex list defines the basic positional information of the model. The edge list defines the connections between vertices, denoted by E = {(i,j)|i,j∈V}, where i and j are vertex indices in the vertex list V, describing the topological structure of the model. The face list defines the vertex indices that make up the mesh faces, such as F = {(i,j,k)|i,j,k∈V}, which further clarifies how the model surfaces are constructed.
[0059] Step A2: Assign corresponding mass parameters and velocity vectors to each vertex in the vertex list, and assign corresponding dynamic parameters to each edge in the edge list and each face in the face list, thus obtaining the assigned parameters.
[0060] Specifically, for each vertex in the vertex list, a mass parameter m is assigned to it according to certain rules (such as uniform setting or calculation based on density and volume). i And set the initial velocity vector V i (The initial velocity is usually set to zero vector). For each edge in the edge list, the elastic coefficient k is defined according to the requirements of the physical model. ij (Define the elastic strength between two vertices connected by the edge), damping coefficient c ij (Simulated energy dissipation) and initial length L ij (The initial length of the edge is calculated as L) ij =‖X j -X j ||). For each face in the face list, the face's dynamic parameters involve the setting of the face's associated physical properties, which together constitute the assignment parameters.
[0061] Step A3: Construct the corresponding mass-spring model using the assignment parameters corresponding to the data structure in the original 3D model.
[0062] Specifically, vertices are treated as point masses, and edges as springs connecting these mass points. Combining the extracted data structures (vertices, edges, and faces) and the assigned parameters, a model is constructed according to the principle of a point-spring system. That is, parameters such as the mass and velocity of the vertices are assigned to the point masses, and parameters such as the elastic coefficient and damping coefficient of the edges are assigned to the springs, forming a point-spring model capable of simulating the behavior of an object in a physical environment.
[0063] The mass-spring model is a physical model that treats a mesh model as a system composed of mass points (vertices) and springs (edges). The mass points have properties such as mass and velocity, while the springs have properties such as elastic coefficient and damping coefficient. These properties are used to simulate the physical behaviors of objects, such as deformation and motion, and are applied to physical simulation scenes in computer graphics.
[0064] The method provided in this application extracts the vertex list, edge list, and face list from the original 3D model data structure, clearly defining the basic constituent elements of the model and providing fundamental data support for subsequent accurate simulation. Assigning mass parameters and velocity vectors to each vertex in the vertex list, and assigning dynamic parameters to each edge in the edge list and each face in the face list, imbues the model with physical properties, realizing the transformation from a simple geometric model to a physical model and more realistically reflecting the characteristics of the object. Using these assigned parameters to construct a mass-spring model establishes a simulation framework that conforms to physical laws, accurately simulating the behavior of the target object in the physical environment, enhancing the physical realism and accuracy of the simulation, and making it suitable for various scenarios requiring the simulation of object deformation.
[0065] Step S13: Apply physical forces to each vertex in the mass-spring model, and perform iterative calculations of the assigned parameters through a parallel architecture to obtain the updated assigned parameters.
[0066] In this embodiment of the application, applying physical forces to each vertex in the mass-spring model includes the following steps B1-B3:
[0067] Step B1: Obtain the type of force applied to the vertices in the mass-spring model.
[0068] Specifically, the types of forces acting on the apex of the mass-spring model are determined through preset rules or external input information. For example, in a scenario simulating the motion of an object on the Earth's surface, gravity can be automatically acquired based on the scenario settings; if wind is present, the wind type can be acquired through relevant parameter settings; and user interaction forces and other force types can also be acquired based on user actions on the interactive interface.
[0069] Step B2: Calculate the magnitude of each force type using a graphics processor, and construct physical forces based on the force type and its corresponding magnitude.
[0070] Specifically, the graphics processing unit (GPU) uses its powerful parallel computing capabilities to calculate the magnitude of each type of force based on the corresponding physical formulas and model parameters.
[0071] The magnitude and direction of gravity are calculated using the following formula:
[0072]
[0073] Where, m i is the vertex mass, and g is the gravitational acceleration vector.
[0074] The magnitude of the spring force is calculated using the following formula:
[0075]
[0076] Where, k ij It is the elastic coefficient, x j and x i It is the vertex position, L ij It is the initial length of the edge.
[0077] For the damping force, the energy dissipation is simulated according to the following formula:
[0078]
[0079] Among them, (v j -v i () represents the velocity difference between the two vertices; This represents the component of the velocity difference along the side direction.
[0080] After the calculation is completed, the types of forces and their corresponding values are integrated to construct the actual physical forces acting on the vertex. The specific formula is as follows:
[0081]
[0082] Where N(i) is the set of adjacent vertices of vertex i.
[0083] Step B3 involves accumulating the physical forces to each vertex in the mass-spring model through a global memory sharing mechanism.
[0084] Specifically, in computer systems, a global memory sharing mechanism is used to accumulate the various physical forces acting on each vertex, thereby obtaining the resultant force acting on that vertex. This global memory sharing mechanism allows different computing units (such as GPU threads) to access and modify shared memory regions, thus enabling the accurate transmission of force information to each vertex.
[0085] The method provided in this application obtains the force types acting on the vertices of a point-spring model, enabling the system to clearly define the force situation and providing directional guidance for accurate simulation. It utilizes a graphics processing unit (GPU) to calculate the magnitude of each force type and constructs physical forces based on this. Leveraging the powerful parallel computing capabilities of the GPU, computational efficiency is significantly improved, allowing for rapid and accurate determination of the effects of various forces. A global memory sharing mechanism accumulates the physical forces to each vertex, ensuring accurate transmission and integration of force information. This achieves precise simulation of the forces acting on the model vertices, making the simulation results more consistent with actual physical phenomena and improving the reliability and realism of the simulation.
[0086] In this embodiment of the application, the updated assignment parameters are obtained by performing iterative calculations using a parallel architecture, including the following steps C1-C3:
[0087] Step C1: Generate an update task based on the data structure of the point mass-spring model.
[0088] Specifically, the update task is a set of computational tasks that need to be performed, determined based on the data structure of the mass-spring model and the requirements of the physical simulation. These tasks cover updating parameters such as the position and velocity of vertices, as well as calculating relevant physical quantities of edges. By executing these tasks, the model state is updated, enabling it to reflect the real-time changes of the object in the physical environment.
[0089] Step C2 divides the update task into a first thread block and a second thread block. The first thread block is used to update the position information of each vertex in the vertex list, and the second thread block is used to update the velocity vector of each vertex in the vertex list.
[0090] Specifically, by utilizing a parallel computing architecture (such as the thread model of a GPU), the generated update task is divided into two parts. This division fully utilizes parallel computing resources and improves computational efficiency.
[0091] Each thread in the first thread block corresponds to a vertex in the vertex list. Based on information such as the net force and mass acting on the vertex, the new position of the vertex is calculated according to the position update formula:
[0092] x i (t+Δt)=x i (t)+v i(t+Δt)Δt
[0093] Each thread in the second thread block also corresponds to a vertex. Based on the net force and mass acting on the vertex, the new velocity vector of the vertex is calculated according to the velocity update formula:
[0094]
[0095] in, Let a be the acceleration of vertex i. i .
[0096] Step C3: Apply boundary constraints to the vertices in the fixed state in the vertex list, and use the first thread block and the second thread block to perform iterative calculation of the assignment parameters to obtain the updated assignment parameters.
[0097] Specifically, first, vertices in a fixed state are identified from the vertex list (for example, in simulating a suspended object, vertices connected to the suspension point are usually fixed and their positions cannot change). Then, boundary constraints are applied to these vertices to restrict changes in their positions. Next, the first and second thread blocks are started to iteratively calculate the assigned parameters such as the vertex's position and velocity according to the iterative calculation rules of the physics simulation. In each iteration, the vertex's position and velocity parameters are updated based on the forces acting on the vertex and the current assigned parameters. After multiple iterative calculations, the updated assigned parameters are obtained.
[0098] The method provided in this application generates update tasks based on the data structure of a mass-spring model. It can rationally plan computational tasks according to the model's characteristics, improving the relevance and effectiveness of the computation. The update task is divided into a first thread block and a second thread block to update the vertex position information and velocity vector respectively. This fully utilizes a parallel computing architecture to achieve parallel task processing, significantly improving computational efficiency and accelerating the simulation process. Boundary constraints are applied to vertices in a fixed state, and iterative calculations of the assigned parameters are performed using two thread blocks. This ensures the accuracy of boundary conditions during the simulation process. Simultaneously, iterative calculations continuously optimize the parameters, improving the accuracy and stability of the simulation results and enabling more accurate simulation of the object's deformation process.
[0099] Step S14: Reconstruct the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain the target mass-spring model, wherein the target mass-spring model is used to simulate the deformation process of the geometric shape of the target object in the physical environment.
[0100] In this embodiment of the application, step S14 includes the following steps D1-D4:
[0101] Step D1: Identify the geometric mesh of the point-spring model.
[0102] Specifically, based on the updated assignment parameters, the geometric structure of the mass-spring model is detected and differentiated. By reading data such as the vertex list, edge list, and face list in the model, the composition and connection relationships of each geometric element (vertex, edge, face) in the model are determined, thereby clarifying the geometric mesh shape of the model. For example, based on the vertex index information recorded in the face list, the specific composition of each face is determined, and how these faces are pieced together to form the surface mesh of the entire model.
[0103] Step D2: Recalculate the normal vector of the geometric mesh using the updated assignment parameters to obtain the updated normal vector.
[0104] Specifically, for each face in the model (taking the triangular face (i,j,k) as an example), the calculation is performed according to the formula:
[0105]
[0106] Among them, X i X j X k It is the position vector of the three vertices of the face. The normal vector of the face is obtained by the cross product of the vertex position vectors, and then normalized (divided by the magnitude of the vector ||(X)||). j -X i )×(X k -Xi)) yields the unit normal vector.
[0107] The normal vectors of all adjacent faces containing the vertex are averaged. For vertex i, its normal vector is as follows:
[0108]
[0109] Here, F(i) is the set of all faces containing vertex i. In this way, the normal vector of a vertex is obtained by combining the normal vector information of adjacent faces. During the calculation, the vertex position information in the updated assignment parameters is used to determine the basis for vector calculation, thus obtaining the updated normal vector.
[0110] Step D3: Monitor whether the vertex displacement and the number of iterations of the mass-spring model have reached the preset convergence condition.
[0111] Specifically, first, calculate the position change of each vertex between two adjacent iterations, using the following formula:
[0112] δ i =||x i (t+Δt)-x i (t)||
[0113] That is, the position vector x at the current time t+Δt.i (t+Δt) and the position vector x of the previous time t i The modulus of the difference (t). Check the positional changes of all vertices; if δ satisfies this for all vertices... i If the vertex displacement is less than or equal to ∈ (where ∈ is a set threshold), then the vertex displacement is considered to satisfy the convergence condition. Furthermore, the velocity change is: η i =||v i (t+Δt)-v i (t)|| can also be used as an auxiliary basis for judgment.
[0114] Secondly, record the number of iterations performed by the model and compare it with the preset maximum number of iterations N. max Compare the results. When the number of iterations reaches N... max When this happens, it is also considered to have reached a convergence condition (to prevent infinite loops).
[0115] Finally, the total energy of the system (including kinetic and potential energy) is calculated. If the energy change is less than a set threshold, the convergence condition is considered met. By monitoring these indicators, it is determined whether the preset convergence condition has been met.
[0116] Step D4: When the preset convergence condition is met, the geometric mesh of the mass-spring model is reconstructed based on the updated normal vector to obtain the target mass-spring model.
[0117] Specifically, once the preset convergence condition is met, the shape and orientation of each face in the model are redefined based on the updated vertex positions and normal vectors, thereby constructing a target mass-spring model that accurately reflects the geometry of the target object under the current physical simulation state. This process may include confirming and adjusting the topological structure of the mesh, such as the connection relationships between vertices, edges, and faces, to generate a complete and accurate model. The final mass-spring model can be used to simulate the deformation process of the target object's geometry in the physical environment and can be used for subsequent rendering, animation production, or further physical calculations.
[0118] As an example, such as Figure 2 As shown, the process of physical simulation of the 3D model includes: first, inputting the original 3D model and reading its vertex, edge, and face data structures; then, initializing the assignment parameters of the data structures; then, applying environmental external forces and analyzing their impact on each vertex; next, iteratively calculating the resultant force, velocity, and position of the vertices using the semi-implicit Euler method, and updating the mesh shape to reconstruct the mass-spring model; then, determining whether the preset convergence condition has been met, i.e., whether the total energy of the system is less than or greater than a threshold. If not, returning to continue iteratively calculating the forces; if met, outputting the reconstructed target mass-spring model, including vertex positions, normal vectors, and topology.
[0119] The method provided in this application identifies the geometric mesh of a point mass-spring model, which helps to clarify the model's geometric structure and provides a clear object definition for subsequent operations. The normal vectors of the geometric mesh are recalculated using updated assignment parameters, ensuring that the normal vectors accurately reflect the current state of the model and provide more precise geometric information for rendering and other operations. Monitoring vertex displacement and the number of iterations to ensure they meet preset convergence conditions effectively controls the simulation process, avoids unnecessary calculations, and guarantees the accuracy and stability of the simulation results. When the preset convergence conditions are met, the geometric mesh is reconstructed based on the updated normal vectors to obtain the target point mass-spring model. This generates an accurate model that conforms to physical laws and simulation requirements, satisfying the need for simulating the geometric deformation of the target object.
[0120] In this embodiment of the application, the method further includes:
[0121] Step S21: Predict the trajectory of the vertex in the target mass-spring model and obtain the prediction result.
[0122] In this embodiment, based on the position, velocity, and physical forces acting on the current vertex in the target mass-spring model, a certain physical model or algorithm is used to predict the vertex's trajectory over a future period. For example, the kinematic equations of the mass can be used, combined with the current velocity and acceleration (calculated from the net force and mass), to predict the position of each vertex at subsequent time steps through iterative calculations, thereby obtaining the predicted trajectory of the vertex. In practice, numerical integration methods (such as the semi-implicit Euler method) can be used to solve the equations of motion to gradually determine the position of the vertex at different times.
[0123] Step S22: Based on the prediction results, potential collision vertices are selected from the vertices in the target mass-spring model.
[0124] In this embodiment, based on the predicted vertex motion trajectory, the future positional changes of each vertex are analyzed. It is determined whether a vertex is likely to collide with other objects (including other parts of the model itself). For example, by calculating the spatial distance between the vertex's position on the predicted trajectory and surrounding objects, if the distance is less than a certain threshold, or if specific collision detection conditions are met (such as bounding box intersection), the vertex is marked as a potential collision vertex. Spatial partitioning techniques (such as octrees, BVH) and hierarchical bounding boxes can be used to accelerate the collision detection process, performing precise calculations only on parts where collisions are likely, reducing computational load, and thus efficiently filtering out potential collision vertices.
[0125] Step S23: Apply non-penetrating constraints to the potential collision vertices and adjust them to the collision surface. Correct the velocity vector and position information of the potential collision vertices using the normal vector of the collision surface to obtain the corrected assignment parameters.
[0126] In this embodiment, for the screened potential collision vertices, a non-penetration constraint is applied to prevent them from penetrating the surfaces of objects with which they may collide. This means that during the calculation process, it is ensured that the vertices do not enter the space occupied by other objects. The position of the potential collision vertex is adjusted to the surface of the object with which it collides. The specific adjustment method may involve determining the new position based on the collision detection results and the geometric information of the object surface. The velocity vector and position information of the potential collision vertex are corrected using the normal vector of the collision surface. For example, when a vertex collides with the collision surface, according to the physical principle of collision, the component of the velocity vector in the direction of the collision surface normal vector may change (such as bounce), and the velocity vector is adjusted through corresponding calculations. At the same time, the position information of the vertex is updated based on the adjusted velocity vector and time step information. After these operations, the corrected assignment parameters are obtained, including the updated position, velocity, and other information of the vertex, as well as related physical parameters such as edges and faces.
[0127] The method provided in this application predicts the trajectory of vertices in a target mass-spring model, obtaining prediction results that allow for advance understanding of the model's future state and provide predictive information for subsequent processing. Potential collision vertices are selected based on the prediction results, enabling precise location of possible collisions and improving the targeting and efficiency of collision handling. Non-penetrating constraints are applied to potential collision vertices and adjusted to the collision surface. Simultaneously, the velocity vector and position information are corrected using the collision surface normal vector, effectively avoiding phenomena such as object penetration that violate physical laws. This improves the physical rationality and realism of the simulation, making the simulation results more consistent with actual conditions.
[0128] In this embodiment of the application, the method further includes:
[0129] Step S31: Use a graphics processor to calculate the surface normal vector and vertex normal vector in the target mass-spring model in parallel.
[0130] In this embodiment, the parallel computing capabilities of a graphics processing unit (GPU) are utilized to distribute the calculation tasks of face normals and vertex normals in the target mass-spring model across multiple threads for parallel execution. For face normal calculation, each thread is responsible for one face (e.g., a triangle face). For vertex normal calculation, each thread first calculates the face normals and then accumulates them to the relevant vertices. Finally, the vertex normals are normalized. This parallel computing method enables the rapid and efficient acquisition of the model's face and vertex normals.
[0131] Step S32: Dynamically adjust the texture coordinates of the corresponding vertex based on the displacement of the vertex normal vector.
[0132] In this embodiment, the displacement of the vertex normal vector in the target mass-spring model is first obtained, i.e., the change of the vertex normal vector during the simulation process. Then, based on this displacement, the texture coordinates of the corresponding vertex are dynamically adjusted according to certain rules or algorithms. For example, if the displacement of the vertex normal vector is large, it indicates that the geometry of the region where the vertex is located has changed significantly. In this case, the texture coordinates are adjusted accordingly to ensure the correct mapping of the texture on the model surface, prevent visual problems such as texture stretching and distortion, and make the rendering effect of the model more realistic and natural.
[0133] Step S33: Determine whether there is mesh deformation anomaly in the mass-spring model during the reconstruction process based on the change of the surface normal vector.
[0134] In this embodiment, during the reconstruction of the mass-spring model, the changes in surface normal vectors are continuously monitored. Certain thresholds or judgment conditions can be set; when the changes in surface normal vectors exceed these preset standards, it is considered that there may be abnormal mesh deformation. For example, the angle and magnitude changes of the surface normal vectors between two adjacent iterations are calculated. If these changes are too large, it indicates that the model's mesh has undergone significant deformation in that region, possibly exhibiting anomalies such as twisting or folding. This method monitors the model reconstruction process and promptly identifies potential problems.
[0135] Step S34: When there is an anomaly in mesh deformation, the geometric mesh of the target mass-spring model is re-partitioned.
[0136] In this embodiment, when anomalies in the mesh deformation of the mass-spring model are detected, the geometric mesh of the target mass-spring model is re-divided. Specifically, this may include redefining the positions of vertices, edge connections, and face composition within the mesh. For example, mesh generation algorithms can be used to divide large mesh cells into smaller ones or merge excessively small cells based on the model's current state and deformation, thereby optimizing the mesh structure to better adapt to model deformation and improve simulation accuracy and stability. After re-meshing, it may also be necessary to recalculate relevant physical parameters and properties, such as normal vectors, vertex velocities, and positions, to ensure the continuity and correctness of the model.
[0137] The method provided in this application utilizes a graphics processing unit (GPU) to compute the face normals and vertex normals in the target mass-spring model in parallel. This fully leverages the advantages of the GPU to quickly obtain accurate normal vector information, providing a foundation for subsequent operations. Dynamically adjusting the texture coordinates of corresponding vertices based on the displacement of the vertex normals effectively prevents texture stretching and improves the visual effect of model rendering. Determining whether there are mesh deformation anomalies during model reconstruction based on changes in face normals allows for timely detection of potential problems and ensures model quality. Re-performing the mesh partitioning operation when mesh deformation anomalies are present optimizes the mesh structure, improves the accuracy and stability of the simulation, and ensures that the model can accurately simulate the deformation process of the target object.
[0138] This embodiment also provides a three-dimensional model reconstruction apparatus, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0139] This embodiment provides a device for reconstructing a three-dimensional model, such as... Figure 3 As shown, it includes:
[0140] Reading module 31 is used to read the data structure of the original 3D model corresponding to the target object;
[0141] Initialization module 32 is used to initialize the assignment parameters corresponding to the data structure in the original 3D model to obtain the mass-spring model;
[0142] The update module 33 is used to apply physical forces to each vertex in the mass-spring model and perform iterative calculations of the assignment parameters through a parallel architecture to obtain the updated assignment parameters.
[0143] The reconstruction module 34 is used to reconstruct the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain the target mass-spring model, wherein the target mass-spring model is used to simulate the deformation process of the geometric shape of the target object in the physical environment.
[0144] In an optional embodiment of this application, the initialization module 32 is used to extract the vertex list, edge list, and face list from the data structure; assign corresponding mass parameters and velocity vectors to each vertex in the vertex list, assign corresponding dynamic parameters to each edge in the edge list and each face in the face list, and obtain the assigned parameters; and construct the corresponding mass-spring model using the assigned parameters corresponding to the data structure in the original 3D model.
[0145] In an optional embodiment of this application, the update module 33 includes: an application submodule and a calculation submodule;
[0146] The application submodule is used to obtain the force type applied to the vertices in the mass-spring model; it uses the graphics processor to calculate the magnitude of each force type and constructs the physical force based on the force type and the corresponding magnitude; and it accumulates the physical force to each vertex in the mass-spring model through a global memory sharing mechanism.
[0147] The calculation submodule is used to generate update tasks based on the data structure of the mass-spring model. The update tasks are divided into a first thread block and a second thread block. The first thread block is used to update the position information of each vertex in the vertex list, and the second thread block is used to update the velocity vector of each vertex in the vertex list. Boundary constraints are applied to the vertices in the vertex list that are in a fixed state, and the first and second thread blocks are used to perform iterative calculations of the assignment parameters to obtain the updated assignment parameters.
[0148] In an optional embodiment of this application, the reconstruction module 34 is used to identify the geometric mesh of the mass-spring model; recalculate the normal vector of the geometric mesh using the updated assignment parameters to obtain the updated normal vector; monitor whether the vertex displacement and iteration number of the mass-spring model have reached the preset convergence condition; when the preset convergence condition is reached, reconstruct the geometric mesh of the mass-spring model based on the updated normal vector to obtain the target mass-spring model.
[0149] In an optional embodiment of this application, the apparatus further includes: a prediction module, used to predict the motion trajectory of vertices in the target mass-spring model and obtain prediction results; to filter potential collision vertices from the vertices in the target mass-spring model based on the prediction results; to apply non-penetrating constraints to the potential collision vertices and adjust the potential collision vertices to the collision surface; and to correct the velocity vector and position information of the potential collision vertices using the normal vector of the collision surface to obtain corrected assignment parameters.
[0150] In an optional embodiment of this application, the apparatus further includes: a partitioning module, used to use a graphics processor to calculate the surface normal vectors and vertex normal vectors in the target mass-spring model in parallel; dynamically adjust the texture coordinates of the corresponding vertices according to the displacement of the vertex normal vectors; determine whether there is a mesh deformation anomaly in the mass-spring model during the reconstruction process based on the change of the surface normal vectors; and re-perform the partitioning operation on the geometric mesh of the target mass-spring model when there is a mesh deformation anomaly.
[0151] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 4 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system).
[0152] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0153] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0154] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0155] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0156] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0157] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0158] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method of reconstructing a three-dimensional model, characterized by, The method includes: Read the data structure of the original 3D model corresponding to the target object; Initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain the mass-spring model; Physical forces are applied to each vertex in the mass-spring model, and iterative calculations of the assigned parameters are performed through a parallel architecture to obtain updated assigned parameters. The geometric mesh of the particle-spring model is reconstructed according to the updated assignment parameters to obtain the target particle-spring model, wherein the target particle-spring model is used to simulate the deformation process of the geometric shape of the target object in the physical environment; The initialization of the assignment parameters corresponding to the data structure in the original 3D model to obtain the mass-spring model includes: extracting the vertex list, edge list, and face list from the data structure; assigning corresponding mass parameters and velocity vectors to each vertex in the vertex list, and assigning corresponding dynamic parameters to each edge in the edge list and each face in the face list to obtain the assignment parameters; and constructing the corresponding mass-spring model using the assignment parameters corresponding to the data structure in the original 3D model. The step of performing iterative calculations of the assignment parameters through a parallel architecture to obtain updated assignment parameters includes: generating an update task based on the data structure of the mass-spring model; dividing the update task into a first thread block and a second thread block, wherein the first thread block is used to update the position information of each vertex in the vertex list, and the second thread block is used to update the velocity vector of each vertex in the vertex list; applying boundary constraints to vertices in a fixed state in the vertex list, and performing iterative calculations of the assignment parameters using the first thread block and the second thread block to obtain updated assignment parameters; In this first thread block, each thread corresponds to a vertex in the vertex list. Based on the resultant force and mass information of the vertex, the new position of the vertex is calculated according to the position update formula. Each thread in the second thread block also corresponds to a vertex. Based on the net force and mass acting on the vertex, the new velocity vector of the vertex is calculated according to the velocity update formula: in, The acceleration of vertex i ; The step of reconstructing the geometric mesh of the particle-spring model according to the updated assignment parameters to obtain the target particle-spring model includes: identifying the geometric mesh of the particle-spring model; recalculating the normal vector of the geometric mesh using the updated assignment parameters to obtain the updated normal vector; monitoring whether the vertex displacement and iteration number of the particle-spring model have reached a preset convergence condition; and when the preset convergence condition is reached, reconstructing the geometric mesh of the particle-spring model based on the updated normal vector to obtain the target particle-spring model.
2. The method according to claim 1, characterized in that, Applying physical forces to each vertex in the mass-spring model includes: Obtain the type of force applied to the vertices in the mass-spring model; The graphics processing unit is used to calculate the magnitude of each force type, and a physical force is constructed based on the force type and the corresponding magnitude. The physical forces are accumulated to each vertex in the mass-spring model through a global memory sharing mechanism.
3. The method according to claim 1, characterized in that, The method further includes: The motion trajectory of the vertex in the target mass-spring model is predicted, and the prediction result is obtained. Based on the prediction results, potential collision vertices are selected from the vertices in the target mass-spring model; A non-penetrating constraint is applied to the potential collision vertex, and the potential collision vertex is adjusted to the collision surface. The velocity vector and position information of the potential collision vertex are corrected by the normal vector of the collision surface to obtain the corrected assignment parameters.
4. The method according to claim 1, characterized in that, The method further includes: The surface normal vectors and vertex normal vectors in the target mass-spring model are calculated in parallel using a graphics processing unit. The texture coordinates of the corresponding vertex are dynamically adjusted based on the displacement of the vertex normal vector. Determine whether there is mesh deformation anomaly during the reconstruction of the mass-spring model based on the changes in the surface normal vector; When mesh deformation anomalies exist, the geometric mesh of the target mass-spring model is re-partitioned.
5. A device for reconstructing a three-dimensional model, characterized in that, The device includes: The reading module is used to read the data structure of the original 3D model corresponding to the target object. An initialization module is used to initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain the mass-spring model. The update module is used to apply physical forces to each vertex in the mass-spring model and perform iterative calculations of the assigned parameters through a parallel architecture to obtain the updated assigned parameters. The reconstruction module is used to reconstruct the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain the target mass-spring model, wherein the target mass-spring model is used to simulate the deformation process of the geometric shape of the target object in the physical environment; The initialization module is specifically used to extract the vertex list, edge list, and face list from the data structure; assign a corresponding mass parameter and velocity vector to each vertex in the vertex list, and assign a corresponding dynamic parameter to each edge in the edge list and each face in the face list to obtain the assigned parameters; and construct the corresponding mass-spring model using the assigned parameters corresponding to the data structure in the original 3D model. The update module is specifically used to generate an update task based on the data structure of the mass-spring model; divide the update task into a first thread block and a second thread block, wherein the first thread block is used to update the position information of each vertex in the vertex list, and the second thread block is used to update the velocity vector of each vertex in the vertex list; apply boundary constraints to the vertices in the vertex list that are in a fixed state, and use the first thread block and the second thread block to perform iterative calculation of the assignment parameters to obtain the updated assignment parameters; In this first thread block, each thread corresponds to a vertex in the vertex list. Based on the resultant force and mass information of the vertex, the new position of the vertex is calculated according to the position update formula. Each thread in the second thread block also corresponds to a vertex. Based on the net force and mass acting on the vertex, the new velocity vector of the vertex is calculated according to the velocity update formula: in, The acceleration of vertex i ; The reconstruction module is specifically used to identify the geometric mesh of the mass-spring model; recalculate the normal vector of the geometric mesh using the updated assignment parameters to obtain the updated normal vector; monitor whether the vertex displacement and iteration number of the mass-spring model have reached the preset convergence condition; when the preset convergence condition is reached, reconstruct the geometric mesh of the mass-spring model based on the updated normal vector to obtain the target mass-spring model.
6. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Graphics processing unit based discrete simulation computation method of multicomponent system
CN101727653A
Particle spring structure based universal garment three-dimensional model simulation method and system
CN105354879A
