Die penetration detection method applied to multi-facet model

By using binary tree structure and ray interpolation detection in the multi-faceted number model mode penetration detection, the problems of insufficient detection accuracy and large resource occupation in the existing technology are solved, and efficient and accurate penetration detection is achieved to meet the real-time needs of animation production.

CN119648904APending Publication Date: 2025-03-18WUHAN CHENGJING XINGYI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411708401.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing multi-faceted model model penetration detection methods have shortcomings in detection accuracy and resource utilization, especially in complex scenarios and high-faceted models, which are difficult to accurately identify the penetration situation, and the detection process is time-consuming, affecting the efficiency of animation production.

Method used

The surface of the model is managed by using a binary tree structure, and the possible mode-through area is quickly positioned through recursive segmentation and bounding box detection, and the mode-through situation is accurately judged by combining the ray interpolation detection method.

Benefits of technology

It improves the efficiency and accuracy of mold penetration detection, can detect mold penetration phenomena in high-face number models in real time, meet the needs of practical applications, and integrates them into three-dimensional modeling software to detect and prompt mold penetration problems in real time, helping users to correct them in time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648904A_ABST
    Figure CN119648904A_ABST
Patent Text Reader

Abstract

The invention provides a model crossing detection method applied to a multi-faceted model, which comprises the following steps of: S1, selecting a multi-faceted model A and a multi-faceted model B to be detected, and preliminarily judging whether the two models have space crossing or not through BoundingBox operation; if so, entering the step S2; s2, a binary tree structure is adopted, the face of the model A and the face of the model B are each divided into two parts, and corresponding leaf nodes are formed; s3, matching the leaf nodes of the model A and the leaf nodes of the model B in pairs; aiming at each leaf node pair, carrying out interpenetration detection layer by layer through a bounding Box; s4, if the interspersed leaf node pairs exist, repeating the step S3 until only one quadrilateral surface is left in each leaf node; and S5, subdividing the last remaining four side surfaces into two triangular surfaces, and judging whether mold penetration exists or not by using a ray penetration detection method to obtain all mold penetration surfaces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional modeling, and in particular to a mold penetration detection method applied to a multi-faceted model. Background Art

[0002] In 3D modeling and animation production, model penetration detection is an important link. Model penetration refers to the mutual penetration of parts or characters of a 3D model during the animation process, which is usually caused by incorrect geometric data of the model or improper animation settings. Model penetration will affect the authenticity of the animation and the viewing experience of the audience. Therefore, in the animation production process, model penetration must be effectively detected and corrected.

[0003] Existing methods for detecting mold penetration mainly include geometry-based methods and image-based methods. Geometry-based methods determine whether mold penetration occurs by calculating the intersection of model surfaces. These methods are usually highly accurate, but the calculations are complex, especially when dealing with high-polygon models, and the efficiency is low. Image-based methods detect mold penetration by analyzing rendered image sequences. Although these methods have fast calculation speeds, they have low accuracy and are easily affected by factors such as lighting and texture.

[0004] However, there are some technical problems in the existing penetration detection methods, which are mainly manifested in two aspects: first, the detection accuracy is insufficient, especially in complex scenes and high-polygon models, it is difficult to accurately identify all penetration situations; second, the resource usage is large and the detection process is time-consuming, which affects the efficiency of animation production. These methods are often difficult to operate effectively in real-time environments, limiting their application in actual production. Summary of the invention

[0005] The present invention proposes a mold penetration detection method applied to a multi-faceted model to solve the technical problems that the existing mold penetration detection method for a multi-faceted model has low accuracy or occupies a large number of resources.

[0006] In order to solve the above technical problems, the present invention provides a mold penetration detection method applied to a multi-faceted model, comprising the following steps:

[0007] Step S1: Select two polyhedral models A and B to be detected, and preliminarily determine whether there is spatial interpenetration between the two models through boundingBox operation; if there is interpenetration, proceed to step S2;

[0008] Step S2: using a binary tree structure, the faces of the model A and the model B are equally divided into two parts to form corresponding leaf nodes;

[0009] Step S3: Pairwise match the leaf nodes of Model A and the leaf nodes of Model B; for each pair of leaf nodes, perform penetration detection layer by layer through the boundingBox;

[0010] Step S4: For the pairs of leaf nodes with penetration, repeat Step S3 until only one quadrilateral face remains in each leaf node;

[0011] Step S5: Subdivide the last remaining quadrilateral faces into two triangular faces, and apply the ray penetration detection method to determine whether there is model penetration, obtaining all the penetrated faces.

[0012] Preferably, the method of applying the ray penetration detection method in Step S5 to determine whether there is model penetration includes:

[0013] Step S51: Let the three vertices of the triangular face be vertex0, vertex1, and vertex2, and calculate two edge vectors edge1 and edge2 from vertex0 to vertex1 and from vertex0 to vertex2;

[0014] Step S52: Calculate the perpendicular relationship between the ray direction and the triangular face:

[0015] h = crossProduct(rayVector, edge2);

[0016] a = DotProduct(edge1, h);

[0017] In the formula, h represents the cross product result of the ray direction rayVector and edge2; a represents the dot product result of edge1 and h;

[0018] If a > -EPSILON and a < EPSILON, the ray direction is parallel to the triangular plane and no intersection occurs, that is, no model penetration occurs, otherwise go to Step S53.

[0019] EPSILON represents any small positive integer;

[0020] Step S53: Calculate the scale factor f and the parameter u:

[0021] f = 1.0 / a;

[0022] s = rayOrigin - vertex0;

[0023] u = f * DotProduct(s, h);

[0024] In the formula, rayOrigin represents the ray origin; if u exceeds the range of [0, 1], no model penetration occurs, otherwise go to Step S54;

[0025] Step S54: Calculate parameter v:

[0026] q = crossProduct(s,edge1);

[0027] v=f*DotProduct(rayVector,q);

[0028] If u+v exceeds 1, no mode penetration occurs, otherwise, go to step S55;

[0029] Step S55: Calculate the intersection parameter t:

[0030] t = f*DotProduct(edge2,q);

[0031] If t>EPSILON, die penetration occurs.

[0032] Preferably, the above method is integrated into Maya software to detect inter-model penetration in real time.

[0033] Preferably, all the molded surfaces are displayed through a user interface for the user to view and modify.

[0034] The present invention also provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the above method.

[0035] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above method.

[0036] The beneficial effects of the present invention include at least: the present invention proposes a mold penetration detection method, which uses a binary tree structure to manage the faces of the model, quickly locates possible mold penetration areas through recursive segmentation and bounding box detection, and then accurately determines the mold penetration situation in combination with the ray interlacing detection method. This method not only improves the efficiency and accuracy of detection, but also can detect the mold penetration phenomenon of high-polygon models in real time, meeting the needs of practical applications. By integrating this method into 3D modeling software such as Maya, it is possible to detect and prompt mold penetration problems in real time, helping users to correct them in time, thereby improving the quality and efficiency of animation production. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a binary tree data structure and face splitting according to an embodiment of the present invention;

[0039] Figure 3It is a schematic diagram of determining the intersection of triangle surfaces using the ray interpenetration method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work belong to the protection scope of the present invention.

[0041] like Figure 1 As shown, an embodiment of the present invention provides a mold penetration detection method applied to a multi-faceted model.

[0042] 1. Preliminary testing

[0043] For model A and model B, first perform overall boundingBox processing to determine whether the two boundingBoxes have an intersection. This step can be achieved in the following ways:

[0044] Calculate the boundingBox of model A and define its minimum and maximum points.

[0045] Similarly calculate the boundingBox of model B.

[0046] By comparing the coordinate values ​​of the two boundingBoxes, determine whether there is an intersection.

[0047] The implementation steps of the algorithm are as follows:

[0048] For each vertex of model A, record its coordinates in space;

[0049] Calculate the minimum and maximum values ​​in the x, y, and z directions to get the boundaries of the boundingBox;

[0050] Do the same for Model B;

[0051] Determine if there is an intersection by comparing the minimum and maximum values ​​of the boundingBox.

[0052] If the two boundingBoxes do not intersect, the result is returned immediately without subsequent calculations. This operation greatly reduces the amount of calculations and improves efficiency.

[0053] 2. Model segmentation and leaf node generation

[0054] If it is determined that there is a penetration, the model needs to be segmented next:

[0055] The face sets of model A and model B are regarded as the root nodes of the tree structure and divided equally, such as Figure 2 As shown;

[0056] For each face of the model, the boundingBox of each face is calculated and divided into two leaf nodes.

[0057] 3. Recursive detection

[0058] For each generated leaf node, continue to process the boundingBox:

[0059] If it is found that there is still an intersection, the face of the leaf node is further divided into two parts and converted into a new leaf node;

[0060] Repeat the boundingBox test until only one quadrilateral remains in the leaf node.

[0061] This step will continue until all faces are processed. The time complexity of this process is relatively low, which is suitable for fast detection of models with high number of faces.

[0062] 4. Ray penetration detection

[0063] Once the final quadrilateral is reached, it needs to be split into two triangular faces and ray interlacing detection is performed: In the embodiment of the present invention, The algorithm performs interaction detection between triangles. The algorithm determines whether there is a penetration phenomenon by calculating the intersection of the ray and the triangle, such as Figure 3 shown.

[0064] Specifically, for each quadrilateral that cannot be split any further, convert it into two triangular faces. The specific steps are as follows:

[0065] 1. Triangle edge calculation

[0066] edge1=vertex1-vertex0;

[0067] edge2=vertex2-vertex0;

[0068] In the formula, vertex0, vertex1 and vertex2 represent the three vertices of the triangle. Edge1 and edge2 are the two edge vectors from vertex0 to vertex1 and vertex0 to vertex2 respectively. Representing the triangle as an edge vector helps in the subsequent calculation of the plane normal vector and intersection point.

[0069] 2. Calculate the perpendicular relationship between the ray direction and the triangle plane

[0070] h=crossProduct(rayVector,edge2);

[0071] a=DotProduct(edge1,h);

[0072] h is the cross product of the ray direction rayVector and edge2, which indicates the perpendicular direction between the ray direction and the normal vector of the plane where edge2 is located. Next, the angle between edge1 and h is calculated by dot product a=DotProduct(edge1,h). This dot product result a can be used to determine whether the ray is parallel to the triangle plane.

[0073] 3. Determine whether the ray is parallel to the triangle

[0074] if(a>-EPSILON&&a <EPSILON);

[0075] If a is very close to 0, it means that edge1 and h are perpendicular, the ray direction is parallel to the triangle plane, and it is impossible to generate an intersection, so false is returned directly. EPSILON represents an arbitrarily small positive integer.

[0076] 4. Calculate the scale factor f and parameter u

[0077] f = 1.0 / a;

[0078] s = rayOrigin - vertex0;

[0079] u = f*DotProduct(s,h);

[0080] f is a scaling factor used to scale the vector so that the subsequent calculations can obtain normalized values. u is a parameter calculated by multiplying the vector s and h from the ray origin rayOrigin to the triangle vertex0, indicating the proportional position of the intersection point in the direction of edge1. If u exceeds the range [0,1], it means that the intersection point is not within the triangle boundary, and false can be returned directly.

[0081] 5. Calculate parameter v

[0082] q = crossProduct(s,edge1);

[0083] v=f*DotProduct(rayVector,q);

[0084] q is the cross product of s and edge1, indicating the vertical direction on the plane. v is calculated by the dot product of rayVector and q, indicating the proportional position of the intersection point in the direction of edge2. When u+v exceeds 1, it means that the intersection point is outside the triangle, so false is returned.

[0085] 6. Calculate the intersection parameter t

[0086] float t=f*DotProduct(edge2,q);

[0087] t is the final parameter, which indicates the proportional position between the intersection point and the starting point of the ray. t>EPSILON means that the intersection point is in the positive direction of the ray, that is, the ray intersects the triangle plane.

[0088] 7. Calculate the intersection position

[0089] outIntersectionPoint=rayOrigin+rayVector*t;

[0090] When performing ray intersecting detection, if any triangle intersects with another model's triangle, these triangles are recorded for subsequent processing. You can create a list or collection to save the intersecting faces for users to view and correct.

[0091] The method of the embodiment of the present invention is integrated into Maya software to detect inter-model penetration in real time, and all inter-model surfaces can be displayed through a user interface for users to view and correct.

[0092] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the above method.

[0093] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above method.

[0094] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is more specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. As long as there is no contradiction in the combination of these technical features, they should be considered as the scope recorded in this specification.

[0095] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A mold penetration detection method applied to a multi-faceted model, characterized by: It includes the following steps: Step S1: Select two multi-faceted models A and B to be detected, and preliminarily determine whether there is spatial intersection between these two models through the boundingBox operation; if there is intersection, enter Step S2; Step S2: Adopt a binary tree structure to evenly divide the faces of the model A and the model B into two parts respectively to form corresponding leaf nodes; Step S3: Pairwise match the leaf nodes of the model A and the leaf nodes of the model B; for each pair of leaf nodes, perform intersection detection layer by layer through the boundingBox; Step S4: For the pairs of leaf nodes with intersections, repeat Step S3 until only one quadrilateral face remains in each leaf node; Step S5: Subdivide the finally remaining quadrilateral faces into two triangular faces, and apply the ray intersection detection method to determine whether there is model penetration to obtain all the penetrated faces.

2. The method for detecting mold penetration applied to a multi-faceted model according to claim 1, characterized in that: The method of applying the ray intersection detection method in Step S5 to determine whether there is model penetration includes: Step S51: Let the three vertices of the triangular face be vertex0, vertex1, and vertex2, and calculate two edge vectors edge1 from vertex0 to vertex1 and edge2 from vertex0 to vertex2; Step S52: Calculate the perpendicular relationship between the ray direction and the triangular face: h = crossProduct(rayVector, edge2); a = DotProduct(edge1, h); In the formula, h represents the cross product result of the ray direction rayVector and edge2; a represents the dot product result of edge1 and h; If a > -EPSILON and a < EPSILON, the ray direction is parallel to the triangular plane and no intersection point is generated, that is, there is no model penetration, otherwise enter Step S53, EPSILON represents any small positive integer; Step S53: Calculate the scale factor f and the parameter u: f = 1.0 / a; s = rayOrigin - vertex0; u = f * DotProduct(s, h); In the formula, rayOrigin represents the ray origin; if u exceeds the range of [0, 1], there is no model penetration, otherwise enter Step S54; Step S54: Calculate the parameter v: q = crossProduct(s, edge1); v = f * DotProduct(rayVector, q); If u + v exceeds 1, there is no model penetration, otherwise enter Step S55; Step S55: Calculate the intersection point parameter t: t = f * DotProduct(edge2, q); If t > EPSILON, there is model penetration.

3. The mold penetration detection method applied to a multi-faceted model according to any one of claims 1 to 2, characterized in that: The method is integrated into the Maya software to detect model penetration in real time.

4. The method for detecting mold penetration applied to a multi-faceted model according to claim 3, characterized in that: All the penetrated faces are displayed through the user interface for the user to view and correct.

5. An electronic device, characterized in that: It includes: A memory, a processor, and a computer program, where the computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 2.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 2.