A method, system, storage medium and program product for generating a collision detection wrapped mesh for a three-dimensional object

By generating a unified world coordinate system point cloud dataset and an incremental convex hull algorithm, combined with spherical mesh shrinkage technology, the problem of balancing visual effects and computational performance in existing 3D object collision detection is solved, achieving efficient 3D object collision detection.

CN120689554BActive Publication Date: 2025-12-16QIXIN (GUANGZHOU) DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511091880.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-05
Publication Date
2025-12-16
Estimated Expiration
2045-08-05

AI Technical Summary

Technical Problem

Existing 3D object collision detection methods struggle to balance visual quality and computational performance. Individual collision boxes result in large visual errors, while complete mesh calculations are too costly and cannot meet the needs of real-time applications.

Method used

A method for generating a 3D object collision detection bounding mesh is adopted. By generating a unified world coordinate system point cloud dataset, the initial convex hull is constructed using a matrix hierarchical extremum retrieval algorithm and an incremental convex hull algorithm. Then, a hierarchical spherical network is generated by combining spherical parameters for collision detection, which reduces the number of mesh vertices and faces and improves computational efficiency.

Benefits of technology

It significantly reduces computational resource consumption while ensuring visual realism and collision accuracy, making it suitable for real-time interactive applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689554B_ABST
    Figure CN120689554B_ABST
Patent Text Reader

Abstract

The application provides a three-dimensional object collision detection wrapping mesh generation method, system, storage medium and program product, and the method comprises the following steps: extracting all vertex data of a first object and determining an initial center point according to serialized sub-Mesh data groups of a three-dimensional model; converting each vertex of each sub-Mesh data from a local coordinate system to a global world coordinate system to generate a point cloud data set; constructing an initial convex hull by using a matrix hierarchical extreme value retrieval algorithm; generating a final convex hull by using a conflict graph and an incremental convex hull algorithm; initializing a radius to cover the model with the model geometric center as the center of a sphere; generating a hierarchical spherical mesh according to longitude and latitude subdivision; emitting a ray, correcting vertex positions layer by layer, approximating the model surface, and outputting a collision body network. The application realizes unified topology wrapping of multiple three-dimensional objects by using the whole point cloud set, combining the incremental convex hull algorithm and the spherical mesh contraction technology, ensures visual fidelity and collision accuracy, and reduces resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer graphics collision detection technology, and in particular to a method, system, computer-readable storage medium, and computer program product for generating a three-dimensional object collision detection wrapping mesh. Background Technology

[0002] With the rapid development of computer graphics, collision detection technology has become increasingly mature. Collision detection is a significant technical challenge and a major drain on computing resources in computer application fields such as computer graphics, virtual reality, and artificial intelligence, but it has a wide range of applications.

[0003] Current physics engines typically calculate collisions of multiple 3D objects separately, either by calculating the collision bounding box or the entire mesh. The former leads to significant visual errors, while the latter has extremely high computational costs, failing to meet the needs of real-time applications.

[0004] Existing collision calculation methods either suffer from poor visual effects and significant collision errors, or they consume excessive resources, making it difficult to meet the demands of real-time interaction. Therefore, an optimized collision calculation technique that balances visual appeal and computational performance is needed. Summary of the Invention

[0005] The purpose of this disclosure is to provide a method, system, computer-readable storage medium, and computer program product for generating a three-dimensional object collision detection wrap-around mesh, thereby solving the aforementioned problems existing in the prior art.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this disclosure are as follows:

[0007] This disclosure provides a method for generating a three-dimensional object collision detection wrapper mesh, the method comprising:

[0008] Based on the serialized sub-mesh data group of the 3D model, extract all vertex data of the first object and determine the initial center point of the first object;

[0009] For each vertex of each sub-mesh data in the sub-mesh data group, the local coordinate system is transformed to the global world coordinate system, the unique identifier ID of each point is recorded, and a unified world coordinate system point cloud dataset is generated; where the global world coordinate system is a coordinate system with the initial center point as the origin;

[0010] The initial convex hull is constructed using a matrix hierarchical extreme value retrieval algorithm based on the point cloud dataset. The final convex hull that encloses all objects in the 3D model is generated using a conflict graph and incremental convex hull algorithm. The incremental convex hull algorithm includes bucketing maximum distance selection and incremental horizon caching.

[0011] According to all vertex coordinates of the target three-dimensional model, a center of the three-dimensional model is determined as a center of the spherical network, a hierarchical spherical network covering the target model is generated in combination with preset spherical parameters, a ray is emitted along a spherical normal direction to the target model surface, vertex positions are corrected layer by layer to approximate the target model surface, and a collision body network is output for collision detection; wherein the spherical parameters include an initial radius r and longitude and latitude subdivision degrees.

[0012] Optionally, after generating the unified world coordinate system point cloud dataset, the method further includes:

[0013] Obtaining vertex point sets of all sub-mesh arrays;

[0014] Determining whether the number of vertices is greater than or equal to a preset threshold, and if yes, proceeding to the next step;

[0015] Removing duplicate points by using Hash / KD-Tree to generate a de-duplicated point set , and updating the number of vertices ;

[0016] Randomly selecting three points a, b and c, calculating the modulus of the vector cross product || (b-a) x (c-a) ||, and if || (b-a) x (c-a) || >= e L , non-collinear three points exist, and the next step is performed; if || (b-a) x (c-a) || < e L , resampling is performed, and if N consecutive random samplings satisfy || (b-a) x (c-a) || < e L , the point set is collinear, and FAIL_LINE is returned; wherein a, b and c are vertex coordinates, b-a and c-a represent coordinate vector subtraction, e L represents a collinear tolerance;

[0017] Randomly sampling an arbitrary point d outside the non-collinear three points, calculating the scalar triple product | (b-a) cdot ((c-a) x (d-a)) | x (1 / 6) to obtain a volume V, and if V >= e P Point d and points a, b and c are not coplanar, and the next step is performed; wherein, e P represents a coplanar tolerance;

[0018] Calculating the diagonal length of the bounding box in the Mesh data L bb , according to the formula e L = L bb×10 -6 and e P = L bb 3 ×10 -12 dynamically setting a tolerance value;

[0019] returning the point set that passes the verification for use in convex hull generation.

[0020] Optionally, the initial convex hull is constructed according to the point cloud data set using a matrix layering extreme value retrieval algorithm, comprising:

[0021] According to the point cloud data set, a candidate extreme point set is obtained through layering matrix and extreme value retrieval, wherein the layering matrix comprises 26 discrete direction vectors covering three-dimensional space.

[0022] The volume and condition number regularization condition number of any four points in the candidate extreme point set are calculated, and the volume-condition number coupling score is obtained according to the volume and condition number, and the tetrahedron corresponding to the maximum volume-condition number coupling score is selected as the initial convex hull T0.

[0023] The vertices of the initial convex hull T0 are unidirectionally gradient-optimized along their corresponding directions, and the vertices of the initial convex hull are updated with the maximum distance from the vertices to the point cloud boundary as the target.

[0024] Optionally, the conflict graph is constructed using a matrix contraction and smoothing group rule method, comprising the following steps:

[0025] Obtaining the face set F of the initial convex hull and the outer point set P´;

[0026] According to a preset angle threshold α aggregating adjacent faces into a smoothing group set G={g k};

[0027] For each point p , the signed distance Δk of the point p to the plane of the smoothing group gk is calculated, Δ k =n k · p - d k If Δk>0, the point p is marked as a conflict outer point, and a sparse group conflict matrix C g is generated, wherein n k represents the group plane normal vector, d k and represents the group plane constant term;

[0028] The sparse group conflict matrix C g is contracted to delete all zero rows and all zero columns, and a compressed group conflict matrix C g ´ is obtained.

[0029] For the compression group conflict matrix C g The inner surfaces of ´ are refined to obtain the sparse surface-point matrix C. f ;

[0030] Opposite-point matrix C f After removing rows / columns containing all zeros, the final conflict graph C is obtained. MCS .

[0031] Optionally, the compression group conflict matrix C g The inner surfaces of ´ are refined to obtain the sparse surface-point matrix C. f ,include:

[0032] Filtering the compression group conflict matrix C g There exists a smooth group with at least one conflicting outgoing point in the '.

[0033] For each conflict group g k traverse its face f ∈g k Only for C g Calculate the signed distance Δ from the marked conflict out-of-bounds point to surface f. f ;

[0034] If Δ f >ε plane If the surface-to-point collision is identified, a sparse surface-to-point matrix C is obtained. f .

[0035] Optionally, the incremental convex hull algorithm employs a bucketed maximum distance selector (BMD Select) and an incremental horizon cache (IHC Cache) to generate the final convex hull based on the initial convex hull and the conflict graph, including:

[0036] Obtain the initial convex hull and conflict graph C MCS ;

[0037] Based on the initial convex hull set F and its conflicting external points, the bucketized maximum distance selector (BMD Select) is used to calculate the farthest point d among the conflicting points of each face. max (f) and select the global farthest point using a bucket heap. ;

[0038] Collect visible F vis, F vis ={ f |n f · p * - d f >0}, F vis Indicates to p * Meeting in person is possible.p * This indicates that the farthest outer point is selected in this round, where, d f For noodles f The plane constant term, n f For noodles f The normal vector;

[0039] Search the horizon edge using the incremental cache (IHC Cache);

[0040] Delete visible faces and synchronously update the face set F and the conflict graph CMCS;

[0041] Insert a new face, with the horizon edge and p * Form a new triangle f new Incorporate into F; update surface normal and plane constant;

[0042] Update the conflict graph based on the newly added face set, adjacency information, and exterior point set;

[0043] When the conflict graph C MCS If there are no non-zero elements in the convex hull and ||CMCS||0 = 0, the convex hull construction is considered complete; otherwise, continue iterating to select the farthest point.

[0044] When the conflict graph C MCS When empty, output the vertex and face data of the convex hull to obtain the final convex hull.

[0045] Optionally, updating the conflict graph based on the newly added face set, adjacency information, and exterior point set includes:

[0046] Provide a set of candidate conflict outliers for new faces through incremental horizon caching;

[0047] Signed distances are calculated and the conflict matrix is ​​updated only for candidate outliers;

[0048] Dynamically trigger matrix shrinkage and remove empty rows / columns to maintain sparsity;

[0049] Synchronize the index, update the IHCCache, write the edge information of newly added faces to EdgeHash, and synchronize the collision points to DirtyFlag for subsequent retrieval.

[0050] Optionally, based on the coordinates of all vertices of the target 3D model, the center of the 3D model is determined as the center of the sphere network. Combined with pre-set spherical parameters, a hierarchical sphere network covering the target model is generated. Rays are emitted along the sphere normal direction towards the surface of the target model, and the vertex positions are corrected layer by layer to approximate the surface of the target model, outputting a collision network for collision detection. The sphere parameters include: an initial radius r and latitude / longitude subdivision, including:

[0051] determine a model center according to all vertex coordinates of the target three-dimensional model, and take the model center as a sphere center of a sphere network;

[0052] pre-set multi-level spherical parameters, wherein the spherical parameters include an initial radius r and latitude and longitude subdivision degrees;

[0053] obtain latitude and longitude angles according to the level latitude and longitude subdivision degrees, calculate corresponding vertex coordinates in combination with the sphere center coordinates and the initial radius, and calculate the vertex coordinates according to the formula: (x, y, z) = (r * cos (φ) * cos (λ), r * cos (φ) * sin (λ), r * sin (φ)) where φ and λ are the latitude and longitude angles respectively, and r is the initial radius; i j index the quadrilateral or triangular patches, and generate UV to obtain a level latitude and longitude sphere network, wherein each vertex caches a ray vector in a spherical normal direction, and the level latitude and longitude sphere network is wrapped outside the model;

[0054] perform ray detection along the spherical normal direction, and adjust the grid vertex positions layer by layer to approximate the target model surface;

[0055] output a final collision body network when the maximum residual error of the grid vertexes with respect to the model surface is greater than a preset threshold τ.

[0056] Another aspect of the embodiments of the present disclosure provides a three-dimensional object collision detection wrapping grid generation system, which comprises:

[0057] an initial center generation module configured to extract all vertex data of a first object according to serialized sub-Mesh data groups of a three-dimensional model, and determine an initial center point of the first object.

[0058] a coordinate system transformation module configured to convert each vertex of each sub-Mesh data in the sub-Mesh data groups from a local coordinate system to a global world coordinate system, record a unique identifier ID of each point, and generate a unified world coordinate system point cloud data set; wherein the global world coordinate system is a coordinate system with the initial center point as the origin.

[0059] a convex hull generation module configured to construct an initial convex hull according to the point cloud data set by using a matrix hierarchical extreme value retrieval algorithm, and generate a final convex hull wrapping all objects of the three-dimensional model by using a conflict graph and an incremental convex hull algorithm, wherein the incremental convex hull algorithm includes a bucketized maximum distance selection and an incremental horizon buffer.

[0060] a collision body network production module configured to determine a three-dimensional model center as a sphere center of a sphere network according to all vertex coordinates of a target three-dimensional model, generate a level sphere network covering the target model in combination with pre-set spherical parameters, emit a ray along a spherical normal direction to the target model surface, correct vertex positions layer by layer to approximate a final target model surface, and output a collision body network for collision detection; wherein the spherical parameters include an initial radius r and latitude and longitude subdivision degrees.

[0061] ​In another aspect, the embodiments of the present disclosure provide a computer readable storage medium, which stores a computer program. The computer program, when executed by a processor, implements the steps of the method described above.

[0062] In another aspect, the embodiments of the present disclosure provide a computer program product, which comprises a computer program. The computer program, when executed by a processor, implements the steps of the method described above.

[0063] The embodiments of the present disclosure have the following beneficial effects:

[0064] The embodiments of the present disclosure establish a unified point cloud set, and realize the unified topology wrapping of multiple three-dimensional objects by using an efficient incremental convex hull algorithm combined with a spherical mesh shrinking technique. The method significantly reduces the number of vertices and faces of the mesh, while ensuring visual fidelity and collision accuracy, greatly reducing the consumption of computing resources, and is suitable for real-time and efficient interactive applications. BRIEF DESCRIPTION OF DRAWINGS

[0065] Figure 1 FIG. 1 is a flowchart of a three-dimensional object collision detection wrapping mesh generation method according to an embodiment of the present disclosure;

[0066] Figure 2 FIG. 2 is a full flowchart of a three-dimensional object collision detection wrapping mesh generation method according to an embodiment of the present disclosure;

[0067] Figure 3 FIG. 3 is a structural diagram of a three-dimensional object collision detection wrapping mesh generation system according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0068] In order to make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the embodiments of the present disclosure are further described in detail below with reference to the drawings. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present disclosure and should not be used to limit the embodiments of the present disclosure.

[0069] The embodiments of the present disclosure relate to an optimized computing method for three-dimensional object collision detection, in particular, an efficient multi-object spherical shrinking convex hull collision wrapping technique.

[0070] As shown in FIGS. 1, 2 and 3, the embodiments of the present disclosure provide a three-dimensional object collision detection wrapping mesh generation method, which comprises the following steps: Figure 1 and Figure 2 As shown in FIGS. 1, 2 and 3, the embodiments of the present disclosure provide a three-dimensional object collision detection wrapping mesh generation method, which comprises the following steps:

[0071] In step S100, all vertex data of the first object is extracted from the serialized sub-Mesh data set of the three-dimensional model, and the initial center point of the first object is determined.

[0072] It should be noted that the embodiments of the present disclosure are methods for generating a three-dimensional object wrapping mesh of Mesh data of a three-dimensional model, obtaining Mesh data of a three-dimensional model to be subjected to three-dimensional object collision detection, and a first object corresponding to a first sub-Mesh data. One sub-Mesh can correspond to one three-dimensional object or an independent part of an object. First, the parent node of all Mesh data is the root node, and the sub-Mesh data group is serialized and imported. The information of all vertices of the first object is extracted from the Mesh sequence group. That is, in the three-dimensional model data processing, the serialized sub-Mesh data group (such as hierarchical Mesh data obtained by FBX / OBJ file parsing or engine API) is loaded under the parent root node, and all vertex data of the first sub-object or the first Mesh instance is extracted from the Mesh sequence thereof, which is used for subsequent center point calculation and coordinate transformation. The entire model structure containing multiple sub-Meshes is taken as the starting point (root node) of processing. The sub-Mesh data group is imported or organized in a serialized form. The key of this step is to determine a common reference point, that is, the so-called "center point". Through the center point, the subsequent data transformation can be more accurately and uniformly processed. Point cloud set center point calculation: In the field of point cloud data processing, the selection of a unified reference point is crucial to the accuracy of data processing.

[0073] Formula: Calculate the initial center point C of the point cloud set of the first object, where N is the number of vertices of the first object, V i For the first object i vertex coordinates. Uniform spatial coordinates, determine the point cloud set space reference and obtain the initial center point, which is used for subsequent coordinate transformation and convex hull calculation.

[0074] The hardware environment for three-dimensional model collision detection of the embodiments of the present disclosure is that the operating system uses Windows 11 Pro 23H2 x64 / Ubuntu 22.04 LTS, and the dual system facilitates comparison of Mono and IL2CPP performance; the CPU uses Intel Core i9 14900KF (24 cores, 5.6GHz Turbo), single thread 1MB L1, 2MB L2 per P core; the test script is mainly affected by the single thread bottleneck. The GPU uses NVIDIA RTX4090 24GB GDDR6X, which is used for GPU-accelerated point cloud ConvexHull / BVH construction. The memory uses 128GB DDR5 6400, which ensures that more than 100 million point clouds are loaded at a time. The storage uses PCIe4.0 NVMe SSD (read and write 7GB / s), which accelerates the import of huge PLY / OBJ / FBX. The engine uses Unity 2022.3.53 LTS, which is stable and officially maintained until 2026.

[0075] Test data: user-provided mechanical part group (10-50 sub-Meshes / group), single body 100-200 million tri.

[0076] Mesh core data includes: vertex coordinate set, index / patch table, axis-aligned bounding box, local-world transformation, and normal.

[0077] The following table is the Mesh core data

[0078]

[0079] The Mesh set is all the data verified this time, and after data serialization, the first is index 0, the data structure is static data reorganization, and the calculation this time involves data structure serialization and reorganization.

[0080] The data format reconstruction of the vertex coordinate set (Vertices) index / patch table (Triangles / Indices) is the core of the calculation this time.

[0081] This calculation is to create a new Mesh data specifically for collision, a new vertex coordinate set (Vertices) index / patch table (Triangles / Indices).

[0082] Step S200, convert each vertex of each sub-Mesh data in the sub-Mesh data group from the local coordinate system to the global world coordinate system, record the unique identifier ID of each point, and generate a unified world coordinate system point cloud data set; wherein the global world coordinate system is a coordinate system with an initial center point as the origin.

[0083] Unifying the data from multiple 3D models is a fundamental step to ensure the effectiveness of subsequent analysis. Specifically, this requires transforming the local coordinates of each 3D model into a unified global world coordinate system, thereby standardizing the data. The transformation uses the matrix transformation formula: P world =M local→world ·P local P world M is a point in the world coordinate system. local→world Transformation matrix from local coordinate system to world coordinate system; P local Points in the local coordinate system. Integrate the vertex data of all objects into a unified point cloud dataset, recording the unique identifier (ID) of each point. This integrates scattered data and ensures coordinate system consistency. A unified world coordinate system point cloud dataset is generated, which will not be elaborated here. Step S200 involves confirming the initial center point from step S100 as the center of the world coordinate system and unifying the local matrix coordinates of all other sub-mesh data in the sequence to this world coordinate system.

[0084] After step S200, the method further includes performing data validity detection on the mash data;

[0085] Data validity check: Before calling QuickHull, Chan, or Beneath-Beyond, a lightweight O(N) to O(NlogN) process is used to ensure that the input point cloud meets three hard conditions: sufficient quantity, non-collinearity, and non-coplanarity. This avoids wasting time or throwing exceptions after entering the main algorithm. The data validity check is used to quickly filter valid point clouds that can be used to construct a convex hull.

[0086] Step S10: Obtain the vertex set of all sub-mesh arrays. .

[0087] Among them, vertex set For the set of vertices in a unified world coordinate system, p i Indicates the first i One vertex, N This represents the number of original points, ranging from 4 to 10. 6 .

[0088] Step S20: Determine whether the number of vertices is greater than or equal to a preset threshold. If yes, proceed to the next step; otherwise, return FAIL_SIZE.

[0089] The preset threshold can be 4. In general, the number of vertices will be very large, much larger than the preset threshold. If N ≥ the preset threshold, proceed to the next step; if N < 4, return FAIL_SIZE.

[0090] Step S30, remove duplicate points by Hash / KD-Tree, and get vertex point set again , recalculate the number of vertices .

[0091] The embodiment of the disclosure removes duplicate points in step S30 to avoid distortion of the collinearity criterion caused by duplication. After deduplication, the number of points, ≤N; At this time, it is also necessary to judge whether the number of vertices after deduplication is greater than or equal to the preset threshold, if ≥ the preset threshold, proceed to the next step. It has been ensured that the convex hull is formed in the subsequent steps. Time complexity, deduplication: O (NlogN) (Hash can be approximately O (N)); random sampling within 250 times, constant level; space complexity: O (N).

[0092] Step S40, randomly select three points a, b, and c, and calculate || (b-a) x (c-a) ||, if || (b-a) x (c-a) ||≥ e L , there are non-collinear three points, and the success is exited to the next step; if || (b-a) x (c-a) ||< e L , the three points are collinear, and the current attempt fails, and the next iteration is performed, and the iteration is performed N" times, if || (b-a) x (c-a) ||< e L for N" consecutive times, return FAIL_LINE; wherein, e L represents the collinearity tolerance, and the value is 10 -6 L bb .

[0093] Wherein, a, b, and c are vertex coordinates, b-a and c-a represent coordinate vector subtraction, x is vector cross product, and ‖·‖ is Euclidean norm.

[0094] If it is successful once (find ≥ e L ): the point set is not collinear (may form a face). If all fail (N" times are all e L ): the point set is likely to be collinear, and FAIL_LINE is returned, FAIL_LINE indicates that all points are collinear.

[0095] N' can be 50. || (b-a) x (c-a) || calculates the modulus length (length) of the cross product of vectors (b-a) and (c-a). Step S40 is used to estimate whether there are non-collinear three points.

[0096] Step S50, randomly sample any point d outside the non-collinear three points, calculate the scalar triple product | (b - a) · ((c - a) x (d - a)) | x (1 / 6) to get the volume V, and judge the relationship between V and e P . e P , which means that the point d is not coplanar with a, b, and c, and the next step is performed; if V < TOL e P , it is determined that the point set is coplanar, which means that the point d is coplanar with a, b, and c.

[0097] , the scalar triple product | (b - a) · ((c - a) x (d - a)) | is calculated to obtain the volume V, and the volume V is calculated again on the basis of the two points a, b, and c through step S40. a, b, c, and d represent randomly sampled points, and each point . e P , which means that the coplanar tolerance (volume) is 10 -12 L bb 3 .

[0098] Step S60, calculate the diagonal length of the bounding box in the Mesh data L bb , according to the formula e L = L bb x 10 -6 and e P = L bb 3 x 10 -12 , the tolerance value is dynamically set.

[0099] Statistical Bounding Box, prevent data scale difference. FAIL_PLANE represents the whole coplanar.

[0100] Step S70, return PASS and the cleaned .

[0101] Step S60, return PASS and the cleaned , and output, for subsequent convex hull main algorithm. PASS represents that the convex hull condition is met.

[0102] The following table is the experimental parameters and results of data validity detection using steps S20 to S70

[0103]

[0104] The results shown in this table demonstrate the robustness of the verification algorithm on point clouds with different geometric characteristics. Hardware: Intel i7-170P; Implementation: C++17 + Eigen. The results show that the data validity detection CH-PreCheck can determine whether a million-level point cloud is eligible for convex hull construction in the range of sub-millisecond to tens of milliseconds, and accurately rejects the input in extreme degenerate scenarios (full line, full plane). Core criteria: 1. Number of vertices ≥ 4; 2. Existence of three non-collinear points; 3. Existence of four non-coplanar points. Adaptive tolerance: scaled with bounding box size, compatible with micron-level and kilometer-level models. Efficiency friendly: random sampling and lightweight vector calculation, early rejection of degenerate data, avoiding subsequent QuickHull abnormal overhead. This pre-check process can be directly embedded into any 3D convex hull or network reconstruction pipeline as a pre-stage for resource protection and robustness guarantee.

[0105] Step S300, constructing an initial convex hull according to the point cloud dataset using a matrix layered extreme value retrieval algorithm, and generating a final convex hull that wraps all objects of the three-dimensional model using a conflict graph and an incremental convex hull algorithm.

[0106] An initial convex hull is created using the Matrix Layered Extreme Vertex Set (MLEVS) algorithm.

[0107] The quality of the initial convex hull structure directly affects the subsequent convex hull iteration process. This time, a cluster of highly discrete candidate extreme points is locked in one step using the "matrix layered extreme value retrieval", and then its spatial extreme value is fine-tuned through "vertex sharpening" to maximize the volume of the first tetrahedron and minimize the condition number. This strategy scales linearly with the input point number in O(N) time, while significantly reducing the degeneracy probability of subsequent incremental / recursive convex hulls.

[0108] The initial convex hull is constructed according to the point cloud dataset using a matrix layered extreme value retrieval algorithm, including:

[0109] Step S310, obtaining a candidate extreme point set from the point cloud dataset through layered matrix and extreme value retrieval, wherein the layered matrix includes 26 discrete direction vectors covering three-dimensional space.

[0110] Step S311, selecting a set of discrete direction vectors covering three-dimensional space to form a direction matrix D.

[0111] Select 26 direction vectors based on a 3x3x3 neighborhood to form the direction matrix D. Specifically, the direction matrix D selects a 3x3 orthogonal set, , a total of 26 direction vectors, which are arranged in a 26x3 matrix, with each row representing a unit direction vector d j(j = 1, 2,..., 26), respectively, 6 axial directions (±X, ±Y, ±Z), 12 edge diagonal directions and 8 vertex diagonal directions. The 26 directions are predefined, fixed mathematical directions in three-dimensional space. The main role of the direction basis matrix D is to provide a set of predefined reference directions covering all directions in space for subsequent extreme point retrieval (such as convex hull calculation, feature extraction, etc.). The base layer direction covers the layer. Through the extreme points of the 26 directions, the space coverage is ensured, and important directional feature points are avoided.

[0112] Step S312, according to the vertex point set p i} i=1 N and the direction basis matrix D, the direction-point index matrix E is obtained through extreme value retrieval.

[0113] Extreme value retrieval SIMD Dot-Max, input vertex point set and direction basis matrix D, for each vertex p i , simultaneously calculate its projection value in 26 directions s i , s i =D p T i (26 accumulation points), p T i The column vector (3x1) represents the point i . s i [ d ]=d d ·p i represents the contribution or extreme degree of point p i in direction d d . Extreme value screening, for each direction d , maintain a current maximum value max d and the corresponding point index E[ d ].

[0114] Only when s i [ d ] is greater than the maximum value max d of the current direction d e ·‖bbox‖, update. That is, s i [ d ] ≥ max d+ e• Update max when || bbox || d and E[ d ]= i , e denotes the tolerance parameter, i.e. the extremum threshold, preventing noise interference, and || bbox || denotes the diagonal length of the point cloud bounding box. That is, for each direction d, the projected value s i [ d ] of all points are compared, and the point satisfying s i [ d ] ≥ max d+ e is selected. The index of the point with || bbox || is stored in E[d].

[0115] The output direction-point index matrix is obtained, where E[ d ] stores the index of the extremum point in the direction d . The upper layer (threshold filtering layer): further screening is performed using the extremum threshold e to remove redundant points. "Few and discrete": by e controlling the spatial distribution of candidate points, coplanar or clustering is avoided.

[0116] Step S313: obtaining a candidate extremum point set according to the direction-point index matrix E and the extremum threshold e .

[0117] The candidate extremum point set has a size of ≤ 26, regardless of the number of input points. E d denotes the extremum point index (i.e. the value of E [ d ]) corresponding to the E th direction in the direction-point index matrix d , i.e. the index of the point with the largest projected value in the point cloud in the d th direction d d of the direction basis matrix D. pE d The point cloud vertex with index E d is shown in .

[0118] The matrix layering = base layer direction is multiple and fine, ensuring the coverage of extremum points; the upper layer extremum threshold e controls the discreteness, and the combination of the two layers makes the extremum points both few and far from coplanar.

[0119] Step S320: calculating the tetrahedron volume and the condition number of condition number regularization for any four points in the candidate extremum point set, obtaining the volume-condition number coupling score according to the volume and the condition number of condition number regularization, and selecting the four points corresponding to the maximum volume-condition number coupling score as the initial convex hull.

[0120] The tetrahedron is preferably with linear independent criterion, get initial tetrahedron, for constructing convex hull.

[0121] From the set C, take 4 points {a, b, c, d}, calculate all possible tetrahedron volume V, .

[0122] Volume matrix, C do triple combination That is (≤14950).

[0123] If the four points are nearly coplanar or in a narrow shape, the volume may be non-zero but extremely small, leading to unstable convex hull calculation. Conditioning regularization, introduce condition number Measure the degree of geometric degeneration, covariance matrix ∑, , reflect the distribution characteristics of three vectors, v Indicate the edge vector of the tetrahedron.

[0124] For degenerate long strip-shaped tetrahedron, define the condition number , , where λ max , λ min are the maximum and minimum eigenvalues of Σ, respectively. ≈1 indicates uniform distribution of vectors (ideal tetrahedron); 1 indicates that the vector direction is close to linear correlation (degenerate tetrahedron).

[0125] Take the volume-condition number coupling score function S=V / , traverse all tetrahedron combinations, select the four points with the maximum volume-condition number coupling score S as the initial convex hull T0. That is, maximize S while pursuing large volume and low condition number (geometric stability). That is, according to the volume-condition number coupling score S=V / k, select the optimal tetrahedron as the initial convex hull T0.

[0126] Step S330, unidirectional gradient optimization of the vertices of the initial convex hull T0 along their corresponding directions is performed to update the vertices of the initial convex hull to maximize the distance from the vertices to the boundary of the point cloud.

[0127] By adjusting the vertex position of T0, it is closer to the actual boundary of the point cloud, thereby: increasing the convex hull volume and surface area. Reducing the problem of face repetition (redundant faces) or face flipping (normal vector direction error) in subsequent iterations.

[0128] The unidirectional gradient optimization of the vertices of the initial convex hull T0 along their corresponding directions to update the vertices of the initial convex hull to maximize the distance from the vertices to the boundary of the point cloud, that is, the process of vertex sharpening includes:

[0129] Step S331, for each vertex of the initial convex hull T0 v", v" ∈T0, take its corresponding direction in the direction basis matrix D d v″ .

[0130] Step S332, do one-way distance ascent in the original point cloud s.t.d v″ · p ≥d v″ · v ″ + δ , δ is a micro-step, such as 0.002·diagonal length. In the direction d v″ , find a point v″ that is farther than the current vertex v' .

[0131] When the one-way gradient search does not find a farther point for 3 consecutive times, or the step size δ is less than 0.001·Lbb, terminate the vertex optimization.

[0132] Step S333, if a farther point v' is found, then v' replace v″ , and recalculate the volume-condition number coupled score S; iterate once to converge, update the initial convex hull.

[0133] It should be noted that according to the recalculated S, the four points corresponding to the maximum S are reselected to update the initial convex hull T0. The optimized tetrahedral vertex is closer to the point cloud bounding box, the volume and surface area are increased, and the probability of surface repetition / flip in the next iteration is reduced.

[0134] Complexity and experimental indicators for each step in step S300

[0135]

[0136] The overall complexity is close to O(N), which is suitable for large-scale point cloud processing. The tetrahedral scoring function S = V / k balances the volume and geometric stability. On a 1M point model (scanned point cloud): extreme value retrieval 12ms; optimization 1ms; sharpening 6ms; the average volume of the final tetrahedron is increased by 7x compared to random point selection; the number of iterations of the subsequent Beneath-Beyond incremental method is reduced by ≈18%.

[0137] Matrix-Layered extreme value retrieval: combine the direction vector matrix with the threshold ε in layers, and complete the extreme value point retrieval once, avoiding multiple rounds of sorting. Volume-condition number coupled scoring: use S = V / Meanwhile, "non-degeneracy" and "spatial coverage" are measured, which is more stable than taking the maximum volume alone. Unidirectional ascent gradient vertex sharpening: local climbing in the selected direction ensures that the extreme point is truly "farthest", without the need for global recalculation. Constant-level candidate set and linear scanning: the upper limit of the candidate point is determined by the direction basis matrix, which is decoupled from the input size and suitable for hardware pipelining and real-time scenarios. MLEVS uses "extreme value matrix, conditional regularization, and vertex sharpening" to make the initial convex hull tetrahedron both the largest volume and farthest from coplanar degeneration, providing high-quality seeds for subsequent Quickhull, Beneath-Beyond, or Chan incremental algorithms. The conflict graph algorithm includes:

[0138] Step S340, construct the conflict graph using the matrix contraction and smooth group rule method.

[0139] Conflict graph construction: Matrix-Contraction & Smooth-Group Conflict Graph (MCS-CG) is used for fast construction and compression of the conflict graph for QuickHull. MCS-CG significantly reduces the size and construction time of the conflict graph through "face aggregation and sparse matrix compression", providing a clear technical advantage for 3D convex hull algorithms such as QuickHull. Smooth-Group aggregation: faces with similar normal vectors are first aggregated into "smooth groups" before graph construction, and the group plane is used for the first outside judgment. Two-level matrix contraction: first, establish a sparse group-point matrix according to the group, then refine the face-point matrix only for faces with outside points within the group; empty rows / columns are immediately removed to obtain an extremely sparse final conflict graph. Adaptive error threshold α and dynamic row rearrangement ensure linear scaling even when the number of faces increases dramatically, significantly reducing memory and computational complexity. Step S341, obtain the face set F of the initial convex hull and the outside point set P´.

[0140] It should be noted that step S341 uses the initial convex hull updated in step S330, and the initial face set F, F ={ f i},4~10 4 ; outside point set P´, 10~10 6 ; the outside point set P´ is a point to be processed that is not contained in the convex hull.

[0141] Step S342, aggregate adjacent faces into a smooth group set G={gk} according to a preset angle threshold α, where the normal vector n k is calculated by the area-weighted average of the member faces.

[0142] The smoothing group rule merges the adjacent faces with close or nearly coplanar normal vectors into groups before the conflict graph construction, and replaces the multiple faces with a "group plane" to make the first out-of-plane judgment, which significantly reduces the number of faces.

[0143] Specifically, the smoothing group rule is used for adjacent face clustering. For each pair of adjacent faces sharing an edge, the normal vector angle is calculated

[0144] If the normal vector angle of the adjacent faces is less than the preset angle threshold a, they are merged into the same gk. The preset angle threshold a is in the range of 5° to 12°. For each pair of adjacent faces sharing an edge in the convex hull face set F f i , f j , the normal vector angle θ ij = cos -1 (n fi · n fj ) is calculated. If θ ij ≤ a (a ∈ [5°, 12°], they are merged into the same smoothing group gk.

[0145] The connected component merging can also be added, and the union-find set algorithm is used to cluster the mergable adjacent faces into connected groups {gk}.

[0146] Group normal vector and plane equation. For each smoothing group g k , the group plane normal vector n k is calculated. Specifically, the weighted average method (the area of the face is the weight) is used to calculate the group normal vector n k : where n f is the unit normal vector of the face f , ‖n f ‖ = 1; g k represents the kth group; A f represents the area of the face f ; G is the smoothing group set, and the group list is output. ‖n k ‖ = 1.

[0147] Group plane equation: n k · x- d k = 0, which is applicable to uniform face distribution, where d k represents the group plane constant term. d f represents the plane constant term of the face f ; α is also the aggregation angle threshold of the smoothing group set. When the size difference of the faces in the group is significant, use ,d k The group plane is calculated to pass through the member planes in the least square sense by area weighting.

[0148] Matrix shrink strategy, using dynamic bitmap, detecting all-zero row / column to pop-off immediately, avoiding empty index

[0149] The participation is involved in the subsequent operation. That is, the matrix shrink strategy realizes the real-time compression of the sparse matrix by dynamically marking the invalid data row and column and skipping the marked invalid data in the subsequent operation.

[0150] |P'| after group screening |P'|, |F'| |F|. P" represents the face set of the first-level matrix

[0151] The subset of outer points reserved after shrink; F represents the face set of the initial convex hull; F' represents the effective face set participating in conflict detection, that is, the face after the smoothing group aggregation.

[0152] Dynamic row rearrangement, if a face is deleted in incremental expansion, its row is directly marked as empty; and in the next shrink, it is deleted in O(1) without the need of full surface reconstruction. That is, the matrix supports incremental update, and only logical marking is performed when data is deleted, and unified cleaning is performed in the subsequent compression phase, avoiding real-time reconstruction.

[0153] Conflict matrix compression method: invalid data is marked dynamically, such as all-zero row / column, and marked data is skipped in subsequent calculation, and empty row / column is skipped in each iteration to realize real-time matrix compression.

[0154] Step S343, for each point p , p ∈ P´ , the signed distance Δk of the point p to the smoothing group gk plane is calculated, if Δk>0, the point p is outside the group plane, that is, the conflict outer point, which is marked as the conflict outer point and recorded in the group conflict matrix, to obtain the sparse group conflict matrix C g ; if Δk≤0, the point p is inside or coplanar with the group plane, that is, a non-conflict point.

[0155] The signed distance Δ k of the point p to the smoothing group gk plane is calculated, Δ k =n k · p - d k If Δk>0, record in the group conflict matrix C g ( k , p )=1, to obtain the sparse group conflict matrix C g .

[0156] Step S344: For the sparse group collision matrix C g Perform matrix shrinking by removing rows and columns of all zeros to obtain the compressed group conflict matrix C. g ´.

[0157] Perform matrix shrinkage by -1, removing zero rows (groups with no exterior points) and zero columns (groups with all interior points), resulting in the compressed group conflict matrix C. g ´.

[0158] Step S345: Compress the collision matrix C of the compression group. g The inner surfaces of ´ are refined to obtain the sparse surface-point matrix C. f .

[0159] According to the compression group conflict matrix C g and the set of smooth groups G={g k}, each g k Includes a list of faces within the group { f ∈g k}, where C g ´(k,p)=1 indicates that point p and group g k conflict.

[0160] The specific steps are as follows:

[0161] Step S3451: Based on the compression group conflict matrix C g ´, filter out smooth groups with at least one conflicting outgoing point.

[0162] Filter conflict groups and iterate through C g Each line of ´, i.e., group g k Only processes that satisfy Σ p C g ´( k , p A group with a value of ≥1 has at least one conflicting outgoing point.

[0163] Step S3452: For each conflict group g k traverse its face f ∈g k Only the signed distance Δ from the conflict point to the surface f is calculated. f Δ f =n f ·p- d f .

[0164] Intra-group conflict detection, for each conflict group g k traverse all its faces f ∈g k And check the group conflict points p C g ´(k , p )=1, is it related to the face? f Conflict, calculation point p to noodles f Signed distance: Δ f = n f · p - d f ,in, n f Representation surface f The unit normal vector, p This represents the coordinates of the point to be detected (a 3D vector), the coordinates of the point in the world coordinate system. d f Representation surface f The plane constant term.

[0165] Step S3453, if Δ f >ε plane Then in the surface-point matrix C f The middle label corresponds to the conflict relationship, i.e., label C. f ( f , p ) = 1. Δ f =ε plane ,point p On a plane; Δ f <ε plane ,point p In the plane, inside the convex hull, at non-collision points, we obtain the sparse surface-point matrix C. f .

[0166] e plane ε is the tolerance threshold. plane =1e-8 L bb , e plane Used to filter floating-point errors and minute noise, its value is related to the point cloud scale Lbb, ensuring the algorithm is applicable to models ranging from micrometers to kilometers in size. ε plane Effectively filters floating-point errors, with a dynamic threshold εplane∝Lbb, compatible with point clouds of different sizes.

[0167] Only for C g The group whose ´(k,·)=1; determine the Δ point by point on its corresponding surface. f Fill in the surface-point matrix C f ( f , p =1.

[0168] Step S346, Opposite-point matrix C fRemove all-zero rows / columns, get final conflict graph C MCS .

[0169] Face-Point matrix C f Remove zero rows / columns, realize matrix shrink-2, output final conflict graph C MCS and each row face ID for direct query in QuickHull extension phase.

[0170] Experimental verification

[0171]

[0172] Hardware: AMD Ryzen 77840HS; Implementation: C++20+SIMD+OpenMP.

[0173] Threshold α =8°, ε plane =1e-8 L bb . Results show that group aggregation and double shrink bring ≈3x speedup and more than 75% memory saving, and have no effect on the final QuickHull output vertex sequence (verify RMS error <1e-7m).

[0174] Smooth-Group aggregation: merge faces with similar normal vectors into "smooth groups" before mapping, and use group planes to make the first outside judgment. Two-level matrix shrink: first establish a sparse group-point matrix Gg according to groups, and then refine only the faces with outside points in the group to a face-point matrix Gf; empty rows / columns are removed to get an extremely sparse final conflict graph. Adaptive threshold α The angle threshold α is the condition judgment, and the shrink matrix is used for face removal. Dynamic reorganization ensures that the number of faces increases rapidly while still linearly stretched, significantly reducing memory and computational complexity.

[0175] Step S350, the incremental convex hull algorithm uses a bucketized maximum distance selector BMD Select and an incremental horizon cache IHC Cache to generate a final convex hull based on the initial convex hull and the conflict graph.

[0176] Incremental QuickHull integrated process: in a million-level three-dimensional point cloud scene, to construct an accurate and complete three-dimensional convex hull with the smallest memory occupation and near-linear time. By introducing two technologies, the bucketized maximum distance selector BMD Select and the incremental horizon cache IHC Cache, the overall incremental QuickHull achieves higher computing speed and memory saving.

[0177] The entire incremental convex hull algorithm forms a complete, efficient, and robust technology chain, consisting of data validity detection, initial shell, conflict graph, and iterative expansion. It can be directly applied to industrial scenarios such as laser point cloud, CAD assembly inspection, and SLAM map envelope removal.

[0178] The specific steps are as follows:

[0179] Step S351: Obtain the initial convex hull and conflict graph C MCS .

[0180] Based on the initial shell of the MLEVS tetrahedron and the MCS-CG structural conflict diagram C MCS For initial preparation, the data comes from a point cloud dataset P and the face set F of the initial convex hull. The conflict graph C... MCS The conflicting external points of the initial convex hull can be obtained from this.

[0181] Step S352: Based on the initial convex hull face set F and its conflicting external points, use the bucketized maximum distance selector BMDSelect to calculate the farthest point d among the conflicting points of each face. max (f) and select the global farthest point using a bucket heap. .

[0182] Specifically, it includes the following steps:

[0183] Step S3521: From each face containing conflicting external points f traverse its conflict outlier set { p}, calculate the signed distance d between each point. f Read the maximum distance d max ( f This yields the local farthest distance and its corresponding point for each face. f Calculate d max ( f ) .

[0184] Step S3522, Place the dough f according to Assign them to the corresponding buckets. Each bucket maintains a max-heap, ordered by d. max ( f Sort.

[0185] Based on bucketing distance value Insert into a Bucketed Max-Heap, where b is the bucket index, i.e., the bucket number. Then... f Inserting bucket b into the corresponding max-heap Heap[b] (which is a regular max-heap with key = d) max In the context of ), Heap[b] represents a linked max-heap indexed by bucket number b. d max ( frepresentative face f of all conflicting outer points to the face. The bucketed max distance selector buckets faces by distance interval, maintaining a max heap per bucket.

[0186] Step S3523, pop the top of the heap from the largest non-empty bucket f * and confirm the global farthest point from the conflicting row of f * . p * .

[0187] That is, pop the face from the bucket heap f * , get all conflicting points from its conflicting row (i.e., the C MCS matrix row corresponding to f * ; find the maximum distance point among the conflicting points recorded in that row p * .

[0188] Specifically, take the largest bucket number b * , pop the top of the heap face f * , and from the face f * , re-scan the conflicting outer points associated in the C MCS matrix of . Complexity: insertion / update O(1), heap pop O(logn_b)≈constant.

[0189] Heap pop gives the global farthest point p * and its conflicting face list F vis . Delta represents the distance bucket width, empirically 0.01·diagonal length, i.e., Delta=0.01 x bounding box diagonal length L bb . d max ( f ) represents the maximum distance in the conflicting row of face f , i.e., the maximum signed distance from the face f to all conflicting outer points.

[0190] The "bucket first, heap second" feature of BMD Select prioritizes large facelets, and takes the extreme value within the face; only fixed bucket chain heap operations are needed, with amortized O(1) maintenance: insertion and update only do fixed bucket linked list operations; heap pop can get the global p * , avoiding NlogN full scan.

[0191] Step S353, collect visible faces.

[0192] According to the conflict edge data, collect visible faces F vis ={ f In f , p * - d f > 0, F vis represents the selection of the farthest outer point p * visible face set, p * represents the farthest outer point selected in this round.

[0193] Step S354, search the horizon edge through the incremental cache IHC Cache.

[0194] Visit all visible faces F vis , for each shared edge (E v i , v j ), check whether the adjacent face of each edge (E v i , v j ) is outside F vis , if so, the adjacent face is invisible, then (E v i , v j ) is counted as a horizon edge; and write in the cache table Hash (E v i , v j ). Position the convex hull boundary.

[0195] When a face is deleted, all its adjacent edges are marked as dirty in the DirtyFlag. The IHC Cache structure EdgeHash, field key=ordered endpoints (E v i , v j ), val={adjacent face A, adjacent face B}; the structure DirtyFlag, field adjacent edge is marked as dirty when the face is deleted; only traverse the dirty edges to find new horizons.

[0196] Only check whether the dirty edge is a horizon, and update the EdgeHash.

[0197] When a new face is added or a face is deleted, dynamically update the EdgeHash and DirtyFlag to maintain consistency with the index of the CMCS. Among them, the EdgeHash is a hash table with edges as keys, storing adjacent face information; the DirtyFlag is a bitmap marking the edges that need to be updated

[0198] The features are: one-time writing and multiple-time reading; after initial writing, only dirty bits are modified by incrementally adding or deleting, without recalculating the full adjacency. Horizon search starts from the DirtyFlag edge and ends at O(h) (h = horizon edge number), instead of full visible face BFS; cache is updated synchronously with MCS-CG to keep the index consistent. Only dirty edges (edges whose adjacency faces have changed) are traversed to avoid full BFS scanning, and the search complexity is reduced from O(|F|) to O(h) (h is the number of horizon edges) by a dirty edge marking mechanism, and the conflict graph index is maintained synchronously.

[0199] Step S355, when deleting a visible face, update the face set F and the conflict graph C synchronously by logical marking MCS Index, and perform physical deletion uniformly in the subsequent compression stage.

[0200] Delete the visible face, update the face set F and the conflict graph C synchronously. Like logical marking to update the index, delay physical deletion. The logical marking uses a bitmap data structure, with 1 bit marking for each face / point:

[0201] 1 indicates to be deleted; when querying, automatically skip elements with marked bits of 1; in the matrix contraction stage, all marked items are cleared in batches.

[0202] Step S356, insert a new face, and p * Form a new triangular face f new Merge F; update the face normal and plane constant. The normal vector of the new face is n new calculated from the horizon edge v i , v j and : n new = normalize(( v j - v i ) x ( - v i )). The plane constant item is d new , d new = n new · v i .

[0203] Step S357, update the conflict graph according to the new face set, adjacency information and external point set.

[0204] IHC is used to provide fast candidates for adjacent outer points for each newly added face; outer points are determined point by point and written to C. MCS Empty rows / columns trigger matrix shrinkage. (C) MCS Let F represent the sparse surface-point conflict matrix. Let F represent the current convex hull set, and P represent the world coordinate point set.

[0205] The specific steps are as follows:

[0206] Step S3571: Provide a set of candidate conflicting outliers for newly added faces through incremental horizon caching.

[0207] Query the EdgeHash of all edges on the newly added face to obtain the set of external vertices that have clashed with these edges. .

[0208] Step S3572: Calculate the signed distance for only candidate outliers and update the conflict matrix.

[0209] For each candidate point p ∈ P candidate Calculate the signed distance Δ f = n f new· p - d f ,in, n f new Add a normal vector to the new surface.

[0210] Update the conflict matrix .

[0211] Step S3573: Dynamically trigger matrix shrinkage and delete empty rows / columns to maintain sparsity.

[0212] Triggering condition, blank line: a certain face f All C MCS ( f ,·)=0 (no conflict points); Empty column: a certain point p All C MCS (·, p =0 (no conflict surfaces). Use a dynamic bitmap to mark empty rows / columns; physical deletion is delayed until the next operation.

[0213] Step S3574: Synchronize the index, update the IHCCache, write the edge information of the newly added face to EdgeHash, and synchronize the conflict points to DirtyFlag for subsequent retrieval. Complexity: Conflict detection: O(| P candidate |); Matrix contraction: O(1) marking and lazy deletion. Update the conflict graph to achieve O(1) complexity lazy deletion.

[0214] Step S358, when the conflict graph C MCS If there is no non-zero element in the conflict matrix C

[0215] If the conflict graph C MCS All zero, i.e. ‖C MCS ‖0=0, then terminate the determination DONE and jump to step S359; otherwise, return to step S352 to continue selecting the farthest point.

[0216] Determination condition: the sparse norm ‖C MCS ‖0=0 of the conflict graph C

[0217] Step S359, when the conflict graph C MCS is empty, output the vertex and patch data of the convex hull to obtain the final convex hull; otherwise, continue iteration.

[0218] Specifically, the vertex coordinates of the convex hull, the triangular patch index, and the body grid topology relationship can be output. Output, vertex set: three-dimensional coordinates of all vertices of the convex hull; patch set: vertex index of the triangular patch; optional output body grid: tetrahedron or other body unit.

[0219] Experimental comparison

[0220]

[0221] Average 3x speed improvement; conflict matrix and edge cache peak memory saving ≈70%; convex hull vertex error <1e-7m, consistent with the benchmark. BMD-Select: bucketized max distance heap, constant level farthest point selection; IHC-Cache: incremental horizon cache and dirty edge mechanism, horizon search from O(|F|) to O(h).

[0222] Step S400, determine the center of the three-dimensional model as the center of the sphere network according to all vertex coordinates of the target three-dimensional model, initialize the radius covering model in combination with pre-set spherical parameters, generate a hierarchical sphere network covering the target model, emit a ray along the spherical normal direction to the target model surface, correct the vertex position layer by layer to approximate the target model surface, and output the collision body network for collision detection. The spherical parameters include: initial radius r and latitude and longitude subdivision degree.

[0223] Multi-level latitude and longitude sphere grid progressive wrapping algorithm

[0224] Existing convex hull algorithms (QuickHull, etc.) have irregular vertex distribution, LOD is difficult to quantify, and real-time efficiency is limited. Regular spherical subdivision grid is easy to manage LOD, but has poor fitting degree with complex models and loose envelope.

[0225] The algorithm can automatically generate multi-level spherical mesh and progressively fit the model through a small amount of parameter quantization control, balance the envelope accuracy and generation speed, facilitate the rapid establishment of efficient collision bodies in game engines, simulation, CAD and other scenes, and is easy to integrate into the existing LOD / MeshColider pipeline to realize integrated optimization of rendering and physics.

[0226] The specific steps are as follows:

[0227] Step S410, determining the model center according to all vertex coordinates of the three-dimensional model mesh data, and taking the model center as the spherical center of the spherical network.

[0228] Determine the uniform reference center point, collect vertex information, and read all N' vertex coordinates of the target three-dimensional model M V i ' x i y i z i .

[0229] Calculate the geometric center according to the formula , and N' represents the total number of vertexes of the original target three-dimensional model.

[0230] Obtain the model center C' as the spherical center of the spherical mesh. C' is the uniform center point.

[0231] Coordinate normalization: perform translation T (-C) to move the model as a whole to the origin, and eliminate the accumulation of subsequent floating-point errors.

[0232] Step S420, set multi-level spherical parameters, wherein the spherical parameters include: initial radius r and latitude and longitude subdivision degree.

[0233] Multi-level spherical parameter setting, initial radius r = α·AABB bounding box diagonal length L bb ; initial radius r determination: take the longest body diagonal of the model axis-aligned bounding box , let , ensure that the spherical envelope completely covers the model. α is the initial radius coefficient, α ∈ [1.1, 1.5].

[0234] Subdivision degree setting: set the basic latitude number and the longitude number .

[0235] Level increment rule: the l th layer latitude subdivision degree , the l th layer longitude subdivision degree​​​ , l ∈ [0, L ], L controlled by the precision threshold τ. The initialization radius covers the three-dimensional model.

[0236] Step S430, according to the hierarchical latitude-longitude subdivision number, obtain latitude and longitude angles, combine the spherical center coordinates and the initial radius to calculate the corresponding vertex coordinates, and index the quadrilateral or triangular patches and generate UV to obtain the hierarchical latitude-longitude spherical network, wherein each vertex caches a ray vector in the direction of the spherical normal direction thereof. The latitude-longitude spherical network is wrapped outside the model. i , j index the quadrilateral or triangular patches and generate UV to obtain the hierarchical latitude-longitude spherical network, wherein each vertex caches a ray vector in the direction of the spherical normal direction thereof. The latitude-longitude spherical network is wrapped outside the model.

[0237] Specifically, the latitude-longitude spherical mesh generation process includes:

[0238] Step S431, according to the hierarchical latitude-longitude subdivision number, respectively calculate discrete latitude and longitude angles.

[0239] The latitude angle calculation formula is , θ i indicates the latitude angle of the node i ; the longitude angle calculation formula is , φ indicates the longitude angle of the node j .

[0240] Step S432, calculate the vertex coordinates according to the spherical center, the initial radius and the latitude and longitude.

[0241] The spherical vertex coordinate calculation formula is , wherein is the l layer i , j node vertex.

[0242] Step S433, index the quadrilateral or triangular patches; simultaneously generate UV to obtain the latitude-longitude spherical network. i , j index the quadrilateral or triangular patches; simultaneously generate UV to obtain the latitude-longitude spherical network.

[0243] topologically connect, index the quadrilateral or triangular patches; simultaneously generate UV, i , j topologically connect, index the quadrilateral or triangular patches; simultaneously generate UV, , v =1- θ i / π.

[0244] Step S434, cache a ray vector in the direction of the spherical normal direction of the vertex.

[0245] cache the vertex ray vector and record the unit vector , Unit vector of the ray, the ray direction is consistent with the spherical normal vector, for subsequent steps. The ray is emitted along the spherical normal direction to detect the outer surface collision of the model.

[0246] Step S440, ray detection is performed along the spherical normal direction, and the grid vertex position is adjusted layer by layer to approximate the target model surface.

[0247] Ray detection and vertex position correction. Emit a ray from the center of the sphere to the outer surface of the model. l Any vertex of the layer Along a ray Direction, maximum detection distance l max = r The maximum range of the sphere is wrapped around the outer surface of the point cloud of the mesh, and each vertex emits a return collision point.

[0248] Hit judgment, such as the ray hitting the model surface, getting the collision point p ij And the distance to C distance p ij -C

[0249] Adjustable scaling update; set the user magnification coefficient k ∈ [0, 1], calculate k is the vertex magnification coefficient, which adjusts the tightness of the envelope.

[0250] Miss processing: if there is no collision, let (unit same as model), shrink to a safe distance.

[0251] Vertex cache replacement: overwrite the original vertex of the sphere with Complete the current layer refinement.

[0252] Step S450, when the maximum residual error of the grid vertex and the model surface is less than the preset threshold τ, then terminate the refinement.

[0253] According to the comparison of the maximum residual error and the preset threshold τ, it is judged whether to terminate the refinement. Error evaluation and level progression, maximum residual error calculation , e (l) is l The maximum residual error of the layer.

[0254] Threshold comparison, if e (l) ≤τ, typically τ=0.5% diagonal length, then terminate the refinement; otherwise, execute steps S420~S440, enter l +1 layer. τ is the error stop threshold, τ is determined according to actual situation or experience experiment.

[0255] Result cache, keep each layer network data for LOD scheduling.

[0256] Step S460, the package network outputs and applies.

[0257] The convex hull optimizes the calculation efficiency as an intermediate result, the convex fast eliminates invisible areas, the sphere network is approximated to the original model according to the LOD hierarchy, and the balance between real-time performance and accuracy is achieved. The final collision body network is a hierarchical sphere grid, which supports non-convex collision detection; if a convex collision body is needed, an optimized convex hull can be regenerated based on the vertices of the sphere grid, and the original convex hull is deleted. The number of original convex hull surfaces is dozens of times that of the convex hull regenerated after the uniform sphere is wrapped. The original convex hull is deleted after the calculation is completed.

[0258] Data arrangement, generate files WrapSphere_L{1}.mesh / .bytes, containing vertices, indices, UV.

[0259] Collider baking: call Physics.BakeMesh() or equivalent API to convert the network into the internal acceleration structure of MeshCollider.

[0260] LOD binding: in the game engine or simulation system, mount L0-L network to LODGroup, or dynamically switch according to distance / error.

[0261] Performance calibration: record the generation time , compression rate , , and compare with the baseline algorithm such as QuickHull.

[0262] Result quantization index: vertex compression rate , that is, the ratio of the number of vertices, typical value L0: 0.16%, L2: 0.64%; patch compression rate , that is, the ratio of the number of patches, typical value L2≈1.2%; maximum envelope error , that is, the minimum distance from any model point to the envelope network, typical value L0: 1.8% edge length, L2: 0.4%; generation time , that is, single-thread CPU / GPU parallelism, typical value L2 (26,000 vertices): CPU 42ms; GPU 7ms. Compared with the classic QuickHull: at the same δ max , the number of vertices is reduced by about 65%, and the regular latitude and longitude distribution is convenient for GPU Batch; the sphere network can be directly mapped to UnityLODGroup according to the level, and the switching overhead is extremely small. l

[0263] Advantages of the embodiments of the present disclosure: 1. Parameterized quantification: only can the accuracy-efficiency curve be reproduced and controlled. 2. Cross-LOD error closed loop: residual​e (l) As a stopping criterion, the multi-level refinement is automatically completed without human intervention.3. Ray length self-limiting: l max = r Effective shielding of useless penetration, upper bound of calculation , GPU parallelism.4. Regular topology: natural alignment of latitude and longitude networks UV, compatible with terrain baking and global lighting. Industrial applicability: verified in Unity2022.3LTS+Burst1.9 environment, can generate multi-order MeshCollider by one key physics.BakeMese().

[0264] The advantage of the minimum distance prevents numerical instability: if the vertex is completely collapsed to the center of the sphere (distance = 0), it will cause: the area of the triangle is zero (rendering error). The normal calculation is invalid (lighting anomaly).

[0265] Maintain the validity of the topology: the minimum distance ensures that the mesh always maintains the manifold structure, avoiding non-manifold edges.

[0266] The embodiment of the disclosure establishes a unified point cloud set to realize the unified topological wrapping of multiple three-dimensional objects by using an efficient incremental convex hull algorithm combined with a spherical mesh shrinking technology. This method significantly reduces the number of vertices and faces of the mesh, while ensuring visual fidelity and collision accuracy, greatly reducing the consumption of computing resources, and is suitable for real-time and efficient interactive applications.

[0267] As Figure 3 shown, another aspect of the embodiment of the disclosure provides a three-dimensional object collision detection wrapping mesh generation system, which comprises:

[0268] An initial center generation module 100 is configured to extract all vertex data of a first object according to serialized sub-Mesh data groups of a three-dimensional model, and determine an initial center point of the first object.

[0269] A coordinate system transformation module 200 is configured to convert each vertex of each sub-Mesh data in the sub-Mesh data groups from a local coordinate system to a global world coordinate system, record a unique identifier ID of each point, and generate a unified world coordinate system point cloud data set; wherein the global world coordinate system is a coordinate system with the initial center point as the origin.

[0270] A convex hull generation module 300 is configured to construct an initial convex hull according to the point cloud data set by using a matrix hierarchical extreme value retrieval algorithm, and generate a final convex hull wrapping all objects of the three-dimensional model by using a conflict graph and an incremental convex hull algorithm, wherein the incremental convex hull algorithm comprises a bucketized maximum distance selection and an incremental horizon buffer.

[0271] The collision body network production module 400 is used for determining a center of the three-dimensional model as a spherical center of the spherical network according to all vertex coordinates of the target three-dimensional model, generating a hierarchical spherical network covering the target model in combination with preset spherical parameters, emitting a ray along a spherical normal direction to the surface of the target model, correcting the vertex position layer by layer to approximate the surface of the target model, and outputting the collision body network for collision detection. The spherical parameters include an initial radius r and latitude and longitude subdivision degrees.

[0272] In another aspect, the disclosure provides a computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the method described above.

[0273] In another aspect, the disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described above.

[0274] The embodiments of the disclosure have the following advantages over the prior art:

[0275] 1. A multi-object collision wrapping calculation method based on spherical grid contraction and incremental convex hull algorithm, characterized by efficiently and uniformly processing multiple three-dimensional objects, and significantly optimizing the calculation performance and visual effect.

[0276] 2. Efficient generation of incremental convex hull is realized by unified point cloud data construction and conflict graph optimization.

[0277] 3. The collision grid structure and precision are optimized through fine spherical grid parameterization setting and ray detection.

[0278] The above description is only the preferred embodiments of the disclosure, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the embodiments of the disclosure, a number of improvements and refinements can be made, which should be regarded as the protection scope of the embodiments of the disclosure.

Claims

1. A method for generating a wrapping mesh for collision detection of three-dimensional objects, characterized in that, The method includes: Based on the serialized sub-mesh data group of the 3D model, extract all vertex data of the first object and determine the initial center point of the first object; For each vertex of each sub-mesh data in the sub-mesh data group, the local coordinate system is transformed to the global world coordinate system, the unique identifier ID of each point is recorded, and a unified world coordinate system point cloud dataset is generated; where the global world coordinate system is a coordinate system with the initial center point as the origin; The initial convex hull is constructed using a matrix hierarchical extreme value retrieval algorithm based on the point cloud dataset. The final convex hull that encloses all objects in the 3D model is generated using a conflict graph and incremental convex hull algorithm. The incremental convex hull algorithm includes bucketing maximum distance selection and incremental horizon caching. Based on the coordinates of all vertices of the target 3D model, the center of the 3D model is determined as the center of the sphere network. Combined with the pre-set sphere parameters, a hierarchical sphere network covering the target model is generated. Rays are emitted towards the surface of the target model along the sphere normal direction, and the vertex positions are corrected layer by layer to approach the surface of the target model. A collision body network is output for collision detection. The sphere parameters include: initial radius r and latitude and longitude subdivision.

2. The method according to claim 1, characterized in that, After generating a unified world coordinate system point cloud dataset, the method further includes: Get the vertex set of all sub-mesh arrays; Determine if the number of vertices is greater than or equal to a preset threshold; if so, proceed to the next step. Use hash / KD-Tree to remove duplicate points and generate a deduplicated point set. and update the number of vertices. ; Randomly select three points a, b, and c, and calculate the magnitude of the cross product of the vectors ||(ba)×(c - a)||. If ||(ba)×(c - a)|| ≥ 0, then the result is positive. ε L If there are three non-collinear points, proceed to the next step; if || (ba)×(ca) || < ε L Then, iterative resampling is performed. If all N consecutive random samples satisfy || (ba)×(ca) || < ε L If the points are collinear, then FAIL_LINE is returned; where a, b, and c are the vertex coordinates, and ba and c - a represent the subtraction of coordinate vectors, respectively. ε L Indicates collinearity tolerance; Randomly sample any point d outside of the three non-collinear points, and calculate the scalar triple product |(b - a) ·((c - a)×(d - a))|×(1 / 6) to obtain the volume V. If V ≥ ε P If point d is not coplanar with points a, b, and c, proceed to the next step; where, ε P Indicates coplanar tolerance; Calculate the diagonal length of the bounding box in the mesh data L bb According to the formula ε L = L bb ×10 -6 and ε P = L bb 3 ×10 -12 Dynamically set tolerance value; Returns the set of points that pass the verification, which can be used for convex hull generation.

3. The method according to claim 1 or 2, characterized in that, The initial convex hull is constructed using a matrix hierarchical extreme value retrieval algorithm based on the point cloud dataset, including: Based on the point cloud dataset, a set of candidate poles is obtained through hierarchical matrix and extreme value retrieval. The hierarchical matrix includes 26 discrete direction vectors covering three-dimensional space. For any four points in the candidate pole set, calculate the tetrahedral volume and the condition number regularized by the condition number. Based on the volume and condition number, obtain the volume-condition number coupling score. Select the tetrahedron corresponding to the maximum volume-condition number coupling score as the initial convex hull T0. For the vertices of the initial convex hull T0, perform unidirectional gradient optimization along their corresponding directions, and update the vertices of the initial convex hull with the goal of maximizing the distance from the vertex to the boundary of the point cloud.

4. The method according to claim 3, characterized in that, The conflict graph is constructed using a matrix contraction and smoothing group rule method, including the following steps: Obtain the face set F and the external point set P' of the initial convex hull; According to the preset included angle threshold α Aggregate adjacent faces into a smooth set G={g k }; For each point p Calculation points p The signed distance Δk to the smooth group gk plane, Δ k = n k · p - d k If Δk > 0, then point p is marked as an external point of conflict, generating a sparse set of conflict matrices C. g , where n k Represents the normal vectors of the group of planes. d k Represents the plane constant term; For sparse group collision matrix C g Perform matrix shrinking by removing rows and columns of all zeros to obtain the compressed group conflict matrix C. g ´; For the compression group conflict matrix C g The inner surfaces of ´ are refined to obtain the sparse surface-point matrix C. f ; Opposite-point matrix C f After removing rows / columns containing all zeros, the final conflict graph C is obtained. MCS .

5. The method according to claim 4, characterized in that, The compression group conflict matrix C g The inner surfaces of ´ are refined to obtain the sparse surface-point matrix C. f ,include: Filtering the compression group conflict matrix C g There exists a smooth group with at least one conflicting outgoing point in the '. For each conflict group g k traverse its face f ∈g k Only for C g Calculate the signed distance Δ from the marked conflict out-of-bounds point to surface f. f ; If Δ f >ε plane If the surface-to-point collision is identified, a sparse surface-to-point matrix C is obtained. f .

6. The method according to any one of claims 5, characterized in that, The incremental convex hull algorithm employs a bucketed maximum distance selector (BMD Select) and an incremental horizon cache (IHC Cache) to generate the final convex hull based on the initial convex hull and the conflict graph, including: Obtain the initial convex hull and conflict graph C MCS ; Based on the initial convex hull set F and its conflicting external points, the bucketized maximum distance selector (BMD Select) is used to calculate the farthest point d among the conflicting points of each face. max ( f And select the global farthest point using a bucket heap. ; Collect visible F vis, F vis ={ f |n f · p * - d f >0}, F vis Indicates to p * Meeting in person is possible. p * This indicates that the farthest outer point is selected in this round, where, d f For noodles f The plane constant term, n f For noodles f The normal vector; Search the horizon edge using the incremental cache (IHC Cache); Delete visible faces and synchronously update the face set F and the conflict graph CMCS; Insert a new face, with the horizon edge and p * Form a new triangle f new Incorporate into F; update surface normal and plane constant; Update the conflict graph based on the newly added face set, adjacency information, and exterior point set; When the conflict graph C MCS If there are no non-zero elements in the convex hull and ||CMCS||0 = 0, the convex hull construction is considered complete; otherwise, continue iterating to select the farthest point. When the conflict graph C MCS When empty, output the vertex and face data of the convex hull to obtain the final convex hull.

7. The method according to claim 6, characterized in that, The step of updating the conflict graph based on the newly added face set, adjacency information, and exterior point set includes: Provide a set of candidate conflict outliers for new faces through incremental horizon caching; Signed distances are calculated and the conflict matrix is ​​updated only for candidate outliers; Dynamically trigger matrix shrinkage and remove empty rows / columns to maintain sparsity; Synchronize the index, update the IHCCache, write the edge information of newly added faces to EdgeHash, and synchronize the collision points to DirtyFlag for subsequent retrieval.

8. The method according to any one of claims 7, characterized in that, The process involves determining the center of the 3D model as the center of the sphere network based on the coordinates of all vertices of the target 3D model. Combined with pre-set spherical parameters, a hierarchical sphere network covering the target model is generated. Rays are emitted along the sphere normals towards the target model surface, correcting vertex positions layer by layer to approximate the target model surface, and outputting a collision detection network. The sphere parameters include: an initial radius *r* and latitude / longitude subdivision, including: Based on all vertices of the target 3D model, determine the model center and use it as the center of the sphere network; Multi-level spherical parameters are preset, wherein the spherical parameters include: initial radius r and latitude and longitude subdivision; Based on the hierarchical latitude and longitude subdivisions, the latitude and longitude angles are obtained. Combined with the sphere's center coordinates and the initial radius, the corresponding vertex coordinates are calculated. i , j The index creates quadrilateral or triangular patches and generates UVs to obtain a hierarchical latitude and longitude sphere network, where each vertex caches the ray vector of its spherical normal direction, and the latitude and longitude sphere network wraps around the outside of the model; Ray detection is performed along the normal direction of the sphere, and the position of the mesh vertices is adjusted layer by layer to approximate the surface of the target model. When the maximum residual between the mesh vertex and the model surface is less than the preset threshold τ, the final collision body network is output.

9. A three-dimensional object collision detection and wrapping mesh generation system, characterized in that, The system includes: The initial center generation module is used to extract all vertex data of the first object from the sub-mesh data group after the 3D model is serialized, and to determine the initial center point of the first object. The coordinate system transformation module is used to transform each vertex of each sub-mesh data in the sub-mesh data group from the local coordinate system to the global world coordinate system, record the unique identifier ID of each point, and generate a unified world coordinate system point cloud dataset; wherein, the global world coordinate system is a coordinate system with the initial center point as the origin; The convex hull generation module is used to construct an initial convex hull based on the point cloud dataset using a matrix hierarchical extreme value retrieval algorithm, and to generate the final convex hull that encloses all objects in the 3D model using a conflict graph and incremental convex hull algorithm. The incremental convex hull algorithm includes bucketing maximum distance selection and incremental horizon caching. The collider network generation module is used to determine the center of the 3D model as the center of the sphere network based on the coordinates of all vertices of the target 3D model. Combined with pre-set sphere parameters, it generates a hierarchical sphere network covering the target model. Rays are emitted along the sphere normal direction to the surface of the target model, and the vertex positions are corrected layer by layer to approach the surface of the target model. The collider network is then output for collision detection. The sphere parameters include the initial radius r and the latitude and longitude subdivision.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Collision detection method based on Bloch spherical coordinates and quantum computing

    CN103679271A

  • Mixed collision detection method based on convex hull and pre-judgment

    CN113051730A