Explosion animation generation method and device, processing equipment, program product and medium
By constructing a directed acyclic graph and topological sorting, the problem of generating explosion animations that conform to physical assembly logic and are collision-free in existing technologies is solved, realizing efficient and intelligent explosion animation generation and improving the logical consistency and physical realism of the animation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE (JIANGXI) VIRTUAL REALITY TECH CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-07-14
Smart Images

Figure CN122391425A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method, apparatus, processing equipment, program product, and medium for generating explosion animations. Background Technology
[0002] With the rapid development of Virtual Reality (VR), industrial design, product assembly guidance, and digital display, exploded view and exploded animation generation technologies for 3D models have become key tools for improving design visualization, optimizing assembly processes, and enhancing user interaction. Especially in virtual simulation education and training, such as in scenarios like complex mechanical structure disassembly, assembly process simulation, and maintenance manual generation, exploded views clearly show the internal structure of a product and the assembly relationships of its parts, while exploded animations, by dynamically unfolding parts and displaying their spatial relationships, greatly enhance visualization and operational guidance, helping users quickly understand the internal structure of a product.
[0003] However, existing technologies for automatically generating exploded views from 3D models still have many shortcomings, making it difficult to generate explosion animations that conform to physical assembly logic and are collision-free. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, processing equipment, program product, and medium for generating explosion animations, in order to solve the problem of how to generate explosion animations that conform to physical assembly logic and are collision-free.
[0005] One embodiment of this application provides a method for generating explosion animation, the method comprising:
[0006] Based on the three-dimensional model of the target assembly, determine the explosive deployment direction of each component of the target assembly;
[0007] Based on the explosion direction of each component, a directed acyclic graph is constructed. The nodes of the directed acyclic graph represent the components, and the edges of the directed acyclic graph represent the disassembly sequence constraints between the components.
[0008] Based on the acyclic graph, determine the explosion sequence of each component;
[0009] Based on the explosion direction and explosion sequence of each component, an explosion animation corresponding to the target assembly is generated.
[0010] Optionally, determining the explosion unfolding direction of each component of the target assembly based on the three-dimensional model of the target assembly includes:
[0011] Based on the three-dimensional model, the voxel information corresponding to the target assembly is obtained. The voxel information is used to characterize the spatial coordinates and occupancy status of each voxel occupied by each component.
[0012] Based on the voxel information, the explosion deployment direction of each component is determined.
[0013] Optionally, determining the explosion deployment direction of each component based on the voxel information includes:
[0014] Based on the voxel information, it is determined whether each first component has a contact surface with the second component. The first component is any component of the target assembly, and the second component is any other component on the target assembly other than the first component.
[0015] When there is a contact surface between the first component and the second component, the least squares method is used to calculate the explosion deployment direction of the first component;
[0016] In the absence of a contact surface between the first component and the second component, principal component analysis is used to calculate the explosion development direction of the first component.
[0017] Optionally, constructing a directed acyclic graph based on the explosion unfolding direction of each component includes:
[0018] Calculate the bounding box of the target assembly based on the voxel information;
[0019] Each of the components is moved along its respective explosion direction until each component is outside the enclosure box;
[0020] Obtain the spatial collision relationships between the various components after they have been moved;
[0021] Based on the aforementioned spatial collision relationships, the directed acyclic graph is constructed.
[0022] If the spatial collision relationship indicates that the third component collides with the fourth component during movement, then a directed edge is established in the directed acyclic graph pointing from the fourth component to the third component.
[0023] Optionally, determining the explosion unfolding sequence of each component based on the directed acyclic graph includes:
[0024] Calculate the in-degree of each node in the directed acyclic graph;
[0025] Initialize the target queue and add each node with an in-degree of zero to the target queue;
[0026] Repeat the following steps until the target queue is empty:
[0027] The first node is taken out from the target queue and added to the explosion deployment sequence. The first node is the head element of the target queue. The order of the elements in the explosion deployment sequence represents the explosion deployment order of each component.
[0028] The target in-degree of the neighboring nodes of the first node in the directed acyclic graph is obtained by subtracting one from the in-degree of the neighboring nodes.
[0029] If the target in-degree is zero, the neighbor node is added to the target queue.
[0030] Optionally, generating the explosion animation corresponding to the target assembly based on the explosion direction and explosion sequence of each component includes:
[0031] Initialize the initial explosion coefficient of each of the aforementioned components;
[0032] According to the explosion unfolding sequence, target components are obtained one by one, and the target components are the components to be processed at the moment.
[0033] The target stopping position of the target component is determined based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion development direction of the target component.
[0034] Based on the starting position of the target component, the target stopping position of the target component, and the explosion deployment direction of the target component, the motion trajectory of the target component is generated;
[0035] Based on the motion trajectory of each component, an explosion unfolding animation corresponding to the target assembly is generated.
[0036] Optionally, determining the target stopping position of the target component based on its initial explosion coefficient, its starting position, and its explosion deployment direction includes:
[0037] The endpoint position of the target component is determined based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion unfolding direction of the target component.
[0038] If the target component collides with the fifth component during its movement from the starting position to the ending position, the initial explosion coefficient of the target component is reduced to obtain a first explosion coefficient. Based on the first explosion coefficient, the starting position of the target component, and the explosion direction of the target component, the ending position of the target component is determined until the target component does not collide with the fifth component during its movement from the starting position to the ending position.
[0039] If the target component does not collide with the fifth component during its movement from the starting position to the ending position, then the ending position is determined as the target stopping position of the target component.
[0040] The fifth component refers to any other component on the target assembly besides the target component.
[0041] One embodiment of this application also provides an explosion animation generation apparatus, the apparatus comprising:
[0042] The first processing module is used to determine the explosion unfolding direction of each component of the target assembly based on the three-dimensional model of the target assembly.
[0043] The first construction module is used to construct a directed acyclic graph based on the explosion unfolding direction of each component. The nodes of the directed acyclic graph represent the components, and the edges of the directed acyclic graph represent the disassembly sequence constraints between the components.
[0044] The second processing module is used to determine the explosion unfolding sequence of each component based on the acyclic graph.
[0045] An explosion generation module is used to generate an explosion animation corresponding to the target assembly based on the explosion direction and explosion sequence of each component.
[0046] One embodiment of this application also provides a processing device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the explosion animation generation method as described in any of the preceding claims.
[0047] One embodiment of this application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the explosion animation generation method as described in any of the preceding claims.
[0048] One embodiment of this application also provides a readable storage medium, wherein a program is stored on the readable storage medium, and when the program is executed by a processor, it implements the steps in the explosion animation generation method as described in any of the preceding claims.
[0049] At least one of the above-mentioned technical solutions of this application has the following beneficial effects:
[0050] In the explosion animation generation method of this application embodiment, by constructing a directed acyclic graph, the spatial physical constraints between components on the target assembly are transformed into logical disassembly sequence relationships. This automatically derives the explosion sequence of each component without the need for manual pre-setting of complex hierarchical orders. This not only lowers the operational threshold but also greatly improves generation efficiency and intelligence. By using a directed acyclic graph with disassembly sequence constraints as directed edges to determine the explosion unfolding order of components, the derived explosion sequence is logically self-consistent on the time axis and free from circular dependencies. The resulting animation demonstration has strict temporal sequence and avoids collisions between components during model disassembly. Since the explosion sequence is determined based on the objective spatial constraints between components, the animation generated based on this logic can realistically reflect the interference structure and assembly process inside the assembly, making the unfolding process of components conform to physical assembly logic and improving the physical realism of the animation demonstration. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating an explosion animation generation method according to one embodiment of this application;
[0052] Figure 2 This is a schematic diagram of the three-dimensional model preprocessing process according to one embodiment of this application;
[0053] Figure 3 This is a schematic diagram illustrating the calculation process for the explosive unfolding direction of a component according to one embodiment of this application;
[0054] Figure 4 This is a flowchart illustrating the main technical process of one embodiment of this application;
[0055] Figure 5 This is a complete technical flowchart of one embodiment of this application;
[0056] Figure 6 This is a schematic diagram of the structure of an explosion animation generation device according to one embodiment of this application. Detailed Implementation
[0057] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, and the number of objects is not limited; for example, the first object can be one or more.
[0058] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0059] In the embodiments of this application, the term "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0060] It should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0061] In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.
[0062] In addition, the terms "system" and "network" are often used interchangeably in this article.
[0063] Related technical introduction:
[0064] Traditional manual generation of exploded diagrams is inefficient and difficult to adapt to varying model structures; therefore, automated exploded diagram generation algorithms have become a research focus. Existing technical solutions for automatically generating exploded diagrams from 3D models mainly include the following types:
[0065] (1) Generation of exploded animations based on pre-configured settings during the modeling stage (e.g., 3ds Max, CATIA, etc.). In this method, during the 3D model modeling stage, such as in UG or Pro / E, the explosion levels and explosion unfolding order of each part are generated semi-automatically by manually pre-defining the assembly constraint feature library and hierarchical structure of the model, thereby generating exploded views and explosion animations of the 3D model. However, this method is cumbersome to operate, relies on manual configuration, has a low degree of automation, and low production efficiency. In particular, the explosion animation effect depends on the professional level of the 3D model maker. If non-professionals manually set the explosion levels, incorrect explosion effects are likely to occur (e.g., not exploding layer by layer according to the gear meshing sequence), making it difficult to meet the needs of batch generation of exploded view models.
[0066] (2) Automatic generation of exploded model animation based on principal component analysis. In this method, the initial coordinates and hierarchical relationships of the parts are obtained by traversing the hierarchical structure of the 3D model. Then, the geometric principal axis direction of the parts is calculated by principal component analysis and used as the explosion unfolding direction of the parts to automatically generate the explosion animation. However, the explosion unfolding direction generated by this method depends on the geometric shape and ignores the physical assembly constraints of the parts. Especially in parts with multiple contact surfaces, the principal axis direction is generally the assembly direction. In such cases, using the geometric principal axis direction as the explosion unfolding direction can easily cause collisions between parts. Moreover, this method is difficult to calculate the explosion hierarchy of the parts. The explosion unfolding animation is too simple and cannot demonstrate the assembly sequence of the parts, which is difficult to meet the needs of education and training.
[0067] (3) Generation of explosion animation based on geometric calculation and collision detection. In this method, the explosion offset is first calculated based on the distance from the center point of the 3D model to the center of the bounding box; then, the minimum bounding box is generated based on the position and size of the parts in the 3D model, and the bounding box is used to perform trial explosions in various directions and to detect the bounding box collisions in a loop until the explosion direction is obtained through collision detection; finally, the explosion unfolds based on the explosion direction and offset of the part bounding box to generate the exploded diagram and animation of the 3D model. However, in this method, the determination of the explosion unfolding direction of each part requires traversing the positions and bounding boxes of the other parts and performing collision detection, which consumes a lot of computing resources and is slow to generate. For complex assemblies (such as multi-part nested devices), if continuous collision detection is used to determine the explosion direction, it may cause the system to freeze due to excessive computation, or even fall into an infinite loop and fail to find an effective collision-free direction.
[0068] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0069] This application addresses the problem of how to generate explosion animations that conform to physical assembly logic and are collision-free by providing a method, apparatus, processing equipment, program product, and medium for generating explosion animations.
[0070] like Figure 1 As shown, one embodiment of this application provides a method for generating explosion animation, including:
[0071] Step 101: Determine the explosion unfolding direction of each component of the target assembly based on the three-dimensional model of the target assembly;
[0072] Step 102: Construct a directed acyclic graph based on the explosion unfolding direction of each component. The nodes of the directed acyclic graph represent the components, and the edges of the directed acyclic graph represent the disassembly sequence constraints between the components.
[0073] Step 103: Determine the explosion unfolding sequence of each component based on the acyclic graph.
[0074] Step 104: Generate an explosion animation corresponding to the target assembly based on the explosion direction and explosion sequence of each component.
[0075] In this embodiment, by constructing a directed acyclic graph, the spatial physical constraints between components on the target assembly are transformed into logical disassembly sequence relationships. This allows for the automatic derivation of the explosion sequence of each component without the need for manually pre-setting complex hierarchical orders. This not only lowers the operational threshold but also significantly improves generation efficiency and intelligence. By using a directed acyclic graph with disassembly sequence constraints as directed edges to determine the explosion unfolding order of components, the derivation order is ensured to be logically self-consistent on the timeline and free from circular dependencies. The resulting animation demonstration has a strict temporal sequence, avoiding collisions between components during model disassembly. Since the explosion sequence is determined based on the objective spatial constraints between components, the animation generated based on this logic can realistically reflect the interference structure and assembly process inside the assembly, making the unfolding process of components conform to physical assembly logic and enhancing the physical realism of the animation demonstration.
[0076] In some embodiments, step 101 above, namely determining the explosive deployment direction of each component of the target assembly based on the three-dimensional model of the target assembly, includes:
[0077] (i) Based on the three-dimensional model, obtain the voxel information corresponding to the target assembly. The voxel information is used to characterize the spatial coordinates and occupancy status of each voxel occupied by each component.
[0078] Here, after importing the 3D model, it needs to be preprocessed to obtain the voxel information corresponding to the target assembly.
[0079] Specifically, such as Figure 2 As shown, firstly, the computer-aided design (CAD) library is used to directly identify the component nodes of the 3D model and construct a component node array; secondly, each component is voxelized, and the spatial voxel position (i.e., the spatial coordinates of the voxel) and occupancy information (i.e., the occupancy status) of the component are recorded; finally, based on the spatial voxel occupancy information, a global occupancy map of the 3D model voxels (i.e., the voxel information corresponding to the target assembly mentioned above) is constructed to complete the 3D model preprocessing.
[0080] In one optional example, the specific operation of voxelizing the parts is as follows: The model space is divided using a uniform mesh, with the smallest spatial unit being a voxel. The size of a single voxel can be preset according to the actual situation, such as... The model dimensions are determined. Each component of the model is rasterized individually according to a fixed voxel size, and its voxel position is marked. Each voxel has spatial coordinates... Three coordinate components. After voxelization preprocessing for each component, the voxel occupancy status of the entire space can be obtained. The storage status of each voxel is defined as empty and occupied, marked with 0 and 1 respectively, i.e., empty (0) and occupied (1).
[0081] Assuming the three-dimensional model has There are 10 parts, and each part is divided into 10 parts. Individual elements, then for the first Each component, its vertex coordinates can be represented as a... voxel matrix :
[0082]
[0083] in, Indicates the first The first component The spatial coordinates of voxels and their occupancy status. of Spatial coordinate components, express The voxel occupancy status is generally 0 or 1.
[0084] (ii) Determine the explosion deployment direction of each component based on the voxel information.
[0085] In this embodiment, a voxelization preprocessing method is used to convert the complex 3D model into voxels, which enables the continuous surface to be discretized into spatial mesh units, obtaining the voxel information corresponding to the target assembly (equivalent to a global occupancy map of the 3D model voxels). In this way, by voxelizing the 3D model, the computational complexity of subsequent contact / collision detection algorithms can be effectively reduced, thereby achieving second-level explosion unfolding animation generation.
[0086] For example, by using curvature-driven dynamic resolution control combined with GPU-parallel voxel generation and an octree-bitmap hybrid storage structure, efficient preprocessing of 3D models can be achieved, significantly reducing the computational complexity of contact / collision detection and spatial relationship analysis, and breaking through the performance bottleneck of traditional triangular mesh computation. Experiments show that this method can reduce the complexity of contact detection for 3D model parts from... Down to .
[0087] It should be noted that traditional methods use bounding boxes (AABB / OBB) to simplify 3D models for collision detection. Since the bounding box (AABB) is only constructed along the coordinate axes, it cannot tightly enclose rotating or irregular objects, resulting in a collision detection error rate as high as 15%-30%. For complex geometric features such as gear meshing surfaces and curved seals, the bounding box oversimplifies the boundaries (e.g., approximating curved surfaces with cubes), leading to low accuracy (error > 5mm) and easy omission of complex contact surfaces (such as gear meshing surfaces).
[0088] In this application, the method for high-precision voxelization conversion of 3D models significantly improves the accuracy and efficiency of collision detection through microscopic geometric restoration, physical attribute fusion, and hybrid storage optimization. By automatically refining voxels with curvature adaptive resolution, the geometric error can be controlled within 0.1mm, achieving a 50% improvement in accuracy compared to bounding boxes. Furthermore, this method is based on a voxel distance threshold (…). Directly calculating the contact surface reduces the complexity to ( (The number of contact elements), which is 3 times faster than bounding box collision detection.
[0089] like Figure 3 As shown, after preprocessing the 3D model, the next step is to solve for the explosive unfolding direction of the parts.
[0090] In some embodiments, determining the explosion deployment direction of each component based on the voxel information includes:
[0091] Based on the voxel information, it is determined whether each first component has a contact surface with a second component. The first component is any component of the target assembly, and the second component is any other component on the target assembly other than the first component.
[0092] Specifically, distance detection can be used to calculate the contact points (i.e., voxel contact points) of components.
[0093] For example, the formula for calculating the minimum Euclidean distance between a component (e.g., the first component) and its adjacent component (e.g., the second component) is as follows:
[0094]
[0095] in, This represents the minimum Euclidean distance between the voxels of the two components. , Two parts and voxel matrix, and These are the first two parts. , Individual element spatial coordinates.
[0096] Component contact determination rules:
[0097]
[0098] in, The result of the contact surface determination. Let be the side length of a single voxel. If the minimum Euclidean distance between two component voxels... Less than If so, then these two voxel points are determined to be contact points.
[0099] Collect parts All contact voxels and corresponding original normal vectors between (e.g., the first component) and other components (e.g., the second component):
[0100]
[0101]
[0102] in, For parts The set of all contact points, For the number of contact points, Indicates components The Spatial coordinates of a contact voxel; For parts The set of original unit normal vectors corresponding to the contact point. Indicates at point The unit normal vector pointing to the contact voxel of the adjacent component.
[0103] Depending on whether the first component is in contact with the second component, there are two possible scenarios:
[0104] Case 1: When there is a contact surface between the first component and the second component, the least squares method is used to calculate the explosion development direction of the first component.
[0105] That is to say, after obtaining the parts After determining the set of contact points between a component (e.g., the first component) and other components (e.g., the second component), the number of contact points is then determined. This indicates that the components There are contact surfaces with other components. In order to fit the optimal solution of the normal vector of multiple contact surfaces, this application can use the Ordinary Least Square (OLS) method to solve for the optimal explosion deployment direction, so that the direction strictly matches the physical disassembly sequence of the three-dimensional model, and ensures that the interference of the component movement path is minimized.
[0106] For example, to minimize the interference energy, i.e., maximize the consistency between the separation direction and the normal vector, the objective function is listed below:
[0107]
[0108] The objective function is equivalent to:
[0109]
[0110] The constraints are as follows: ( Components (the unit vector of the explosion's unfolding direction). The number of the original unit normal vectors at the contact point. Indicates at point The unit normal vector pointing to the contact voxel of the adjacent component.
[0111] The objective function is optimized to construct the scattering matrix:
[0112]
[0113] in, Let be a symmetric positive semi-definite covariance matrix, and let represent the covariance matrix of the contact normal vector.
[0114] Optimize the objective function using the scattering matrix:
[0115]
[0116] Again Perform eigenvalue decomposition:
[0117]
[0118] in, An orthogonal matrix with column vectors These are eigenvectors, and all are unit vectors; It is an eigenvalue diagonal matrix ( ).
[0119] Solving for the results The largest eigenvalue The corresponding feature vectors are then subjected to orientation correction to ensure... The angle between the average contact normal vector and the average contact normal vector is Between. The formula for calculating the average contact normal vector is as follows:
[0120]
[0121] in, and All are components The set of original unit normal vectors corresponding to the contact point Elements. Orientation correction components. The unit vector of the explosion's unfolding direction:
[0122]
[0123] in, Indicates when and The included angle is In between, If it is the optimal solution; otherwise, This is the optimal solution.
[0124] By following the above process, the explosion direction controlling each component can be calculated using the least squares method. .
[0125] Scenario 2: When there is no contact surface between the first component and the second component, principal component analysis is used to calculate the explosion development direction of the first component.
[0126] After obtaining the parts After collecting the contact points with other components, the number of contact points is determined. This indicates that the components There is no contact with any component. In this case, Principal Component Analysis (PCA) can be used to calculate the component... The voxel matrix itself is used to extract the geometric principal axis directions as its explosion unfolding directions. The implementation process consists of the following four steps:
[0127] ①According to the parts voxel matrix The formula for calculating the center of a point set is as follows:
[0128]
[0129] in, For parts The spatial coordinates of the center of the voxel point set, For the first The first component Individual element spatial coordinates, For parts Total number of voxels.
[0130] ② To eliminate the influence of centroid offset and ensure that PCA only analyzes shape distribution, the spatial coordinates of each voxel are transformed into centered coordinates, and a covariance matrix is constructed. The formula for the covariance matrix is as follows:
[0131]
[0132] in, Let the covariance matrix be a symmetric positive semidefinite matrix, which is obtained here by... voxels Transform into centralized coordinates.
[0133] ③ Based on the covariance matrix, calculate its eigenvalues and corresponding unit eigenvectors. The calculation formulas are as follows:
[0134]
[0135] in, For eigenvalues, For the corresponding unit eigenvector, because Since it is a symmetric positive semi-definite matrix, it has at most three eigenvalues, all of which are greater than or equal to 0. , Corresponding unit eigenvector .
[0136] ④ For unit eigenvectors By performing a weighted summation, the components can be obtained. The direction of the explosion can be represented as:
[0137]
[0138] in, Components The unit vector of the explosion's unfolding direction. It is an explosive unfolding strength parameter used to control the components. Along the first The explosion expansion ratio in each principal component direction, the parameter size can be customized, generally... .
[0139] By following the four steps above, the explosion propagation direction controlling each component can be calculated using principal component analysis. .
[0140] In the above steps, an empty set determination mechanism for the contact surface relationship set is introduced to dynamically select the explosion direction calculation strategy: for the empty set case, principal component analysis is used to extract the geometric principal axes; for the non-empty set case, the least squares method is used to fit the optimal solution of the multi-contact surface normal vectors. In this way, the shortcomings of traditional PCA, which only relies on geometric shape to calculate the explosion unfolding direction and ignores physical assembly constraints, are solved, and the limitations of traditional manual direction specification are overcome.
[0141] It should be noted that by adding contact surface analysis between initial components (i.e., analyzing the contact constraint relationships between components in voxel space), the physical assembly constraints of each component are obtained; then, based on the physical assembly constraints, either principal component analysis (PCA) or least squares method is selected to calculate the explosion deployment direction of the components. In other words, this application employs a dual-modal direction solver, including least squares mode and PCA mode, to optimize the deviation between the direction vector and the contact surface normal, ensuring direction stability; simultaneously, the principal component directions of the contact region are extracted to adapt to the surface features. This approach not only reduces unnecessary calculations for explosion-collision detection but also ensures that the explosion direction more closely matches the actual physical assembly direction.
[0142] In this embodiment, voxel information (voxel matrices of each component) corresponding to the target assembly is obtained through preprocessing. The minimum Euclidean distance between voxels of the components is calculated using the voxel matrices, thereby obtaining the voxel contact point set of each component. Based on this, the calculation method for the explosion deployment direction of the components is determined, and finally, the initial explosion deployment direction of each component in the 3D model is obtained. Unlike the traditional method of directly using principal component analysis, this application adopts a polymorphic contact-driven deployment method. That is, by judging whether there is a contact surface between the components (whether the contact point set is empty), the method to determine the explosion deployment direction of the components is determined (if it is not empty, the least squares method is used to determine the explosion deployment direction of the components; otherwise, principal component analysis is used to calculate it). In this way, the explosion deployment direction algorithm can be optimized and the physical assembly constraints can be enhanced.
[0143] The explosion propagation direction of each component was calculated. Then, the components are subjected to an over-limit explosive test to obtain the topological sorting (TopoSort) between the components.
[0144] Here, "over-limit test explosion" means unfolding the components beyond the bounding box of the overall model.
[0145] The topological sorting in this step involves obtaining a directed acyclic graph based on collisions between components. If component A encounters component B during the over-explosive unfolding, then A is ranked after B in the topological sort (i.e., B is A's predecessor). This method applies a topological sorting algorithm to determine the order of component unfolding, resolving the temporal conflict problem in the hierarchical unfolding of 3D model components.
[0146] In some embodiments, constructing a directed acyclic graph based on the explosion unfolding direction of each of the components includes:
[0147] (i) Calculate the bounding box of the target assembly based on the voxel information, that is, calculate the bounding box of the overall model.
[0148] First, the axis-aligned bounding box (AABB) of the entire model is calculated to define the baseline range for the over-explosion. The bounding box is defined by the minimum and maximum corner points. The formula can be expressed as:
[0149]
[0150]
[0151] in, This refers to the total number of parts; For the first 100 components, of which... ; For parts A voxel matrix containing the positions of all voxels of the component; The position coordinates of a voxel are represented as a three-dimensional vector. ,in, These are the coordinates of the voxel on the x, y, and z axes, respectively; For components Take the minimum value of the x-coordinate among all voxels (similarly for the y and z coordinates); For components Take the maximum value of the x-coordinate from all voxels (similarly for the y and z coordinates); The coordinates of the smallest corner point of the overall model bounding box are a three-dimensional vector. The coordinates of the largest corner point of the overall model bounding box are a three-dimensional vector.
[0152] This step allows you to output the bounding box of the 3D model. Size by and definition.
[0153] (ii) Move each of the components along its respective explosion direction until each component is outside the enclosure.
[0154] Here, an over-limit explosive movement is executed, affecting each component. Along its explosion direction Move until completely outside the bounding box Distance traveled To ensure that all voxels are outside the bounding box, the following formula can be used:
[0155]
[0156]
[0157] in, For parts The direction of the explosion is a unit vector (i.e., The direction has been pre-calculated; For parts The distance traveled is a scalar; For the enclosure The diameter is defined as the maximum length of the bounding box in the x, y, and z axis directions: ,in, yes The x-component (similarly, , correspond (y and z components). For example, a small positive number (e.g., (Vocillary size), used to ensure that the parts completely extend beyond the bounding box after movement, avoiding boundary situations; For the moved parts A voxel matrix, where each voxel position is determined by its original position. Add displacement get.
[0158] This step yields the shifted voxel matrix. For all All components were simultaneously moved to the over-limit position.
[0159] (iii) Obtain the spatial collision relationship between the various components after they have been moved.
[0160] Inspect each pair of components at the location following the excessive explosion. (in Whether a collision occurs. Here, a collision is defined as the intersection of the moved voxel matrices. This can be expressed by the following formula:
[0161]
[0162] in, This is a collision indication function that returns 1 to indicate a component. and If a collision occurs after the move, a return value of 0 indicates no collision. The intersection of voxel matrices is such that if there exists at least one voxel position... At the same time belong to and Then the intersection is nonempty (i.e. ), For component indexing, and .
[0163] This step allows you to obtain all collision pairs. The set of, where Collision detection is symmetrical: .
[0164] (iv) Based on the spatial collision relationship, construct the directed acyclic graph; wherein, if the spatial collision relationship indicates that the third component collides with the fourth component during movement, then a directed edge is established in the directed acyclic graph pointing from the fourth component to the third component.
[0165] Based on the collision detection results, construct a directed graph. In this context, vertices represent components, and edges represent topological dependencies. If component A encounters component B during an overflow, then A is ranked after B in the topological sort; therefore, an edge is added. (That is, B points to A). Topological dependencies are represented as follows:
[0166] Vertex set All components, i.e. ;
[0167] Edge set For each pair in ,if Then add an edge. arrive . .
[0168] in, It is a directed graph containing a set of vertices. and edge set Let be the set of vertices of a graph, where each vertex corresponds to a component. Let be the set of directed edges of a graph, where each edge represents a topological dependency; Let it be a directed edge, from point to The meaning is: in an over-limit explosion, It was bumped while moving ,therefore In topological sorting, it should be located at After that (i.e.) yes (the precursor).
[0169] This step outputs a directed acyclic graph. This is used for subsequent topological sorting.
[0170] In some embodiments, determining the explosion unfolding sequence of each component based on the directed acyclic graph includes:
[0171] Calculate the in-degree of each node in the directed acyclic graph; initialize the target queue and add each node with an in-degree of zero to the target queue; repeat the following steps until the target queue is empty:
[0172] Step 1: Take out the first node from the target queue and add the first node to the explosion deployment sequence. The first node is the first element of the target queue. The order of the elements in the explosion deployment sequence represents the explosion deployment order of each component.
[0173] Here, the order of elements in the explosion unfolding sequence is the same as the order of explosion unfolding of components, i.e., the order of explosion layer unfolding.
[0174] Step 2: Subtract one from the in-degree of the neighboring nodes of the first node in the directed acyclic graph to obtain the target in-degree of the neighboring nodes.
[0175] Step 3: If the target in-degree is zero, add the neighbor node to the target queue.
[0176] In the above embodiments, collision relationships between components are detected through over-limit test explosions (moving components beyond the model bounding box along the explosion direction). After constructing a constrained directed graph (i.e., a directed acyclic graph), a hierarchical explosion sequence (i.e., an explosion unfolding sequence) is generated based on topological sorting. This method combines physical collision detection with graph theory sorting, overcoming the limitation of traditional exploded graphs relying on manually specified order.
[0177] In a specific example, based on a directed acyclic graph Perform a topological sort to obtain a linear sequence (i.e., an exploded unfolded sequence) such that all dependencies are satisfied (i.e., if edges exist). ,but Appeared Previously, Kahn's algorithm (based on in-degree) was used for sorting. The implementation process of this algorithm is as follows:
[0178] First, calculate each vertex in-degree: .
[0179] Next, initialize the queue. (i.e., the target queue): contains all vertices with an in-degree of 0, i.e. Sort list Initially an empty list.
[0180] Then execute the iterative process until... Empty: From Take a vertex from ,Will Add to At the end. For each neighbor satisfy :reduce in-degree: ;if Then join in .
[0181] Final check result: If ,but It is a valid topologically sorted sequence; if If a cycle exists in the graph, the topological sorting will fail.
[0182] in, As vertices in-degree, that is, the degree pointing to Number of edges This is a queue (first-in, first-out data structure) used to store vertices with an in-degree of 0. The topological sorting result (i.e., the exploded unfolding sequence) is a sequence of parts. ,in It's the first one (the very first). It's the last one. For the currently processed vertex (from) (taken out from the middle) for The neighboring vertices satisfy the condition that there exists an edge. (Right now ) For list The length (i.e., the number of sorted parts) This represents the total number of parts.
[0183] Output sequence of topological sorting The explosion order is indicated as follows: the first component in the sequence is removed first (no dependencies), and the last component is removed last (most dependencies). In the sequence, if... exist Previously, it indicated that in the explosion Should be in Previously moved.
[0184] In this embodiment, a topological sorting algorithm is used to construct a directed acyclic graph of the complex assembly, automatically generating an explosion hierarchy sequence of components that matches the physical assembly order. This method ensures that components are unfolded strictly according to hierarchical relationships, optimizes the generation effect of the explosion hierarchy sequence of the complex assembly model, and significantly enhances the realism and learnability of the explosion unfolding animation.
[0185] After obtaining the explosion unfolding direction of each component in the 3D model and the output sequence of topological sorting (Indicating the order of explosion unfolding) After that, collision-free explosion unfolding can be achieved by dynamically adjusting the explosion coefficient.
[0186] For example, let the topological sort sequence (representing the order of explosive unrolling) be... ,in, The first to explode (least dependent) If the final explosion (which has the highest dependency) occurs, then the specific implementation method of this application for optimizing the explosion endpoint position (i.e., determining the target stopping position of the target component) may include the following steps:
[0187] (1) Initialize parameters and define the initial explosion coefficient and position for each component.
[0188] (2) Sequential explosion processing. Parts can be moved one by one according to the topological order (i.e. the explosion unfolding order). If a part collides with a moved part, the explosion coefficient is reduced until there is no collision before continuing.
[0189] (3) Process all parts in a loop, that is, repeat step (2) on the remaining parts until all parts are processed. Processing complete. The termination condition is as follows: and The explosion was completed.
[0190] In some embodiments, step 104, namely generating the explosion unfolding animation corresponding to the target assembly based on the explosion unfolding direction and the explosion unfolding sequence of each component, includes:
[0191] Step 1041: Initialize the initial explosion coefficient of each component.
[0192] For example, the initialization formula is as follows:
[0193]
[0194]
[0195]
[0196] in, For parts In the The explosion coefficient (scalar) at the next iteration; The global initial explosion coefficient (e.g.) (diameter of the enclosure box). for The initial voxel matrix (assembly position); for The current voxel matrix (dynamically updated); This is a collection of parts that have successfully exploded without collision (initially empty).
[0197] After initialization, it needs to be performed according to the topological sequence. Traverse each component (from arrive ), dynamically adjust its explosion coefficient.
[0198] Step 1042: According to the explosion unfolding sequence, acquire the target components one by one, where the target components are the components to be processed.
[0199] Step 1043: Determine the target stopping position of the target component based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion deployment direction of the target component.
[0200] In some specific embodiments, step 1043, namely determining the target stopping position of the target component based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion deployment direction of the target component, includes: determining the moving endpoint position of the target component based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion deployment direction of the target component; if the target component collides with a fifth component during its movement from the starting position to the moving endpoint position, the initial explosion coefficient of the target component is reduced to obtain a first explosion coefficient, and the moving endpoint position of the target component is determined based on the first explosion coefficient, the starting position of the target component, and the explosion deployment direction of the target component, until the target component does not collide with the fifth component during its movement from the starting position to the moving endpoint position; if the target component does not collide with the fifth component during its movement from the starting position to the moving endpoint position, the moving endpoint position is determined as the target stopping position of the target component; wherein, the fifth component is any component on the target assembly other than the target component.
[0201] For example, firstly, based on the initial explosion coefficient, the displacement vector of the component can be calculated, which can be expressed as the following formula:
[0202]
[0203] in, For parts The displacement vector, for The direction of the explosion (unit vector). The explosion factor (when the component is moved for the first time) (where the initial explosion coefficient is...)
[0204] Secondly, based on the obtained displacement vector, moving the component and detecting whether it collides with the moved component can be expressed as the following formula:
[0205]
[0206]
[0207] in, For parts The temporary position of the voxel matrix after movement; Let be the collision indication function, where, express With any component collision; This indicates no collision.
[0208] if This indicates that there is a collision between parts at the endpoint, and the collision needs to be reduced. Then move again until there is no collision. Explosion coefficient. The adjustment formula is as follows:
[0209]
[0210] in, To adjust the iteration count counter ( ); The explosion coefficient attenuation factor (e.g.) ).
[0211] Finally, the endpoint position of the voxel matrix when the component is collision-free is obtained, the temporarily moved matrix position is fixed, and the component is... Add to collection The processing method is as follows:
[0212]
[0213]
[0214] Step 1044: Based on the starting position of the target component, the target stopping position of the target component, and the explosion deployment direction of the target component, generate the motion trajectory of the target component;
[0215] Step 1045: Generate an explosion unfolding animation corresponding to the target assembly based on the motion trajectory of each component.
[0216] For example, the explosion initiation points of each component of the 3D model can be obtained through the above steps. (i.e., starting position), explosion endpoint (i.e., the target's stopping position) and the direction vector of the explosion. And the topological sequence of the explosion unfolding of each component. (That is, the order in which the explosions unfold) (The first explosion unfolds).
[0217] Using linear spline interpolation, the explosion unfolding animation trajectory of each component of a 3D model can be generated.
[0218] In a specific example, the method for generating an exploded unfolding animation (i.e., a 3D model explosion animation) corresponding to the target assembly may include the following steps:
[0219] ① Calculate the displacement vector
[0220] First, calculate the displacement vector from the starting point to the ending point for each component. Since the movement of a component is rigid body movement, its center of mass displacement can be directly used to represent the overall displacement. The calculation formula is as follows:
[0221]
[0222] in, For parts The voxel matrix at the starting point (assembly location); For parts At the voxel matrix at the endpoint (post-explosion location); To calculate the voxel matrix The centroid of the point set is given by the formula: ; For parts The displacement vector (three-dimensional vector).
[0223] ②Generation time-displacement function
[0224] Define a time-displacement function for each component to control the animation trajectory. Use easing functions to achieve smooth acceleration / deceleration effects.
[0225] First, calculate the time parameter, the... The formula for calculating the time parameters of each component is as follows:
[0226]
[0227]
[0228]
[0229] in, for Animation start time (seconds); for The duration of the animation (in seconds); for The animation end time (in seconds); n is the number of parts in the 3D model; For topological delay factor (e.g.) ); The displacement distance (scalar) has a magnitude of This is the distance influence factor, which can be set by the user, and is generally 0.2.
[0230] After completing the time parameter calculation, the displacement vector calculated in step ① can be used as a reference. Calculate the easing function using the following formula:
[0231]
[0232] in, For animation time ( ). For easing function ( ), often using secondary easing: or (Slowing down effect).
[0233] ③ Generate keyframe trajectories
[0234] For each component, generate on the timeline Keyframe positions. To ensure smooth animation, usually... That is, at least 30 frames per second. The calculation formula is as follows:
[0235]
[0236]
[0237] in, For the first The time points of each keyframe; For parts In time A set of voxels; For keyframe indexing ( The starting frame; (End frame).
[0238] ④ Combined animation sequence
[0239] The keyframes are combined in chronological order to generate the complete animation. The formula for combining the keyframes in chronological order is as follows:
[0240]
[0241]
[0242] in, For time Animation frames; For rendering voxel sets For image; For time The corresponding keyframe index (rounded down).
[0243] Through the above embodiments, the explosion unfolding animation can be generated automatically without the need for preset by a 3D model editor, reducing the production cycle and effectively reducing computational complexity. Moreover, the explosion unfolding direction and unfolding sequence conform to the physical assembly sequence of the object. At the same time, by adjusting the easing function and time parameters, a visually natural explosion effect is achieved. Finally, the animation can be exported as a video or interactive 3D visualization format.
[0244] In the above embodiments, the minimum safe movement distance (based on the overall bounding box size and the largest component size) is determined by a dynamic distance calculation model, and a directed constraint graph is constructed based on the collision relationship in the over-limit explosion (if component A collides with component B, a directed edge B→A is established to represent the assembly priority). Subsequently, the constraint graph is sorted by physical perception topology sorting. When a circular dependency occurs, the loop is resolved by sub-sorting according to the component quality or spatial position to generate a conflict-free disassembly and assembly sequence. Finally, a layered explosion strategy is executed, and the components are unfolded layer by layer according to the topological order. Components in the same layer move synchronously to the target position, realizing efficient and collision-free explosion animation generation.
[0245] like Figure 4 As shown, the explosion animation generation method provided in this application mainly consists of the following steps: three-dimensional model preprocessing, solving the explosion unfolding direction of the parts, constructing the layered unfolding sequence of the explosion of the parts, optimizing the explosion endpoint position, and generating a three-dimensional model explosion animation.
[0246] like Figure 5 As shown, in the complete process of the explosion animation generation method in this embodiment, after importing the 3D model, the component nodes of the model are identified, and each component is voxelized to construct a global occupancy map of the 3D model voxels. Then, by judging whether the set of contact points is empty (that is, judging whether the component has a contact surface with other components), the method to calculate the explosion unfolding direction is determined. Then, an over-limit test explosion is performed according to the component unfolding direction, and the component dependency relationship is constructed according to the test explosion results (that is, a directed acyclic graph), thereby generating the topological sort of the components and constructing a set of explosion unfolding levels for each component. Then, the explosion endpoint (that is, the movement endpoint position) of the component is calculated according to the unfolding level and the explosion coefficient, and it is judged whether there is a collision, until all components do not collide with other components. The layer order of each component and the set of explosion endpoints are constructed, and the explosion animation trajectory of each component is generated using linear interpolation to generate the 3D model explosion animation.
[0247] It should be noted that existing technical solutions primarily employ manual marking and predefined methods to achieve the orderly explosive unfolding of 3D model components. This is not only inefficient and unable to meet the explosive unfolding requirements of large-scale complex assemblies, but also relies on engineers' experience to pre-determine the sequence, easily overlooking implicit assembly constraints, resulting in explosive unfolding that does not conform to physical reality.
[0248] In this embodiment, fully automated and high-precision explosion sequence generation is achieved. An assembly directed graph is automatically constructed using physical collisions as constraints, and the optimal unfolding sequence is output after topological sorting, completely replacing the manual pre-set process. Simultaneously, it can satisfy the ordered explosion unfolding of large batches of unpre-set 3D assembly parts, conforming to physical realism. When parts need to be added, deleted, or adjusted, the topological sorting of the parts is automatically updated without the need for manual re-sorting.
[0249] In the above embodiments, in response to the pain points of high production costs and low efficiency that the current immersive content industry urgently needs to address, an AI method for generating explosion unfolding animations based on the least squares method and topological sorting can significantly improve animation production efficiency, widely adapt to various 3D models, and reduce development costs by more than 60%.
[0250] To address the problems of long production cycles, high algorithm complexity, lack of physical verification, and explosion path interference in traditional 3D model explosion animation production, this application, unlike traditional manual presets or heuristic rules, introduces a topological sorting algorithm to constrain the explosion order of parts. Through dependency resolution of a Directed Acyclic Graph (DAG), it ensures that the unfolding sequence strictly follows the physical assembly logic. Furthermore, this application abandons the traditional mechanical application of principal component analysis to calculate the explosion direction of parts. Instead, by detecting the contact surface set of parts, it introduces the least squares method to calculate the explosion unfolding direction of parts in the case of multiple contact surfaces.
[0251] The explosion animation generation method provided in this invention is mainly applicable to scenarios such as virtual simulation training, digital twins, and industrial design. For example, in virtual simulation vocational training scenarios, dynamic disassembly can replace physical hands-on practice, solving the safety and cost bottlenecks in training for high-risk equipment; in digital twin simulation scenarios, real-time data can drive the exploded view, enabling visualization of fault prediction and maintenance decisions; in industrial design scenarios, assembly logic constraints can be used for verification, compressing product iteration cycles and improving manufacturability.
[0252] It should be noted that this invention addresses the core requirements of real-time and universality of 3D exploded animation in functional modules such as equipment cognition and model disassembly in virtual simulation education and training, industrial design, product assembly guidance, and digital display. It proposes an exploded animation generation method based on the synergy of least squares and topological sorting. By integrating high-precision voxelization (Voxel) processing of 3D models, spatial decoupling algorithms driven by principal component analysis, topological sorting under multiple constraints, and dynamic smoothing control of linear spline interpolation, a fully automated framework is constructed from model analysis to exploded unfolding animation generation. Compared to traditional manual modeling or script-based generation methods, this application achieves, for the first time, collision-free adaptive layered unfolding of arbitrarily complex structural models, supporting second-level topological calculation of 3D models of teaching and training equipment, industrial equipment, and precision instruments.
[0253] It should also be noted that in the field of industrial equipment maintenance and training, traditional methods rely on manual creation of disassembly animations and on-site guidance, with production cycles lasting from weeks to months and incurring high costs (the cost of creating an animation for a single complex piece of equipment exceeds $50,000). Furthermore, static tutorials cannot respond to user operations in real time, resulting in a 15%-20% risk of incorrect operation. Using the explosion animation generation method provided in this application, high-precision interactive disassembly animations can be generated automatically, replacing manual animation creation and on-site guidance. The cost of generating an animation per instance is reduced by 60%, while the high-precision interactive disassembly animations help technicians more accurately grasp the equipment structure, improving maintenance efficiency and operational safety.
[0254] In the field of product design and marketing, traditional methods rely on static exploded diagrams or pre-rendered videos to showcase product structure. Manual modeling and animation generation requires 40-80 man-hours per component. However, the exploded animation generation method provided in this application enables fully automated AI generation, achieving 5 man-hours per component, a more than 10-fold efficiency improvement. At automotive sales promotion events, the exploded disassembly animation of a car transmission increased customer dwell time by 4 times, and the order conversion rate in e-commerce scenarios increased from 5% to 21%. Furthermore, this application can also be provided to companies through a Software as a Service (SaaS) service.
[0255] The explosion animation generation method described in this application constructs a directed acyclic graph based on the 3D model of the target assembly, which can automatically deduce the explosion unfolding sequence of the parts, avoiding logical errors that may occur when manually pre-setting the sequence. Since the disassembly sequence is determined based on the objectively existing constraints between the parts, the generated animation strictly follows the physical assembly logic, ensuring the continuity of the parts' movement during the animation process and effectively preventing collisions or jamming between parts during unfolding. Thus, the automation and intelligence of explosion animation generation are achieved, significantly improving development efficiency and providing accurate and intuitive virtual simulation data for product assembly process analysis.
[0256] like Figure 6 As shown, one embodiment of this application also provides an explosion animation generation apparatus, the apparatus comprising:
[0257] The first processing module 610 is used to determine the explosion unfolding direction of each component of the target assembly based on the three-dimensional model of the target assembly.
[0258] The first construction module 620 is used to construct a directed acyclic graph based on the explosion unfolding direction of each component. The nodes of the directed acyclic graph represent the components, and the edges of the directed acyclic graph represent the disassembly sequence constraints between the components.
[0259] The second processing module 630 is used to determine the explosion unfolding sequence of each component based on the acyclic graph.
[0260] The explosion generation module 640 is used to generate an explosion animation corresponding to the target assembly based on the explosion direction and explosion sequence of each component.
[0261] In this embodiment, by constructing a directed acyclic graph, the spatial physical constraints between components on the target assembly are transformed into logical disassembly sequence relationships. This allows for the automatic derivation of the explosion sequence of each component without the need for manually pre-setting complex hierarchical orders. This not only lowers the operational threshold but also significantly improves generation efficiency and intelligence. By using a directed acyclic graph with disassembly sequence constraints as directed edges to determine the explosion unfolding order of components, the derivation order is ensured to be logically self-consistent on the timeline and free from circular dependencies. The resulting animation demonstration has a strict temporal sequence, avoiding collisions between components during model disassembly. Since the explosion sequence is determined based on the objective spatial constraints between components, the animation generated based on this logic can realistically reflect the interference structure and assembly process inside the assembly, making the unfolding process of components conform to physical assembly logic and enhancing the physical realism of the animation demonstration.
[0262] Optionally, the first processing module 610 includes:
[0263] A voxel processing unit is used to obtain voxel information corresponding to the target assembly based on the three-dimensional model. The voxel information is used to characterize the spatial coordinates and occupancy status of each voxel occupied by each component.
[0264] The first processing unit is used to determine the explosion deployment direction of each component based on the voxel information.
[0265] Optionally, the first processing unit includes:
[0266] The first processing subunit is used to determine, based on the voxel information, whether each first component has a contact surface with a second component, wherein the first component is any component of the target assembly, and the second component is any other component on the target assembly other than the first component;
[0267] The second processing subunit is used to calculate the explosion deployment direction of the first component by using the least squares method when there is a contact surface between the first component and the second component.
[0268] The third processing subunit is used to calculate the explosion development direction of the first component by using principal component analysis when there is no contact surface between the first component and the second component.
[0269] Optionally, the first building module 620 includes:
[0270] The second processing unit is used to calculate the bounding box of the target assembly based on the voxel information.
[0271] The third processing unit is used to move each of the components along its respective explosion direction until each component is outside the enclosure box.
[0272] The fourth processing unit is used to obtain the spatial collision relationship between the various components after they have been moved.
[0273] The first construction unit is used to construct the directed acyclic graph based on the spatial collision relationship;
[0274] If the spatial collision relationship indicates that the third component collides with the fourth component during movement, then a directed edge is established in the directed acyclic graph pointing from the fourth component to the third component.
[0275] Optionally, the second processing module 630 includes:
[0276] An in-degree calculation unit is used to calculate the in-degree of each node in the directed acyclic graph.
[0277] The fifth processing unit is used to initialize the target queue and add each node with an in-degree of zero to the target queue;
[0278] The sixth processing unit is used to repeatedly execute the following steps until the target queue is empty:
[0279] The first node is taken out from the target queue and added to the explosion deployment sequence. The first node is the head element of the target queue. The order of the elements in the explosion deployment sequence represents the explosion deployment order of each component.
[0280] The target in-degree of the neighboring nodes of the first node in the directed acyclic graph is obtained by subtracting one from the in-degree of the neighboring nodes.
[0281] If the target in-degree is zero, the neighbor node is added to the target queue.
[0282] Optionally, the explosion generation module 640 includes:
[0283] An initialization processing unit is used to initialize the initial explosion coefficient of each of the aforementioned components;
[0284] The seventh processing unit is used to acquire target components one by one according to the explosion unfolding sequence, wherein the target components are the components to be processed at the moment.
[0285] The eighth processing unit is used to determine the target stopping position of the target component based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion unfolding direction of the target component.
[0286] The ninth processing unit is used to generate the motion trajectory of the target component based on the starting position of the target component, the target stopping position of the target component, and the explosion deployment direction of the target component;
[0287] The tenth processing unit is used to generate an explosion unfolding animation corresponding to the target assembly based on the motion trajectory of each component.
[0288] Optionally, the eighth processing unit includes:
[0289] The fourth processing subunit is used to determine the moving endpoint position of the target component based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion deployment direction of the target component.
[0290] The fifth processing subunit is configured to, if the target component collides with the fifth component during its movement from the starting position to the ending position, reduce the initial explosion coefficient of the target component to obtain a first explosion coefficient, and determine the ending position of the target component based on the first explosion coefficient, the starting position of the target component, and the explosion direction of the target component, until the target component does not collide with the fifth component during its movement from the starting position to the ending position;
[0291] The sixth processing subunit is used to determine the target stopping position of the target component as the target stopping position if the target component does not collide with the fifth component during the process of moving from the starting position to the moving ending position.
[0292] The fifth component refers to any other component on the target assembly besides the target component.
[0293] The apparatus provided in this application embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0294] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0295] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0296] One embodiment of this application also provides a processing device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the explosion animation generation method as described in any of the preceding claims.
[0297] The specific implementation of the explosion animation generation method, which is executed by the program running on the processor of the processing device, can be found in the detailed description of the explosion animation generation method, and will not be repeated here.
[0298] In addition, specific embodiments of this application also provide a readable storage medium storing a program. When executed by a processor, this program implements the various processes of the above-described explosion animation generation method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here. The readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0299] This application also provides a computer program product, including computer instructions. When executed by a processor, these computer instructions implement the various processes of the above-described explosion animation generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0300] Optionally, embodiments of this application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0301] The computer program product described in this application includes computer instructions that, when executed by a processor, implement the various processes of the method embodiments shown above and achieve the same technical effects. To avoid repetition, these will not be repeated here.
[0302] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0303] It should be noted that many of the functional components described in this specification are referred to as modules / submodules in order to more specifically emphasize the independence of their implementation.
[0304] In this application embodiment, the module / submodule can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.
[0305] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.
[0306] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.
[0307] The above describes the preferred embodiments of this application. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles described in this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating explosion animation, characterized in that, The method includes: Based on the three-dimensional model of the target assembly, determine the explosive deployment direction of each component of the target assembly; Based on the explosion direction of each component, a directed acyclic graph is constructed. The nodes of the directed acyclic graph represent the components, and the edges of the directed acyclic graph represent the disassembly sequence constraints between the components. Based on the acyclic graph, determine the explosion sequence of each component; Based on the explosion direction and explosion sequence of each component, an explosion animation corresponding to the target assembly is generated.
2. The explosion animation generation method according to claim 1, characterized in that, The step of determining the explosive deployment direction of each component of the target assembly based on the three-dimensional model of the target assembly includes: Based on the three-dimensional model, the voxel information corresponding to the target assembly is obtained. The voxel information is used to characterize the spatial coordinates and occupancy status of each voxel occupied by each component. Based on the voxel information, the explosion deployment direction of each component is determined.
3. The explosion animation generation method according to claim 2, characterized in that, Determining the explosion deployment direction of each component based on the voxel information includes: Based on the voxel information, it is determined whether each first component has a contact surface with the second component. The first component is any component of the target assembly, and the second component is any other component on the target assembly other than the first component. When there is a contact surface between the first component and the second component, the least squares method is used to calculate the explosion deployment direction of the first component; In the absence of a contact surface between the first component and the second component, principal component analysis is used to calculate the explosion development direction of the first component.
4. The explosion animation generation method according to claim 2, characterized in that, The construction of a directed acyclic graph based on the explosion unfolding directions of each component includes: Calculate the bounding box of the target assembly based on the voxel information; Each of the components is moved along its respective explosion direction until each component is outside the enclosure box; Obtain the spatial collision relationships between the various components after they have been moved; Based on the aforementioned spatial collision relationships, the directed acyclic graph is constructed. If the spatial collision relationship indicates that the third component collides with the fourth component during movement, then a directed edge is established in the directed acyclic graph pointing from the fourth component to the third component.
5. The explosion animation generation method according to claim 1, characterized in that, Determining the explosion unfolding sequence of each component based on the acyclic graph includes: Calculate the in-degree of each node in the directed acyclic graph; Initialize the target queue and add each node with an in-degree of zero to the target queue; Repeat the following steps until the target queue is empty: The first node is taken out from the target queue and added to the explosion deployment sequence. The first node is the head element of the target queue. The order of the elements in the explosion deployment sequence represents the explosion deployment order of each component. The target in-degree of the neighboring nodes of the first node in the directed acyclic graph is obtained by subtracting one from the in-degree of the neighboring nodes. If the target in-degree is zero, the neighbor node is added to the target queue.
6. The explosion animation generation method according to claim 1, characterized in that, The step of generating an explosion animation corresponding to the target assembly based on the explosion direction and explosion sequence of each component includes: Initialize the initial explosion coefficient of each of the aforementioned components; According to the explosion unfolding sequence, target components are obtained one by one, and the target components are the components to be processed at the moment. The target stopping position of the target component is determined based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion development direction of the target component. Based on the starting position of the target component, the target stopping position of the target component, and the explosion deployment direction of the target component, the motion trajectory of the target component is generated; Based on the motion trajectory of each component, an explosion unfolding animation corresponding to the target assembly is generated.
7. The explosion animation generation method according to claim 6, characterized in that, Determining the target stopping position of the target component based on its initial explosion coefficient, starting position, and explosion propagation direction includes: The endpoint position of the target component is determined based on the initial explosion coefficient of the target component, the starting position of the target component, and the explosion unfolding direction of the target component. If the target component collides with the fifth component during its movement from the starting position to the ending position, the initial explosion coefficient of the target component is reduced to obtain a first explosion coefficient. Based on the first explosion coefficient, the starting position of the target component, and the explosion direction of the target component, the ending position of the target component is determined until the target component does not collide with the fifth component during its movement from the starting position to the ending position. If the target component does not collide with the fifth component during its movement from the starting position to the ending position, then the ending position is determined as the target stopping position of the target component. The fifth component refers to any other component on the target assembly besides the target component.
8. An explosion animation generation device, characterized in that, The device includes: The first processing module is used to determine the explosion unfolding direction of each component of the target assembly based on the three-dimensional model of the target assembly. The first construction module is used to construct a directed acyclic graph based on the explosion unfolding direction of each component. The nodes of the directed acyclic graph represent the components, and the edges of the directed acyclic graph represent the disassembly sequence constraints between the components. The second processing module is used to determine the explosion unfolding sequence of each component based on the acyclic graph. An explosion generation module is used to generate an explosion animation corresponding to the target assembly based on the explosion direction and explosion sequence of each component.
9. A processing device, characterized in that, It includes a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the explosion animation generation method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the explosion animation generation method as described in any one of claims 1 to 7.
11. A readable storage medium, characterized in that, The readable storage medium stores a program that, when executed by a processor, implements the steps of the explosion animation generation method as described in any one of claims 1 to 7.