Reconstruction method and device of three-dimensional model, computer equipment and storage medium

By initializing and reconstructing the particle-spring model, combining parallel computing and graphics processor technology, the problems of insufficient physical authenticity and computing efficiency in the existing technology are solved, and an efficient and stable three-dimensional model reconstruction method is realized, which is suitable for real-time rendering and interactive applications.

CN120472116APending Publication Date: 2025-08-12BEIJING INST OF ARCHITECTURAL DESIGN +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510530310.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

Existing geometric modeling technologies cannot take into account physical authenticity, computing efficiency and real-timeness, especially in the collision detection, dynamic external force response and large-scale parallelization support of complex mesh models, which is difficult to meet the needs of real-time rendering and interactive scenarios.

Method used

By reading the data structure of the original three-dimensional model, initializing the particle-spring model, applying physical force, and performing iterative calculations through a parallel architecture, reconstructing the target particle-spring model to simulate the deformation process of the target object in the physical environment, using the graphics processor for parallel computing and global memory sharing mechanism, dynamically updating the vertex position and reconstructing the mesh topology.

Benefits of technology

It realizes efficient and real physics simulation, meets real-time interaction requirements, ensures the numerical stability and computational efficiency of the model, and provides a high-fidelity, three-dimensional model reconstruction method that conforms to real physics laws.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120472116A_ABST
    Figure CN120472116A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of modeling, and discloses a three-dimensional model reconstruction method and device, computer equipment and a storage medium, and the method comprises the steps: reading a data structure, corresponding to an original three-dimensional model, of a target object; initializing assignment parameters corresponding to a data structure in the original three-dimensional model to obtain a mass point-spring model; physical acting force is applied to all vertexes in the mass point-spring model, iterative calculation of assignment parameters is executed through a parallel architecture, and updated assignment parameters are obtained; and according to the updated assignment parameter, reconstructing the geometric grid of the mass point-spring model to obtain a target mass point-spring model, the target mass point-spring model being used for simulating the deformation process of the geometric shape of the target object in the physical environment. According to the method, the core problem that the physical authenticity, the calculation efficiency and the real-time performance cannot be considered in the existing geometric modeling technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of modeling technology, and in particular to a method, device, computer equipment and storage medium for reconstructing a three-dimensional model. Background Art

[0002] With the rapid development of fields such as computer graphics, virtual reality, and animation, the demand for simulating the deformation of three-dimensional objects in real physical environments is becoming increasingly urgent. Currently, mainstream methods are mainly divided into geometry-based deformation (such as skeletal animation and free-form deformation) and physics-based deformation (such as mass-spring systems and finite element analysis). Geometry-based methods achieve deformation by manipulating control points or bones. Although computationally efficient, they ignore physical properties, resulting in a lack of realism in deformation. Physics-based methods simulate deformation through physical equations. Although highly accurate, they are computationally complex and pose challenges to real-time performance and stability.

[0003] Existing methods have significant shortcomings in balancing physical realism and computational efficiency: geometry-based methods, ignoring mechanical properties, struggle to simulate complex force-dependent behaviors; physics-based methods, limited by high computational complexity, numerical instability, and hardware resource consumption, struggle to meet the demands of real-time interaction. Furthermore, existing technologies lack support for collision detection, dynamic external force response, and large-scale parallelization of complex mesh models, further limiting 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 three-dimensional model reconstruction method, apparatus, computer equipment and storage medium to solve the core problem that existing geometric modeling technology cannot take into account physical authenticity, computational efficiency and real-time performance.

[0005] In a first aspect, an embodiment of the present invention provides a method for reconstructing a three-dimensional model, the method comprising:

[0006] Read the data structure of the original three-dimensional model of the target object;

[0007] Initializing the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model;

[0008] Applying a physical force to each vertex in the mass-spring model, and performing iterative calculation of the assignment parameters through a parallel architecture to obtain updated assignment parameters;

[0009] The geometric mesh of the mass-spring model is reconstructed according to the updated assignment parameters to obtain a 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 a physical environment.

[0010] Furthermore, the initialization of the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model includes:

[0011] Extracting a vertex list, an edge list, and a face list from the data structure;

[0012] Assigning a corresponding mass parameter and a velocity vector to each vertex in the vertex list, and assigning a corresponding dynamic parameter to each edge in the edge list and each face in the face list, to obtain assigned parameters;

[0013] The corresponding mass-spring model is constructed using the assigned parameters corresponding to the data structure in the original three-dimensional model.

[0014] Furthermore, applying a physical force to each vertex in the mass-spring model includes:

[0015] Obtaining a force type applied to a vertex in the mass-spring model;

[0016] Calculating a magnitude corresponding to each of the force types using a graphics processor, and constructing a physical force based on the force types and the corresponding magnitudes;

[0017] The physical force is accumulated to each vertex in the mass-spring model through a global memory sharing mechanism.

[0018] Furthermore, the iterative calculation of the assignment parameters is performed through a parallel architecture to obtain updated assignment parameters, including:

[0019] Generate an update task according to the data structure of the mass-spring model;

[0020] 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;

[0021] Boundary constraints are imposed on vertices in a fixed state in the vertex list, and the first thread block and the second thread block are used to perform iterative calculations of the assignment parameters to obtain updated assignment parameters.

[0022] Furthermore, reconstructing the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain a target mass-spring model includes:

[0023] identifying a geometric mesh of the mass-spring model;

[0024] Recalculating the normal vector of the geometric mesh using the updated assignment parameters to obtain an updated normal vector;

[0025] Monitoring whether the vertex displacement and the number of iterations of the mass-spring model meet the preset convergence conditions;

[0026] When a preset convergence condition is reached, the geometric mesh of the mass-spring model is reconstructed based on the updated normal vector to obtain a target mass-spring model.

[0027] Furthermore, the method further comprises:

[0028] Predicting the motion trajectory of the vertex in the target mass-spring model to obtain a prediction result;

[0029] Screening out potential collision vertices from vertices in the target mass-spring model according to the prediction result;

[0030] A non-penetration 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 using the normal vector of the collision surface to obtain corrected assignment parameters.

[0031] Furthermore, the method further comprises:

[0032] Utilizing a graphics processor to parallelly calculate surface normal vectors and vertex normal vectors in the target mass-spring model;

[0033] Dynamically adjusting the texture coordinates of the corresponding vertex according to the displacement of the vertex normal vector;

[0034] Determining whether there is abnormal mesh deformation in the mass-spring model during the reconstruction process according to the change of the surface normal vector;

[0035] When there is a mesh deformation anomaly, a mesh division operation is re-performed on the geometric mesh of the target mass-spring model.

[0036] In a second aspect, an embodiment of the present invention provides a device for reconstructing a three-dimensional model, the device comprising:

[0037] A reading module is used to read the data structure of the original three-dimensional model corresponding to the target object;

[0038] An initialization module, used to initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model;

[0039] An updating module, configured to apply a physical force to each vertex in the mass-spring model and perform iterative calculation of the assignment parameters through a parallel architecture to obtain updated assignment parameters;

[0040] A reconstruction module is used to reconstruct the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain a 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 a physical environment.

[0041] In a third aspect, an embodiment of the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0043] The method provided in the embodiments of the present application has the following beneficial effects:

[0044] The method provided in the embodiment of the present application ensures the integrity and compatibility of model data by standardizing the parsing of the topological relationships of vertices, edges, and faces, providing a structured basis for subsequent physical property assignment and high-precision calculation; by assigning physical properties such as mass and elastic coefficient to geometric elements, the geometric model is converted into a physical mechanics model, namely a mass-spring model, to achieve a deep fusion of physical laws and geometric deformation, taking into account both computational efficiency and simulation authenticity; uses a parallel architecture to perform distributed calculations on vertex forces and motion equations, significantly reducing the computational time of complex mesh models, breaking through the bottleneck of traditional serial calculations, and meeting real-time interaction requirements while ensuring numerical stability; dynamically updates the vertex positions of the mass-spring model and reconstructs the mesh topology, ensuring the continuity and rationality of the deformation process through physical constraints and energy convergence mechanisms, and ultimately outputs a high-fidelity target mass-spring model that conforms to real physical laws, providing core data support for real-time rendering and interactive applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 is a flowchart of a method for reconstructing a three-dimensional model according to an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of a process flow of a three-dimensional model physical simulation according to an embodiment of the present invention;

[0048] Figure 3 is a structural block diagram of a three-dimensional model reconstruction device according to an embodiment of the present invention;

[0049] Figure 4 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0051] According to an embodiment 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 flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0052] In this embodiment, a method for reconstructing a three-dimensional model is provided. Figure 1 is a flow chart of a method for reconstructing a three-dimensional model according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0053] Step S11 , reading the data structure of the original three-dimensional model corresponding to the target object.

[0054] It should be noted that the target object refers to the object whose geometric form needs to be simulated during deformation in a physical environment. The original 3D model is a digital representation of the target object. A 3D model contains a vertex list, an edge list, and a face list. These data structures fully describe the geometric information of the 3D model and serve as the basis for subsequent calculations and simulations. Relevant data, such as the vertex list, edge list, and face list, is read from the file or data source storing the original 3D model data. Using the appropriate data reading functions or tools, these data structures are extracted from the data source to prepare for subsequent processing and calculations of the 3D model.

[0055] Step S12: Initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model.

[0056] In the embodiment of the present application, step S12 includes the following steps A1-A3:

[0057] Step A1: extract the vertex list, edge list, and face list in the data structure.

[0058] Specifically, after reading the data structure of the original 3D model corresponding to the target object, the vertex list, edge list and face list are retrieved from the data structure storing the 3D model data through specific data access and extraction functions or operations. 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 is the vertex space coordinate, N p is the number of vertices, defining the basic location information of the model. The edge list defines the connections between vertices, represented by E = {(i,j)|i,j∈V}), where i and j are vertex indices in the vertex list V, describing the model's topological structure. The face list defines the vertex indices that make up the mesh faces, such as F = {(i,j,k)|i,j,k∈V}, further clarifying how the model surface is constructed.

[0059] Step A2: assigning a corresponding mass parameter and velocity vector to each vertex in the vertex list, and assigning a corresponding dynamic parameter to each edge in the edge list and each face in the face list, to obtain assigned parameters.

[0060] Specifically, for each vertex in the vertex list, a mass parameter m is assigned according to certain rules (such as uniform setting or calculation based on density and volume). i , and set the initial velocity vector V i (Usually the initial velocity is set to zero vector.) For each edge in the edge list, define the elastic coefficient k according to the requirements of the physical model. ij (Defines the elastic strength between the two vertices connected by the edge), the damping coefficient c ij (simulating energy dissipation) and the 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 refer to the physical property settings associated with the face, which together constitute the assignment parameters.

[0061] Step A3: construct a corresponding mass-spring model using the assigned parameters corresponding to the data structure in the original three-dimensional model.

[0062] Specifically, we treat vertices as mass points and edges as springs connecting them. Combining the extracted data structures (vertex list, edge list, face list) with the resulting assignment parameters, we construct a model based on the principles of a mass-spring system. This means assigning vertex parameters like mass and velocity to the mass points, while assigning edge parameters like the elasticity and damping coefficient to the springs. This creates a mass-spring model that simulates the behavior of objects in a physical environment.

[0063] The mass-spring model is a physical model that treats a mesh as a system of mass points (vertices) and springs (edges). Mass points have properties such as mass and velocity, while springs have properties such as elasticity and damping coefficients. These properties are used to simulate physical behaviors such as deformation and motion, and are used in physical simulation scenarios in computer graphics.

[0064] The method provided in the embodiment of the present application can clearly define the basic components of the model by extracting the vertex list, edge list and face list in the original three-dimensional model data structure, and provide basic data support for subsequent precise 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 can give the model physical properties, realize the transformation from a simple geometric model to a physical model, and more realistically reflect the characteristics of the object. By using these assigned parameters to construct a mass-spring model, a simulation framework that conforms to the laws of physics is established, which can accurately simulate the behavior of the target object in the physical environment, enhance the physical reality and accuracy of the simulation, and is suitable for a variety of scenarios that require simulation of object deformation.

[0065] Step S13 , applying physical force to each vertex in the mass-spring model, and performing iterative calculation of the assignment parameters through a parallel architecture to obtain updated assignment parameters.

[0066] In the embodiment of the present application, applying a physical force to each vertex in the mass-spring model includes the following steps B1-B3:

[0067] Step B1: Obtain the force type applied to the vertex in the mass-spring model.

[0068] Specifically, the type of force acting on the vertices of the mass-spring model is determined by pre-set 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 obtained based on the scenario settings. If wind is present, the wind type is determined by setting relevant parameters. Furthermore, user interaction forces and other force types can be obtained based on user actions in the interactive interface.

[0069] Step B2: Calculate the value corresponding to each force type using a graphics processor, and construct a physical force based on the force type and the corresponding value.

[0070] Specifically, the graphics processing unit (GPU) uses its powerful parallel computing capabilities to calculate the value of each force type according to the corresponding physical formulas and model parameters.

[0071] For gravity, its magnitude and direction are calculated using the following formula:

[0072]

[0073] Among them, m i is the vertex mass and g is the gravitational acceleration vector.

[0074] For spring force, the magnitude of the spring force is calculated according to the following formula:

[0075]

[0076] Among them, k ij is the elastic modulus, x j and x i is the vertex position, L ij is the initial length of the edge.

[0077] For the damping force, the dissipation of energy is simulated according to the following formula:

[0078]

[0079] Among them, (v j -v i ) is the velocity difference between the two vertices; Represents the component of the velocity difference in the side direction.

[0080] After the calculation is completed, the force type and its corresponding value are integrated to construct the actual physical force acting on the vertex. The specific formula is as follows:

[0081]

[0082] Among them, N(i) is the set of adjacent vertices of vertex i.

[0083] In step B3, the physical force is accumulated to each vertex in the mass-spring model through the global memory sharing mechanism.

[0084] Specifically, in a computer system, a global memory sharing mechanism is used to accumulate the various physical forces acting on each vertex to obtain the net force acting on that vertex. This global memory sharing mechanism allows different computing units (such as GPU threads) to access and modify shared memory areas, thereby accurately transmitting force information to each vertex.

[0085] The method provided in the embodiment of the present application enables the system to clearly understand the force situation by obtaining the force type for the vertices in the mass-spring model, providing directional guidance for accurate simulation. The graphics processor is used to calculate the value corresponding to each force type, and the physical force is constructed based on this. With the powerful parallel computing capability of the graphics processor, the computing efficiency is greatly improved, and the effects of various forces can be determined quickly and accurately. The physical force is accumulated to each vertex through a global memory sharing mechanism to ensure the accurate transmission and integration of force information, realize the accurate simulation of the force on the model vertex, make the simulation results more consistent with the actual physical phenomena, and improve the reliability and authenticity of the simulation.

[0086] In the embodiment of the present application, performing iterative calculation of the assignment parameters through a parallel architecture to obtain updated assignment parameters includes the following steps C1-C3:

[0087] Step C1: Generate an update task based on the data structure of the mass-spring model.

[0088] Specifically, an update task is a set of computational tasks that must be performed based on the data structure of the mass-spring model and the requirements of the physical simulation. These tasks include updating parameters such as vertex position and velocity, as well as calculating relevant physical quantities for edges. By executing these tasks, the model state is updated to reflect real-time changes in the object's physical environment.

[0089] Step C2: 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.

[0090] Specifically, the generated update task is divided into two parts using a parallel computing architecture (such as the GPU thread model). This division fully utilizes parallel computing resources and improves computing efficiency.

[0091] Each thread in the first thread block corresponds to a vertex in the vertex list, and calculates the new position of the vertex according to the position update formula based on the resultant force, mass and other information of the vertex:

[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. According to the resultant force and mass of the vertex, the new velocity vector of the vertex is calculated according to the velocity update formula:

[0094]

[0095] in, is the acceleration a of vertex i i .

[0096] Step C3: applying boundary constraints to the vertices in the vertex list that are in a fixed state, and using the first thread block and the second thread block to perform iterative calculations of the assignment parameters to obtain updated assignment parameters.

[0097] Specifically, first, identify the vertices in the vertex list that are in a fixed state (for example, when simulating a suspended object, the vertices connected to the suspension point are usually in a fixed state and their positions cannot change). Then, boundary constraints are applied to these vertices to limit their position changes. Next, the first and second thread blocks are started, and the position and velocity of the vertex are iteratively calculated according to the iterative calculation rules of the physical simulation. In each iteration, the position and velocity of the vertex are updated according to the force on the vertex and the current assignment parameters. After multiple iterative calculations, the updated assignment parameters are obtained.

[0098] The method provided in the embodiment of the present application generates update tasks based on the data structure of the mass-spring model. It can reasonably plan the calculation tasks according to the characteristics of the model itself, thereby improving the pertinence and effectiveness of the calculation. The update task is divided into a first thread block and a second thread block to update the position information and velocity vector of the vertex respectively, making full use of the parallel computing architecture to realize parallel processing of tasks, significantly improving the computing efficiency and speeding up the simulation process. Boundary constraints are applied to vertices in a fixed state, and two thread blocks are used to perform iterative calculations of the assigned parameters, thereby ensuring the accuracy of the boundary conditions of the model during the simulation process. At the same time, the parameters are continuously optimized through iterative calculations, which improves the accuracy and stability of the simulation results and can more accurately simulate the deformation process of the object.

[0099] Step S14 , reconstructing the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain a 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 the embodiment of the present application, step S14 includes the following steps D1-D4:

[0101] Step D1, identifying the geometric mesh of the mass-spring model.

[0102] Specifically, based on the updated assigned parameters, the geometric structure of the mass-spring model is detected and distinguished. By reading data information such as the vertex list, edge list, and face list in the model, the composition and connection relationship of each geometric element (vertices, edges, and faces) in the model are determined, thereby clarifying the geometric mesh form 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 spliced together to form the surface mesh of the entire model.

[0103] Step D2, recalculating the normal vector of the geometric mesh using the updated assignment parameters to obtain an updated normal vector.

[0104] Specifically, for each face in the model (taking the triangle 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 The position vectors of the three vertices of the face are obtained by cross-multiplying the vertex position vectors to obtain the normal vector direction of the face, and then normalized (divided by the modulus length of the vector || (X j -X i )×(X k -Xi)) to get the unit normal vector.

[0107] Average the normal vectors of all adjacent faces containing the vertex. For vertex i, its normal vector is as follows:

[0108]

[0109] Here, F(i) is the set of all faces containing vertex i. This way, the normal vector for the vertex is derived by combining the normal vectors of adjacent faces. During the calculation process, the position of the vertex in the updated assignment parameters is used to determine the basis for the vector calculation, resulting in the updated normal vector.

[0110] Step D3: monitor whether the vertex displacement and the number of iterations of the mass-spring model have reached a preset convergence condition.

[0111] Specifically, first, calculate the position change of each vertex between two adjacent iterations. The formula is as follows:

[0112] δ i =||x i (t+Δt)-x i (t)||

[0113] That is, the position vector x at the current time t+Δti (t+Δt) and the position vector x at the previous time t i (t) The modulus of the difference. Check the position changes of all vertices. If all vertices satisfy δ i <∈ (where ∈ is the set threshold), then the vertex displacement is considered to meet the convergence condition. In addition, 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 times the model is iterated and compare it with the preset maximum number of iterations N max When the number of iterations reaches N max , it is also considered to have reached a convergence condition (to prevent infinite loops).

[0115] Finally, the total energy of the system (including kinetic energy and potential energy) is calculated. When the energy change is less than the set threshold, the convergence condition is also considered to have been met. By monitoring these indicators, it is determined whether the preset convergence condition has been met.

[0116] Step D4: When a preset convergence condition is reached, the geometric mesh of the mass-spring model is reconstructed based on the updated normal vector to obtain a target mass-spring model.

[0117] Specifically, when it is detected that the preset convergence conditions have been reached, the shape and orientation of each face in the model are re-determined based on the updated vertex positions and normal vectors and other information, thereby constructing a target mass-spring model that can accurately reflect the geometric shape of the target object in the current physical simulation state. This process may include confirming and adjusting the topological structure such as the connection relationship between vertices, edges and faces in the mesh 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, Figure 2 As shown in the figure, the process of physical simulation of a three-dimensional model includes: first inputting the original three-dimensional model and reading the data structure of its vertices, edges, and faces; then initializing the assignment parameters of the data structure; then applying external environmental forces and analyzing their impact on each vertex; then iteratively calculating the resultant force, velocity, and position of the vertex through the semi-implicit Euler method, and updating the mesh shape to reconstruct the mass-spring model; then judging whether the preset convergence condition is met, that is, whether the total energy of the system is less than or greater than the threshold; if not, returning to continue iterative force calculation; if met, outputting the reconstructed target mass-spring model, including vertex position, normal vector, and topological structure.

[0119] The method provided in the embodiment of the present application identifies the geometric mesh of the mass-spring model, which helps to clarify the geometric structure of the model and provide a clear object definition for subsequent operations. The normal vector of the geometric mesh is recalculated using the updated assignment parameters so that the normal vector can accurately reflect the current state of the model and provide more accurate geometric information for operations such as rendering. Monitoring whether the vertex displacement and the number of iterations have reached the preset convergence conditions can effectively control the simulation process, avoid unnecessary calculations, and ensure the accuracy and stability of the simulation results. When the preset convergence conditions are reached, the geometric mesh is reconstructed based on the updated normal vector to obtain the target mass-spring model, which can generate an accurate model that conforms to physical laws and simulation requirements and meets the needs of geometric deformation simulation of the target object.

[0120] In an embodiment of the present application, the method further includes:

[0121] Step S21 , predicting the motion trajectory of the vertex in the target mass-spring model to obtain a prediction result.

[0122] In an embodiment of the present application, based on information such as the position, velocity, and physical force of the current vertex in the target mass-spring model, a certain physical model or algorithm is used to infer the motion trajectory of the vertex in the future. For example, the kinematic equation of the particle can be used, combined with the current velocity and acceleration (calculated by the resultant force and mass), to predict the position of each vertex in subsequent time steps through iterative calculation, thereby obtaining a prediction result of the motion trajectory of the vertex. In actual operation, a numerical integration method (such as the semi-implicit Euler method) can be used to solve the motion equation to gradually determine the position of the vertex at different times.

[0123] Step S22: Screening out potential collision vertices from the vertices in the target mass-spring model according to the prediction result.

[0124] In an embodiment of the present application, the future position change of each vertex is analyzed based on the vertex motion trajectory prediction results. Determine whether the vertex is likely to collide with other objects (including other parts of the model itself). For example, by calculating the spatial distance between the position of the vertex on the predicted trajectory and the surrounding objects, if the distance is less than a certain threshold, or meets specific collision detection conditions (such as bounding box intersection, etc.), the vertex is marked as a potential collision vertex. Technologies such as spatial partitioning (such as octree, BVH) and hierarchical bounding boxes can be used to accelerate the collision detection process, and only the parts that may collide are accurately calculated to reduce the amount of calculation, thereby efficiently screening out potential collision vertices.

[0125] Step S23 , applying a non-penetration constraint to the potential collision vertex, and adjusting the potential collision vertex to the collision surface, and correcting the velocity vector and position information of the potential collision vertex using the normal vector of the collision surface to obtain corrected assignment parameters.

[0126] In an embodiment of the present application, a non-penetration constraint is imposed on the potential collision vertices that are screened out to prevent them from penetrating the surface of the object with which they may collide. This means that during the calculation process, it is ensured that the vertex will 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 results of the collision detection and the geometric information of the object surface. The normal vector of the collision surface is used to correct the velocity vector and position information of the potential collision vertex. For example, when a vertex collides with a collision surface, according to the physical principle of the collision, the component of the velocity vector in the direction of the normal vector of the collision surface may change (such as rebound, etc.), 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 information such as the updated position and velocity of the vertex, as well as related physical parameters such as edges and faces.

[0127] The method provided in the embodiment of the present application predicts the motion trajectory of the vertex in the target particle-spring model and obtains a prediction result, which can understand the future state of the model in advance and provide predictive information for subsequent processing. Potential collision vertices are screened out based on the prediction results, and the position where the collision may occur can be accurately located, thereby improving the pertinence and efficiency of collision processing. Non-penetration constraints are imposed on potential collision vertices and adjusted to the collision surface. At the same time, the velocity vector and position information are corrected by the normal vector of the collision surface, effectively avoiding phenomena that do not conform to physical laws such as object penetration, thereby improving the physical rationality and authenticity of the simulation and making the simulation results more consistent with the actual situation.

[0128] In an embodiment of the present application, the method further includes:

[0129] Step S31 : Utilizing a graphics processor to calculate in parallel the surface normal vectors and vertex normal vectors in the target mass-spring model.

[0130] In an embodiment of the present application, the parallel computing capability of a graphics processing unit (GPU) is utilized to distribute the computational tasks of the face normal and vertex normal in the target mass-spring model to multiple threads for parallel execution. For the computation of the face normal, each thread is responsible for one face (e.g., a triangle face). For the computation of the vertex normal, each thread first computes the face normal and then adds it to the relevant vertices. Finally, the vertex normal is normalized. Through this parallel computing method, the face normal and vertex normal of the model can be obtained quickly and efficiently.

[0131] Step S32: Dynamically adjust the texture coordinates of the corresponding vertex according to the displacement of the vertex normal vector.

[0132] In the embodiment of the present application, the displacement of the vertex normal vector in the target mass-spring model is first obtained, that is, 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 means that the geometry of the area 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 issues such as texture stretching and distortion, and make the rendering effect of the model more realistic and natural.

[0133] Step S33: judging whether there is any abnormal mesh deformation in the mass-spring model during the reconstruction process according to the change of the surface normal vector.

[0134] In an embodiment of the present application, during the reconstruction process of the mass-spring model, the changes in the surface normal vector are continuously monitored. Certain thresholds or judgment conditions can be set. When the change in the surface normal vector exceeds these preset standards, it is considered that there may be a mesh deformation anomaly. For example, the angle change and module length change of the surface normal vector between two adjacent iterations are calculated. If these changes are too large, it means that the mesh of the model has undergone a large deformation in this area, and abnormalities such as distortion and folding may have occurred. In this way, the reconstruction process of the model can be monitored and potential problems can be discovered in a timely manner.

[0135] Step S34: When there is a mesh deformation anomaly, re-dividing the geometric mesh of the target mass-spring model.

[0136] In an embodiment of the present application, when it is determined that there is an abnormal mesh deformation in the mass-spring model, the geometric mesh of the target mass-spring model is re-divided. Specifically, it may include redetermining the positions of vertices in the mesh, the connection relationship of edges, and the composition of faces, etc. For example, some mesh division algorithms can be used to divide large mesh units into smaller units, or merge some overly small units according to the current state and deformation of the model, so as to optimize the mesh structure so that it can better adapt to the deformation of the model and improve the accuracy and stability of the simulation. After re-dividing the mesh, it may 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 the embodiment of the present application utilizes a graphics processor to parallelly calculate the surface normal vectors and vertex normal vectors in the target particle-spring model, giving full play to the advantages of the graphics processor, quickly obtaining accurate normal vector information, and providing a basis for subsequent operations. Dynamically adjusting the texture coordinates of the corresponding vertex according to the displacement of the vertex normal vector can effectively prevent problems such as texture stretching and improve the visual effect of model rendering. Judging whether there is mesh deformation anomaly in the reconstruction process of the model based on the change of the surface normal vector can timely discover potential problems and ensure the quality of the model. Re-executing the division operation when there is mesh deformation anomaly can optimize the mesh structure, improve the accuracy and stability of the simulation, and ensure that the model can accurately simulate the deformation process of the target object.

[0138] This embodiment also provides a three-dimensional model reconstruction device, which is used to implement the above-mentioned embodiments and preferred embodiments. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0139] This embodiment provides a three-dimensional model reconstruction device, such as Figure 3 As shown, including:

[0140] A reading module 31 is used to read the data structure of the original three-dimensional model corresponding to the target object;

[0141] Initialization module 32, used to initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model;

[0142] An updating module 33 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 updated assigned 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 a 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 the present application, the initialization module 32 is used to extract the vertex list, edge list and face list in the data structure; 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 assignment parameters; and use the assignment parameters corresponding to the data structure in the original three-dimensional model to construct a corresponding mass-spring model.

[0145] In an optional embodiment of the present 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; use the graphics processor to calculate the corresponding value of each force type, and construct the physical force based on the force type and corresponding value; and accumulate the physical force to each vertex in the mass-spring model through a global memory sharing mechanism.

[0147] The computing submodule is 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; impose boundary constraints on 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 updated assignment parameters.

[0148] In an optional embodiment of the present 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 an updated normal vector; monitor whether the vertex displacement and the number of iterations of the mass-spring model meet the preset convergence conditions; when the preset convergence conditions are met, 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 the present application, the device also includes: a prediction module, which is used to predict the motion trajectory of the vertices in the target mass-spring model to obtain a prediction result; screen out potential collision vertices from the vertices in the target mass-spring model according to the prediction result; impose non-penetration constraints on the potential collision vertices, and adjust the potential collision vertices to the collision surface, and correct the velocity vector and position information of the potential collision vertex through the normal vector of the collision surface to obtain the corrected assignment parameters.

[0150] In an optional embodiment of the present application, the device also includes: a partitioning module for using a graphics processor to parallelly calculate the surface normal vectors and vertex normal vectors in the target mass-spring model; dynamically adjusting the texture coordinates of the corresponding vertex according to the displacement of the vertex normal vector; judging whether there is a mesh deformation anomaly in the reconstruction process of the mass-spring model according to the change of the surface normal vector; when there is a mesh deformation anomaly, re-performing the partitioning operation on the geometric mesh of the target mass-spring model.

[0151] See also Figure 4 , Figure 4 is a structural diagram of a computer device provided by 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 various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0152] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0153] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.

[0154] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created based on the use of a computer device for displaying a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0155] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0156] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0157] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0158] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A three-dimensional model reconstruction method, characterized in that: The method comprises: Read the data structure of the original three-dimensional model of the target object; Initializing the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model; Applying a physical force to each vertex in the mass-spring model, and performing iterative calculation of the assignment parameters through a parallel architecture to obtain updated assignment parameters; The geometric mesh of the mass-spring model is reconstructed according to the updated assignment parameters to obtain a 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 a physical environment.

2. The method according to claim 1, characterized in that Initializing the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model includes: Extracting a vertex list, an edge list, and a face list from the data structure; Assigning a corresponding mass parameter and a velocity vector to each vertex in the vertex list, and assigning a corresponding dynamic parameter to each edge in the edge list and each face in the face list, to obtain assigned parameters; The corresponding mass-spring model is constructed using the assigned parameters corresponding to the data structure in the original three-dimensional model.

3. The method according to claim 1, characterized in that The applying a physical force to each vertex in the mass-spring model includes: Obtaining a force type applied to a vertex in the mass-spring model; Calculating a magnitude corresponding to each of the force types using a graphics processor, and constructing a physical force based on the force types and the corresponding magnitudes; The physical force is accumulated to each vertex in the mass-spring model through a global memory sharing mechanism.

4. The method according to claim 2, characterized in that The iterative calculation of the assignment parameters is performed by a parallel architecture to obtain updated assignment parameters, including: Generate an update task according to 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; Boundary constraints are imposed on vertices in a fixed state in the vertex list, and the first thread block and the second thread block are used to perform iterative calculations of the assignment parameters to obtain updated assignment parameters.

5. The method according to claim 1, wherein The step of reconstructing the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain a target mass-spring model includes: identifying a geometric mesh of the mass-spring model; Recalculating the normal vector of the geometric mesh using the updated assignment parameters to obtain an updated normal vector; Monitoring whether the vertex displacement and the number of iterations of the mass-spring model meet the preset convergence conditions; When a preset convergence condition is reached, the geometric mesh of the mass-spring model is reconstructed based on the updated normal vector to obtain a target mass-spring model.

6. The method according to claim 1, characterized in that The method further comprises: Predicting the motion trajectory of the vertex in the target mass-spring model to obtain a prediction result; Screening out potential collision vertices from vertices in the target mass-spring model according to the prediction result; A non-penetration 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 using the normal vector of the collision surface to obtain corrected assignment parameters.

7. The method according to claim 1, characterized in that The method further comprises: Utilizing a graphics processor to parallelly calculate surface normal vectors and vertex normal vectors in the target mass-spring model; Dynamically adjusting the texture coordinates of the corresponding vertex according to the displacement of the vertex normal vector; Determining whether there is abnormal mesh deformation in the mass-spring model during the reconstruction process according to the change of the surface normal vector; When there is a mesh deformation anomaly, a mesh division operation is re-performed on the geometric mesh of the target mass-spring model.

8. A three-dimensional model reconstruction device, characterized in that: The device comprises: A reading module is used to read the data structure of the original three-dimensional model corresponding to the target object; An initialization module, used to initialize the assignment parameters corresponding to the data structure in the original three-dimensional model to obtain a mass-spring model; An updating module, configured to apply a physical force to each vertex in the mass-spring model and perform iterative calculation of the assignment parameters through a parallel architecture to obtain updated assignment parameters; A reconstruction module is used to reconstruct the geometric mesh of the mass-spring model according to the updated assignment parameters to obtain a 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 a physical environment.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.

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