Three-dimensional object collision detection package grid generation method and system, storage medium and program product

By generating a unified world coordinate point cloud dataset and using a matrix hierarchical extreme value retrieval algorithm and an incremental convex hull algorithm, the problem of balancing visual effects and computational performance in three-dimensional object collision detection is solved, and efficient collision detection is achieved.

CN120689554AActive Publication Date: 2025-09-23QIXIN (GUANGZHOU) DIGITAL TECHNOLOGY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

Existing collision detection methods for three-dimensional objects struggle to strike a balance between visual effects and computational performance. Calculating the collision box alone leads to large visual errors, while calculating the complete mesh is too expensive to meet the needs of real-time applications.

Method used

A three-dimensional object collision detection wrapping mesh generation method is adopted. By generating a unified world coordinate system point cloud dataset, the matrix hierarchical extreme value retrieval algorithm and incremental convex hull algorithm are used to construct the initial convex hull, and the hierarchical sphere network is generated in combination with spherical parameters for collision detection, reducing the number of mesh vertices and faces and improving computational efficiency.

Benefits of technology

It significantly reduces computing resource consumption, ensures visual realism and collision accuracy, and is suitable for real-time and efficient interactive applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689554A_ABST
    Figure CN120689554A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional object collision detection parcel grid generation method and system, a storage medium and a program product, and the method comprises the steps: extracting all vertex data of a first object according to a sub-Mesh data set after serialization of a three-dimensional model, and determining an initial center point; each vertex of each piece of sub Mesh data is converted from a local coordinate system to a global world coordinate system, and a point cloud data set is generated; constructing an initial convex hull by adopting a matrix hierarchical extremum retrieval algorithm, and generating a final convex hull by adopting a conflict graph and incremental convex hull algorithm; initializing a radius coverage model by taking the geometric center of the model as a sphere center; performing subdivision according to longitude and latitude to generate a hierarchical ball grid; emitting rays, correcting vertex positions layer by layer, approaching the surface of the model, and outputting a collider network. Through the overall point cloud set, the incremental convex hull algorithm and the spherical grid contraction technology, unified topological wrapping of the multiple three-dimensional objects is achieved, the visual fidelity and the collision precision are ensured, and resource consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of computer graphics collision detection, and in particular to a method and system for generating a three-dimensional object collision detection wrapping grid, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the rapid development of computer graphics, collision detection technology is becoming increasingly mature. Collision detection is a key technical difficulty and computing resource consumption point in computer application fields such as graphics, virtual reality, and artificial intelligence, and has a wide range of applications.

[0003] When calculating collisions between multiple three-dimensional objects, current physics engines generally use separate collision boxes or complete meshes. The former leads to large visual errors, while the latter has extremely high computational costs and cannot meet the needs of real-time applications.

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

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

[0006] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present disclosure are as follows:

[0007] In one aspect, the present disclosure provides a method for generating a wrapping grid for collision detection of a three-dimensional object, the method comprising:

[0008] Extract all vertex data of the first object from the sub-Mesh data group serialized from the 3D model and determine the initial center point of the first object;

[0009] Convert each vertex of each sub-mesh data in the sub-mesh data set 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; the global world coordinate system is a coordinate system with the initial center point as the origin;

[0010] An initial convex hull is constructed based on the point cloud dataset using a matrix hierarchical extreme value retrieval algorithm. A conflict graph and an incremental convex hull algorithm are then used to generate a final convex hull that encapsulates all objects in the 3D model. The incremental convex hull algorithm includes bucketed maximum distance selection and incremental horizon caching.

[0011] Based on the coordinates of all vertices of the target 3D model, determine the center of the 3D model as the center of the spherical network. Combine the preset spherical parameters to generate a hierarchical spherical network covering the target model.发射射线 emit rays along the spherical normal direction towards the surface of the target model,逐层修正顶点位置 gradually correct the vertex positions layer by layer,逼近目标模型表面 approximate the surface of the target model, and输出碰撞体网络 output the collision body network for collision detection;其中,所述球面参数包括:初始半径r以及经纬度细分度。 Among them, the spherical parameters include: the initial radius r and the latitude and longitude subdivision degrees.

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

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

[0014] Judge whether the number of vertices is greater than or equal to the preset threshold. If so, proceed to the next step;

[0015] Use hash / KD-Tree to remove duplicate points and generate the point set after duplicate removal And update the number of vertices ;

[0016] Randomly select three points a, b, c, and calculate the modulus of the vector cross product ||(b - a) × (c - a)||. If ||(b - a) × (c - a)|| ≥ ε L , then there are three non-collinear points, and proceed to the next step; if ||(b - a) × (c - a)|| < ε L , then resample. If the continuous N″ times of random sampling all satisfy ||(b - a) × (c - a)|| < ε L , then determine that the point set is collinear and return FAIL_LINE; where a, b, c are vertex coordinates, b - a and c - a respectively represent the subtraction of coordinate vectors, and ε L represents the collinearity tolerance;

[0017] 随机采样非共线三点外的任意一点d,计算标量三重积丨(b-a)·((c-a)×(d-a))丨×(1 / 6),得到体积V,若V≥ε P 表示点d与a,b,c四点不共面,进行下一步;其中,ε P 表示共面容差;

[0018] Calculate the diagonal length L of the bounding box in the Mesh data bb , according to the formula ε L = L bb × 10 -6 and ε P = L bb 3 × 10 -12 Dynamically set the tolerance value;

[0019] Returns a set of points that pass the validation for use in convex hull generation.

[0020] Optionally, constructing an initial convex hull based on the point cloud dataset using a matrix hierarchical extreme value retrieval algorithm includes:

[0021] According to the point cloud dataset, a set of candidate extreme points is obtained through hierarchical matrix and extreme value retrieval, where the hierarchical matrix includes: 26 discrete direction vectors covering three-dimensional space;

[0022] Calculate the tetrahedron volume and the condition number regularized by the condition number for any four points in the candidate extreme point set, obtain the volume-condition number coupling score based on each volume and condition number, and select the tetrahedron corresponding to the maximum volume-condition number coupling score as the initial convex hull T0;

[0023] The vertices of the initial convex hull T0 are optimized along their corresponding directions with a one-way gradient, and the initial convex hull vertices are updated with the goal of maximizing the distance from the vertex to the point cloud boundary.

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

[0025] Get the face set F and external point set P′ of the initial convex hull;

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

[0027] For each point p, calculate the signed distance Δk from point p to the plane of smoothing group gk, Δ k =n k ·pd k If Δk>0, then point p is marked as a conflict outlier, and a sparse group conflict matrix C is generated. g , where n k Represents the group plane normal vector, d k represents the group plane constant term;

[0028] For the sparse group conflict matrix C g Perform matrix contraction, delete all zero rows and all zero columns, and obtain the compressed group conflict matrix C g ';

[0029] For the compression group conflict matrix C g ′’s intra-group face refinement to obtain a sparse face-point matrix C f ;

[0030] Face-point matrix C f Eliminate all zero rows / columns to obtain the final conflict graph C MCS .

[0031] Optionally, the compression group conflict matrix Cg ′’s intra-group face refinement to obtain a sparse face-point matrix C f ,include:

[0032] Screening compression group conflict matrix C g There is at least one conflicting smoothing group outside the ′;

[0033] For each conflict group g k , traverse the face f∈g to which it belongs k , only for C g Calculate the signed distance Δ from the conflicting external point marked in ′ to the surface f f ;

[0034] If Δ f >ε plane , then it is marked as a face-point conflict, and the sparse face-point matrix C is obtained. f .

[0035] Optionally, the incremental convex hull algorithm uses a bucketed 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, including:

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

[0037] According to the initial convex hull face 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 p through the bucket heap * ;

[0038] Collect visible faces Indicates that p * The set of visible surfaces, p * Indicates that the farthest outer point is selected in this round, where d f is the plane constant term of surface f, n f is the normal vector of face f;

[0039] Search the horizon edge through the incremental cache IHC Cache;

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

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

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

[0043] When the conflict graph C MCS When there is no non-zero element in ||CMCS||0=0, the convex hull construction is determined to be complete; otherwise, continue to iterate and select the farthest point;

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

[0045] Optionally, updating the conflict graph according to the newly added face set, adjacency information, and external point set includes:

[0046] The incremental horizon cache is used to provide a candidate conflict outlier point set for the newly added surface;

[0047] Only calculate the signed distance for the candidate outliers and update the conflict matrix;

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

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

[0050] Optionally, based on the coordinates of all vertices of the target three-dimensional model, the center of the three-dimensional model is determined as the center of the sphere network, and combined with pre-set spherical parameters, a hierarchical sphere network covering the target model is generated, rays are emitted toward the surface of the target model along the spherical normal direction, the vertex positions are corrected layer by layer, the surface of the target model is approached, and a collision body network is output for collision detection; wherein the spherical parameters include: the initial radius r and the latitude and longitude subdivision, including:

[0051] According to the coordinates of all vertices of the target 3D model, the model center is determined and used as the center of the sphere network;

[0052] Presetting multi-level spherical parameters, wherein the spherical parameters include: initial radius r and longitude and latitude subdivision;

[0053] According to the number of hierarchical longitude and latitude subdivisions, the longitude and latitude angles are obtained, and the corresponding vertex coordinates are calculated by combining the sphere center coordinates and the initial radius. Quadrilateral or triangular facets are created according to the i, j index, and UVs are generated to obtain a hierarchical longitude and latitude sphere network. Each vertex caches the ray vector in the direction of its spherical surface normal, and the longitude and latitude sphere network is wrapped around the outside of the model.

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

[0055] 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.

[0056] Another aspect of the present disclosure provides a system for generating a three-dimensional object collision detection wrapping grid, the system comprising:

[0057] The initial center generation module is used to extract all vertex data of the first object according to the sub-Mesh data group serialized from the three-dimensional model and determine the initial center point of the first object.

[0058] 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 data set; among which, the global world coordinate system is a coordinate system with the initial center point as the origin.

[0059] 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 a final convex hull that encapsulates all objects in the three-dimensional model using a conflict graph and an incremental convex hull algorithm. The incremental convex hull algorithm includes bucketed maximum distance selection and incremental horizon caching.

[0060] The collision body network production module is used to determine the center of the three-dimensional model as the center of the sphere network based on the coordinates of all vertices of the target three-dimensional model, and combine the pre-set spherical parameters to generate a hierarchical sphere network covering the target model. It emits rays toward the surface of the target model along the direction of the spherical normal, corrects the vertex positions layer by layer, approximates the final target model surface, and outputs a collision body network for collision detection; wherein, the spherical parameters include: initial radius r and longitude and latitude subdivision.

[0061] Another aspect of the embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-described method when executed by a processor.

[0062] Another aspect of an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

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

[0064] This disclosed embodiment achieves unified topological wrapping of multiple three-dimensional objects by establishing a unified point cloud set and combining an efficient incremental convex hull algorithm with spherical mesh shrinkage technology. This method significantly reduces the number of mesh vertices and faces while ensuring visual fidelity and collision accuracy, significantly reducing computing resource consumption, and is suitable for real-time, efficient interactive applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 The present disclosure provides a flowchart of a method for generating a wrapping grid for collision detection of three-dimensional objects.

[0066] Figure 2 The present disclosure provides a schematic diagram of the entire process of a method for generating a wrapping grid for collision detection of three-dimensional objects.

[0067] Figure 3 On the one hand, an embodiment of the present disclosure provides a structural diagram of a three-dimensional object collision detection and wrapping grid generation system. DETAILED DESCRIPTION

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

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

[0070] like Figure 1 and Figure 2 As shown, an embodiment of the present disclosure provides a method for generating a three-dimensional object collision detection wrapping grid, the method comprising:

[0071] Step S100: extract all vertex data of the first object from the sub-Mesh data group after serialization of the three-dimensional model, and determine the initial center point of the first object.

[0072] It should be noted that the disclosed embodiments provide a method for generating a 3D object wrapping mesh from 3D model Mesh data. The method obtains Mesh data of a 3D model for 3D object collision detection, where the first object corresponds to the first sub-Mesh data. A sub-Mesh can correspond to a 3D object or an independent portion of an object.

[0073] First, the parent node of all Mesh data is used as 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 group sequence. That is to say, in the processing of 3D model data, the serialized sub-Mesh data group (such as the hierarchical Mesh data obtained through FBX / OBJ file parsing or engine API) is loaded under the parent root node, and all the vertex data of the first child object or the first Mesh instance are extracted from its Mesh sequence for subsequent center point calculation and coordinate transformation. The entire model structure containing multiple sub-Meshes is used as the starting point (root node) for processing. The sub-Mesh data group is imported or organized in a serialized form. The key to this step is to determine a common reference point, which is the so-called "center point". Through the center point, subsequent data transformations can be processed more accurately and uniformly. Point cloud collection center point calculation: In the field of point cloud data processing, the selection of a unified reference point is crucial to data processing accuracy.

[0074] formula: Calculate the initial center point C of the first object point cloud set, where N is the number of vertices of the first object, V i is the coordinate of the i-th vertex. Unify the spatial coordinates, determine the spatial reference of the point cloud set and obtain the initial center point for subsequent coordinate transformation and convex hull calculation.

[0075] The hardware environment for 3D model collision detection in the disclosed embodiment is as follows: the operating system uses Windows 11 Pro 23H2×64 / Ubuntu 22.04LTS. The dual system facilitates the comparison of Mono and IL2CPP performance; the CPU uses Intel Core i9 14900KF (24 Cores, 5.6GHz Turbo), with a single-threaded 1MB L1 and 2MB L2 per P core; the test script is mainly affected by the single-thread bottleneck. The GPU uses NVIDIA RTX4090 24GB GDDR6X for GPU-accelerated point cloud ConvexHull / BVH construction. The memory uses 128GB DDR5 6400 to ensure that more than 100 million point clouds can be loaded at one time. The storage uses PCIe 4.0NVMe SSD (read and write 7GB / s) to accelerate the import of large PLY / OBJ / FBX. The engine uses Unity 2022.3.53LTS, which is a stable LTS version with official maintenance until 2026.

[0076] Test data, user-provided mechanical parts group (10 to 50 sub-meshes / group), single unit 100,000 to 2 million tri.

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

[0078] The following table is the Mesh core data

[0079]

[0080]

[0081] The Mesh collection is all the data for this verification. After data serialization, the first one starts with index 0. The data structure is a static data reorganization. This calculation involves the serialization and reorganization of the data structure.

[0082] The core of this calculation is to reconstruct the data format of the vertex coordinate set (Vertices) index / face table (Triangles / Indices).

[0083] This calculation is to create a new Mesh data dedicated to collision, a new vertex coordinate set (Vertices) index / face table (Triangles / Indices).

[0084] 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 the initial center point as the origin.

[0085] Unifying the data of multiple 3D models is a fundamental step to ensure the effectiveness of subsequent analysis. Specifically, the local coordinates of each 3D model need to be transformed into a unified global world coordinate system to achieve data standardization. The conversion uses the matrix transformation formula: P world =M local→world ·P local .P world : A point in the world coordinate system; M local→world : Transformation matrix from local coordinate system to world coordinate system; P local : Points in the local coordinate system. This integrates the vertex data of all objects into a unified point cloud dataset, recording a unique ID for each point. This consolidates the scattered data and ensures coordinate system consistency. This generates a unified world coordinate point cloud dataset, which is not detailed here.

[0086] Step S200 is to confirm the initial center point of step S100 as the center of the world coordinate system, and unify all local matrix coordinates of other sub-mesh data in the sequence into this world coordinate system.

[0087] After step S200, the method further includes performing a data validity check on the mash data. 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 the three hard requirements of sufficient number, non-collinearity, and non-coplanarity. This avoids wasted time or exceptions after entering the main algorithm. This data validity check is used to quickly screen valid point clouds for constructing a convex hull.

[0088] Step S10: Get the vertex point set of all sub-mesh arrays

[0089] Among them, the vertex point set is the vertex set in the unified world coordinate system, p i Represents the i-th vertex, N represents the number of original points, ranging from 4 to 10 6 .

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

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

[0092] Step S30: Use hashing / KD-Tree to remove duplicate points and get the vertex point set again. Recalculate the number of vertices

[0093] In the embodiment of the present disclosure, duplicate points are removed in step S30 to avoid distortion of the collinearity criterion caused by duplication. After removing duplicates, click the number. At this time, it is also necessary to determine the number of vertices after deduplication Is it greater than or equal to the preset threshold? ≥ the preset threshold, proceed to the next step. This ensures that the subsequent steps form a convex hull. Time complexity for deduplication: O(NlogN) (hashing can be approximated to O(N)); random sampling within 250 times, constant level; space complexity: O(N).

[0094] Step S40: Randomly select three points a, b, and c, and calculate ||(ba)×(ca)||. If ||(ba)×(ca)||≥ε L , then there are three non-collinear points, exit successfully and proceed to the next step; if ||(ba)×(ca)||<ε L, then the three points are collinear, this attempt fails, and the next iteration is carried out. After iterating N″ times, if ||(b - a)×(c - a)|| < ε for N″ consecutive times L , then return FAIL_LINE; where ε L represents the collinearity tolerance, with a value of 10 -6 L bb .

[0095] Among them, a, b, and c are vertex coordinates. b - a and c - a respectively represent the subtraction of coordinate vectors, × is the vector cross product, and ‖·‖ is the Euclidean norm.

[0096] If it has been successful once (finding a situation where ≥ ε L ): The point set is not collinear (it may form a surface). If all attempts fail (all N″ times < ε L ): It is very likely that all points in the point set are collinear, and return FAIL_LINE. FAIL_LINE indicates that all points are collinear.

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

[0098] Step S50: Randomly sample any point d outside the three non - collinear points, calculate the scalar triple product 丨(b - a)·((c - a)×(d - a))丨×(1 / 6) to obtain the volume V, and judge the relationship between V and ε P ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​Dynamically set the tolerance value.

[0101] Count the bounding boxes to prevent data scale discrepancies. FAIL_PLANE indicates that all objects are coplanar.

[0102] Step S70, return PASS and cleaned

[0103] After step S60, return to PASS and the cleaned And output for subsequent convex hull main algorithm use. PASS means that the convex hull condition is met.

[0104] The following table shows the experimental parameters and results of data validity detection using steps S20 to S70.

[0105] Dataset Points N Collinearity Coplanarity Test results Synth-Line 1000 100% collinear - FAIL_LINE Synth-Plane 5000 - 100% coplanar FAIL_PLANE Synth-Sparse3D 50 <5% coplanar - PASS LiDAR-Roof 200k √ √ PASS LiDAR-RoadStrip 3k 98% coplanar - FAIL_PLANE

[0106] The results presented in this table demonstrate the robustness of the algorithm on point clouds with varying geometric characteristics. Hardware: Intel i7-170P; Implementation: C++17 + Eigen. The results show that the data validity checker CH-PreCheck can determine whether a million-point cloud is eligible for convex hull construction within a range of sub-milliseconds to tens of milliseconds, and accurately rejects input in extremely degraded scenarios (full-line, comprehensive). Core criteria: 1. Number of vertices ≥ 4; 2. Three points are not collinear; 3. Four points are not coplanar. Adaptive tolerance: Scales with the bounding box size, compatible with both micron- and kilometer-scale models. Efficient: Random sampling and lightweight vector calculations eliminate degraded data in advance, avoiding subsequent QuickHull exception overhead. This pre-check process can be directly embedded in any 3D convex hull or network reconstruction pipeline as a precursor to resource conservation and robustness assurance.

[0107] Step S300: construct an initial convex hull based on the point cloud data set using a matrix hierarchical extreme value retrieval algorithm, and generate a final convex hull that encloses all objects in the three-dimensional model using a conflict graph and an incremental convex hull algorithm.

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

[0109] The quality of the initial convex hull structure directly impacts the subsequent convex hull iterations. This approach uses "matrix hierarchical extremum search" to identify a cluster of highly discrete candidate extrema. Then, through "vertex sharpening," these spatial extrema are fine-tuned to maximize the volume of the first tetrahedron while minimizing the condition number. This strategy scales linearly with the number of input points in O(N) time and significantly reduces the probability of subsequent incremental / divide-and-conquer convex hull degeneration.

[0110] The initial convex hull is constructed based on the point cloud data set using a matrix hierarchical extreme value retrieval algorithm, including:

[0111] Step S310: Obtain a candidate extreme point set based on the point cloud data set through a hierarchical matrix and extreme value search, wherein the hierarchical matrix includes: 26 discrete direction vectors covering three-dimensional space.

[0112] Step S311: Select a set of discrete direction vectors covering three-dimensional space to form a direction basis matrix D.

[0113] 26 direction vectors based on 3×3×3 neighborhood are selected to form the direction basis matrix D. Specifically, the direction basis matrix D is selected from a 3×3 orthogonal set. There are 26 direction vectors in total, which are transformed into a 26×3 matrix, with each row representing a unit direction vector d j (j=1,2,...,26), which are 6 axis directions (±X, ±Y, ±Z), 12 side diagonal directions, and 8 vertex diagonal directions. The 26 directions are predefined, fixed mathematical directions in three-dimensional space. The main function of the directional basis matrix D is to provide a set of predefined reference directions covering all directions of the space for subsequent extreme point retrieval (such as convex hull calculation, feature extraction, etc.). Base direction coverage layer. The extreme points in 26 directions ensure spatial coverage and avoid missing feature points in important directions. "Many and detailed": The number of directions (26) ensures sensitivity to all directions in three-dimensional space.

[0114] Step S312: According to the vertex point set {p i} i=1 N And the direction basis matrix D, through extreme value retrieval, obtain the direction-point index matrix E.

[0115] Extreme value search SIMD Dot-Max, input vertex point set And the direction basis matrix D, for each vertex p i , and calculate its projection value s in 26 directions at the same time i , (26 points), Column vector (3×1) representing point i. i [d]=d d ·p i Represents point p i In direction d d Contribution or extreme value degree on the extreme value. Extreme value screening, for each direction d, maintain a current maximum value max d and the corresponding point index E[d].

[0116] Only when s i [d] is greater than the maximum value of d in the current direction maxd ≥ε·‖bbox‖. That is, s i [d]≥max d+ When ε·‖bbox‖, update max d And E[d] = i, ε represents the tolerance parameter, that is, the extreme value threshold to prevent noise interference, ‖bbox‖ represents the diagonal length of the point cloud bounding box. That is, for each direction d, by comparing the projection values ​​s of all points i [d], select the one that satisfies s i [d]≥max d + + The point index of ε·‖bbox‖ is stored in E[d].

[0117] Output direction-point index matrix Where E[d] stores the index of the extreme point in direction d. The upper layer (threshold filtering layer) uses the extreme threshold ε to further filter and remove redundant points. "Few and discrete": ε is used to control the spatial distribution of candidate points to avoid coplanarity or clustering.

[0118] Step S313: Obtain a set of candidate extreme points according to the direction-point index matrix E and the extreme value threshold ε.

[0119] Candidate pole set Size ≤ 26, regardless of the number of input points. E d Indicates the extreme point index corresponding to the dth direction in the direction-point index matrix E (i.e., the value of E[d]), that is, the extreme point index corresponding to the dth direction in the direction basis matrix D d The index of the point with the largest projection value in the point cloud. d The index is E d The point cloud vertex, that is

[0120] Matrix layering = the base layer has many and fine directions to ensure extreme point coverage; the upper layer extreme value threshold ε controls the discreteness, and the combination of the two layers makes the extreme points both few and far away from the coplanar.

[0121] Step S320: Calculate the tetrahedron volume and the condition number regularized by the condition number for any four points in the candidate extreme point set, obtain the volume-condition number coupling score based on the volume and the condition number regularized by the condition number, and select the four points corresponding to the maximum value of the volume-condition number coupling score as the initial convex hull.

[0122] Tetrahedron optimization and linear independence criterion are used to obtain the initial tetrahedron for constructing the convex hull.

[0123] Take any 4 points {a, b, c, d} from the set C and calculate the volume V of all possible tetrahedrons.

[0124] Volume matrix, triple combination of C Right now

[0125] If the four points are nearly coplanar or elongated, the volume may be non-zero but extremely small, resulting in unstable convex hull calculation. Conditional regularization introduces the condition number κ to measure the degree of geometric degradation, and the covariance matrix ∑, Reflects the distribution characteristics of the three vectors, and v represents the edge vector of the tetrahedron.

[0126] For the degenerate elongated tetrahedron, the condition number κ is defined as: Among them, λ max ,λ min are the maximum and minimum eigenvalues ​​of Σ, respectively. κ≈1 indicates that the vectors are uniformly distributed (ideal tetrahedron); κ>>1 indicates that the vector directions are nearly linearly dependent (degenerate tetrahedron).

[0127] Take the volume-condition number coupling score function S = V / κ, traverse all tetrahedron combinations, and select the four points with the maximum volume-condition number coupling score S as the initial convex hull T0. In other words, maximize S, while pursuing a large volume and a low condition number (geometric stability). In other words, based on the volume-condition number coupling score S = V / k, select the optimal tetrahedron as the initial convex hull T0.

[0128] Step S330 : Perform unidirectional gradient optimization on the vertices of the initial convex hull T0 along their corresponding directions, and update the initial convex hull vertices with the goal of maximizing the distance from the vertex to the point cloud boundary.

[0129] By adjusting the vertex positions of T0 to bring them closer to the actual boundary of the point cloud, we can increase the convex hull volume and face area and reduce face duplication (redundant faces) or face flipping (normal vector errors) in subsequent iterations.

[0130] The process of performing unidirectional gradient optimization on the vertices of the initial convex hull T0 along their corresponding directions and updating the initial convex hull vertices with the goal of maximizing the distance from the vertices to the point cloud boundary, i.e., vertex sharpening, includes:

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

[0132] Step S332: Perform one-way distance gradient in the origin cloud std v″ p≥d v″ ·v″+δ, δ is the microstep, such as 0.002·diagonal length. In direction d v″ On the vertex v", find a point v' that is farther away than the current vertex v".

[0133] Vertex optimization is terminated when the unidirectional gradient search fails to find a farther point three times in a row or the step size δ is less than 0.001·Lbb.

[0134] Step S333: If a farther point v' is found, v' is replaced by v', and the volume-condition number coupling score S is recalculated; convergence is achieved after one iteration, and the initial convex hull is updated.

[0135] It should be noted that based on the recalculated S, the four points corresponding to the maximum value S are reselected to update the initial convex hull T0. The optimized tetrahedron vertices are closer to the point cloud bounding box, and the volume and surface area are increased, reducing the probability of face duplication / flipping in the next iteration.

[0136] The complexity of each step in step S300 and the experimental index

[0137] step Complexity explain Extreme value matrix retrieval O(N×26) SIMD dot product batch parallelism Four-point rating O(N×4) C Vertex Sharpening O(N×4) Only four-direction single line search

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

[0139] Matrix-Layered Extreme Value Retrieval: The direction vector matrix and the threshold ε are combined in layers to complete the extreme point retrieval in one step, avoiding multiple rounds of sorting. Volume-Condition Number Coupling Score: Use S=V / κ to simultaneously measure "non-degeneracy" and "spatial coverage", which is more stable than taking only the maximum volume. One-way Gradient Ascending Vertex Sharpening: Locally climb in the selected direction to ensure that the extreme point is truly "farthest" without the need for global recalculation. Constant-level candidate set and linear scan: The upper limit of candidate points is determined by the direction basis matrix, which is decoupled from the input scale and suitable for hardware pipeline parallelism and real-time scenarios. MLEVS uses the three steps of "extreme value matrix, conditional regularization, and vertex sharpening" to make the initial convex hull tetrahedron both the largest in volume and far away from coplanar degeneration, providing high-quality seeds for subsequent Quickhull, Beneath-Beyond, or Chan incremental algorithms.

[0140] The conflict graph algorithm includes:

[0141] Step S340: construct a conflict graph using matrix shrinkage and smoothing group rule methods.

[0142] Conflict Graph Construction: Matrix-Contraction & Smooth-Group Conflict Graph (MCS-CG). MCS-CG is used for the rapid construction and compression of QuickHull's conflict graph. Through face aggregation and sparse matrix compression, MCS-CG significantly reduces the size and construction time of the conflict graph, providing a clear technical advantage for 3D convex hull algorithms like QuickHull.

[0143] Smooth-Group aggregation: Faces with similar normal vectors are merged into "smoothing groups" before composition, using the group plane for the initial outlier determination. Two-stage matrix contraction: First, a sparse group-point matrix is ​​created for each group. Then, only faces within the group that have confirmed outliers are refined into a face-point matrix. Empty rows and columns are immediately removed, resulting in an extremely sparse final conflict graph. Adaptive error threshold α and dynamic row reordering ensure linear scaling even with sudden increases in face count, significantly reducing memory and computational overhead.

[0144] Step S341: Obtain the face set F and the external point set P′ of the initial convex hull.

[0145] It should be noted that step S341 uses the initial convex hull updated in step S330, the initial face set F, F = {f i}, 4-10 4 ; External point set P′, 10~10 6 ; The external point set P′ is the points to be processed that are not included in the convex hull.

[0146] Step S342: Aggregate adjacent faces into a smoothing group set G = {gk} according to a preset angle threshold α, where the normal vector n of each group gk is k Calculated by taking the weighted average of the member faces’ areas.

[0147] Before the conflict graph is constructed, the smoothing group rule merges adjacent faces with similar normal vectors and almost coplanar faces into a group, and uses a "group plane" instead of multiple faces to make the first external point judgment, significantly reducing the number of faces.

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

[0149] Connected component merging can also be added, and the adjacent faces that can be merged can be clustered into connected groups {gk} using the union-find algorithm.

[0150] Group normal vector and plane equation, for each smoothing group g k , calculate the group plane normal vector n k Specifically, the weighted average normal (with the surface area as the weight) is used to calculate the group normal vector n k : Among them, n f is the unit normal vector of face f, ‖n f ‖=1;g k represents the kth group; A f Represents the area of ​​face f; G is a smoothing group set, outputting a group list. ‖n k ‖=1.

[0151] Set plane equation: n k ·xd k =0, Applicable to uniform patch distribution, where d k Denotes the constant term of the group plane. d f Represents the plane constant term of face f; α is also the aggregation angle threshold of the smoothing group set. When the size of the faces in the group is significantly different, use d k Through area-weighted calculation, the group plane passes through the member faces in the least squares sense.

[0152] The matrix shrinking strategy uses a dynamic bitmap to immediately pop off all-zero rows and columns when detected, preventing empty indices from participating in subsequent operations. In other words, the matrix shrinking strategy dynamically marks invalid rows and columns and skips the marked invalid data in subsequent operations, achieving real-time compression of sparse matrices.

[0153] After group screening, it is usually |P″|<<|P'|,|F'|<<|F|. P″ represents the subset of external points retained after the first-level matrix contraction; F represents the face set of the initial convex hull; F' represents the valid face set participating in conflict detection, that is, the face after smoothing group aggregation.

[0154] Dynamic row reordering: if a face is deleted during incremental expansion, its row is simply marked as empty; during the next contraction, О(1) is removed without requiring full surface reconstruction. In other words, the matrix supports incremental updates; when data is deleted, only logical marking is performed, and it is uniformly cleaned up in the subsequent compression phase to avoid real-time reconstruction.

[0155] Conflict matrix compression method: By dynamically marking invalid data, such as all-zero rows / columns, and skipping the marked data in subsequent calculations, empty rows / columns are skipped in each iteration to achieve real-time matrix compression.

[0156] Step S343: For each point p, p∈P′, calculate the signed distance Δk from point p to the smoothing group gk plane. If Δk>0, then point p is outside the group plane, i.e., a conflict outlier. It is marked as a conflict outlier and recorded in the group conflict matrix to obtain the sparse group conflict matrix C. g ; If Δk≤0, then point p is inside the group plane or coplanar, that is, it is a non-conflict point.

[0157] The signed distance Δ from point p to the plane of smoothing group gk k , Δ k =n k ·pd k If Δk>0, record it in the group conflict matrix C g (k, p) = 1, and the sparse group conflict matrix C is obtained. g .

[0158] Step S344: sparse group conflict matrix C g Perform matrix contraction, delete all zero rows and all zero columns, and obtain the compressed group conflict matrix C g ˊ.

[0159] Perform matrix shrinkage by -1, delete zero rows (no external point group) and zero columns (all internal points), and obtain the compressed group conflict matrix C g ˊ.

[0160] Step S345: compress the conflict matrix C g The surface of the group is refined to obtain the sparse surface-point matrix C f .

[0161] According to the compression group conflict matrix C g ˊ and smoothing group set G={g k}, each g k Contains the list of faces in the group {f∈g k}, where C g ˊ(k,p)=1 means point p and group g k conflict.

[0162] The specific steps are as follows:

[0163] Step S3451: Based on the compression group conflict matrix C g ˊ, filter smoothing groups that have at least one conflicting outside point.

[0164] Filter conflict groups and traverse C g Each row of ˊ, that is, group g k , only processing the p C g A group with ˊ(k, p) ≥ 1, that is, there is at least one conflicting point.

[0165] Step S3452: For each conflict group g k , traverse the face f∈g to which it belongs k , only calculate the signed distance Δ from the group conflict point to the surface f f , Δ f =n f ·pd f .

[0166] Intra-group face conflict detection, for each conflict group g k , traverse all its faces f∈g k , and check the group conflict point p, that is, C g ˊ(k, p) = 1, whether it conflicts with surface f, calculate the signed distance from point p to surface f: Δ f =n f ·pd f , where n f represents the unit normal vector of the surface f, p represents the coordinates of the point to be detected (three-dimensional vector), the coordinates of the point in the world coordinate system, d f Represents the plane constant term of surface f.

[0167] Step S3453: If Δ f >ε plane , then in the surface-point matrix C f The mark in the corresponding conflict relationship is C f (f, p) = 1. Δ f =ε plane , point p is on the plane; Δ f <ε plane , point p is inside the plane, inside the convex hull, and is a non-conflicting point, and the sparse surface-point matrix C is obtained f .

[0168] ε plane is the tolerance threshold, ε plane =1e-8L bb , ε plane Used to filter floating point errors and small noises. Its value is related to the point cloud scale Lbb, ensuring that the algorithm is applicable to models ranging from micron to kilometer scale. ε plane Effectively filter floating point errors, dynamic threshold εplane∝Lbb, compatible with point clouds of different scales.

[0169] Only for C g ′(k,·)=1; judge Δ point by point on the surface to which it belongs f , fill-point matrix C f (f,p)=1.

[0170] Step S346: face-point matrix C f Eliminate all zero rows / columns to obtain the final conflict graph C MCS .

[0171] Face-point matrix C f Eliminate zero rows / columns to achieve matrix shrinkage -2 and output the final conflict graph C MCS and the face ID of each row for direct query in the QuickHull expansion stage.

[0172] Experimental verification

[0173]

[0174] Hardware: AMD Ryzen 7 7840HS; Implementation: C++20+SIMD+OpenMP.

[0175] Threshold α = 8°, ε plane =1e-8L bb The results show that group aggregation and double contraction bring ≈3× construction speedup and more than 75% memory savings, without any impact on the final QuickHull output vertex sequence (verification RMS error < 1e-7m).

[0176] Smooth-Group aggregation: Faces with similar normal vectors are merged into a "smoothing group" before composition, using the group plane for the initial outlier determination. Two-stage matrix contraction: First, a sparse group-point matrix Gg is created by group. Then, only faces within the group with confirmed outliers are refined into a face-point matrix Gf. Empty rows and columns are evenly removed, resulting in an extremely sparse final conflict graph. Adaptive threshold α and dynamic rearrangement: The angle threshold α serves as a conditional judgment, and together with the contraction matrix, faces are culled. Dynamic reorganization ensures linear scaling even with sudden increases in the number of faces, significantly reducing memory and computational overhead.

[0177] Step S350 : The incremental convex hull algorithm uses a bucketed maximum distance selector (BMD Select) and an incremental horizon cache (IHC Cache) to generate a final convex hull according to the initial convex hull and the conflict graph.

[0178] The integrated incremental QuickHull process constructs accurate and complete 3D convex hulls in scenes with millions of 3D point clouds, minimizing memory usage and using near-linear time. By introducing two technologies, Bucketized Maximum Distance Selector (BMD Select) and Incremental Horizon Cache (IHC Cache), the overall incremental QuickHull process achieves higher computation speed and memory savings.

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

[0180] The specific steps are as follows:

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

[0182] Build the initial shell and MCS-CG conflict diagram C based on MLEVS tetrahedron MCS For initial preparation, the data source is the point cloud dataset P and the face set F of the initial convex hull. Conflict graph C MCS The conflicting outer points of the initial convex hull can be obtained from .

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

[0184] Specifically, the following steps are included:

[0185] Step S3521: From each face f containing a conflicting outpoint, traverse its conflicting outpoint set {p}, calculate the signed distance d(f) of each point, and read the maximum distance d max (f), get the local maximum distance of each face and its corresponding point. Calculate f for each face,

[0186] Step S3522: Press the dough Divide into corresponding buckets, maintain the maximum heap in each bucket, press d max (f) Sorting.

[0187] Based on the bucketing distance value Insert face f into the Bucketed Max-Heap, where b is the bucket index, i.e. the bucket number. Insert face f into the maximum heap He[b] corresponding to bucket b (which is a normal max-heap with key = d max ). Heap[b] represents a chained maximum heap indexed by bucket number b. d max (f) represents the maximum signed distance from all conflicting external points of face f to the face. The bucketized maximum distance selector divides the face into buckets according to the distance interval, and maintains a maximum heap in each bucket.

[0188] Step S3523: Take out the face f from the top of the largest non-empty bucket * , and since * Confirm the global farthest point p in the conflict row * .

[0189] That is, take out the noodles f from the bucket pile * , from its conflicting row (i.e. C MCS In the matrix f * Corresponding row) Get all conflict points; find the maximum distance point p among the conflict points recorded in this row *.

[0190] Specifically, take the largest bucket number b * , pop the top of the pile f * , from the surface * In C MCS The conflicting external points associated with the scatterplot are scanned again to obtain: Complexity: insert / update О(1), pop heap О(logn_b)≈constant.

[0191] The farthest point p is obtained from the heap * List of conflicting faces Δ represents the width of the distance barrel, and the empirical value is 0.01·diagonal length, that is, Δ=0.01×diagonal length of the bounding box L bb .d max (f) represents the maximum distance in the conflict row of face f, that is, the maximum signed distance to the face among all conflicting external points of face f.

[0192] The characteristics of BMD Select are "bucket first, then heap". Large face elements are given priority, and extreme values ​​are taken within the face. Only operations are required in the linked heap of fixed buckets. Amortized maintenance is O(1): insertion and update are only fixed bucket linked list operations. The global p can be obtained by popping the heap once. * , avoiding NlogN full scans.

[0193] Step S353: Collect visible faces.

[0194] According to the conflict row data, collect the visible faces Indicates that p * The set of visible surfaces, p * Indicates that the farthest outer point is selected in this round.

[0195] Step S354: Search the horizon edge through the incremental cache IHC Cache.

[0196] Visit all available locations For each shared edge (v i ,v j ), check each edge (v i ,v j ) is adjacent to In addition, if the adjacent surface is not visible, then (v i ,v j ) is counted as the horizon edge; and in the cache table hash (v i ,v j ) is written. Locate the convex hull boundary.

[0197] When a face is deleted, all its adjacent edges are marked as dirty in DirtyFlag. IHC Cache structure EdgeHash, field key = ordered endpoint (vi ,v j ), val = {adjacent face A, adjacent face B}; structure DirtyFlag, field face is deleted when the adjacent edge is set to dirty; only dirty edges are traversed to check the new horizon.

[0198] Only check if the dirty edge is the horizon and update EdgeHash.

[0199] When adding / deleting faces, EdgeHash and DirtyFlag are dynamically updated to maintain index consistency with CMCS. EdgeHash is a hash table with edges as keys, which stores adjacent face information; DirtyFlag is a bitmap marking the edges that need to be updated.

[0200] Features: Write once, read many times; incremental additions and deletions after the initial write only change the dirty bit, without recalculating full adjacencies. Horizon search starts from DirtyFlag edges and ends in O(h) (h = number of horizon edges), replacing BFS on all visible surfaces. The cache is updated synchronously with MCS-CG to maintain index consistency. Only dirty edges (edges with changed adjacencies) are traversed, avoiding a full BFS scan. The dirty edge marking mechanism reduces search complexity from O(|F|) to O(h) (h = number of horizon edges), and the conflict graph index is simultaneously maintained.

[0201] Step S355: When deleting a visible face, update the face set F and conflict graph C synchronously through logical marking. MCS index, and perform physical deletion uniformly in the subsequent compression phase.

[0202] Delete visible faces and simultaneously update the face set F and the conflict graph CMCS. Logical marking synchronizes index updates, delaying physical deletion. This logical marking uses a bitmap data structure, with each face / vertex corresponding to a 1-bit flag. Setting it to 1 indicates deletion; elements with a 1-bit flag are automatically skipped during queries; and all marked items are batch-cleared during the matrix contraction phase.

[0203] Step S356: Insert a new face, align the horizon edge with the p * Form a new triangle f new Merge into F; update face normal and plane constants. Add face normal vector n new By the horizon (v i , v j ) and p * Calculation: n new =normalize((v j -v i )×(p * -v i )). Plane constant term d new , d new =n new ·v i .

[0204] Step S357: Update the conflict graph based on the newly added face set, adjacency information, and external point set.

[0205] IHC is used to provide fast candidates for adjacent external points for each new face; the external points are judged point by point and written into C MCS ; Empty rows / columns trigger matrix shrinkage. C MCS Represents the sparse face-point conflict matrix. F represents the current convex hull face set, and P represents the world coordinate point set.

[0206] The specific steps are as follows:

[0207] Step S3571: Provide a candidate conflicting out-point set for the newly added face through the incremental horizon cache.

[0208] Query the EdgeHash of all edges of the newly added face to obtain the set of external points that have conflicted with these edges

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

[0210] For each candidate point p∈P candidate , calculate the signed distance in, Add the face normal vector.

[0211] Update conflict matrix

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

[0213] Trigger condition, blank line: all C of a certain face f MCS (f,·)=0 (no conflict point); empty column: all C at a point p MCS (·,p)=0 (no conflicting faces). Use dynamic bitmaps to mark empty rows / columns, and delay physical deletion until the next operation.

[0214] Step S3574: Synchronize the index, update the IHCCache, write the edge information of the newly added face into 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.

[0215] Step S358: When the conflict graph C MCS When there is no non-zero element ‖CMCS‖0=0, the convex hull construction is determined to be complete; otherwise, the iterative selection of the farthest point is continued.

[0216] If C in step S357MCS All zeros, that is, ‖C MCS If ‖0=0, the determination is terminated and the process jumps to step S359; otherwise, the process returns to step S352 and continues to select the farthest point.

[0217] Judgment condition: sparse norm of conflict graph CMCS ‖C MCS ‖0=0, that is, there are no non-zero elements in the matrix.

[0218] Step S359: When the conflict graph C MCS When it is empty, output the vertex and patch data of the convex hull to obtain the final convex hull; otherwise, continue to iterate.

[0219] Specifically, it can output the vertex coordinates of the convex hull, the indices of the triangles, and the volume mesh topology. Output: Vertex set: the 3D coordinates of all vertices of the convex hull; patch set: the vertex indices of the triangles; optional output volume mesh: tetrahedrons or other volume elements.

[0220] Experimental comparison

[0221]

[0222] An average 3× speed increase; peak memory savings of ≈70% for the collision matrix and edge cache; convex hull vertex error <1e-7m, identical to the baseline. BMD-Select: Bucketized maximum distance heap for constant-time farthest point selection; IHC-Cache: Incremental horizon caching and dirty edge mechanism, reducing horizon search from O(|F|) to O(h).

[0223] Step S400: 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 surface parameters, a radius coverage model is initialized to generate a hierarchical sphere network covering the target model. Rays are emitted toward the target model surface along the spherical surface normal, and vertex positions are corrected layer by layer to approximate the target model surface. A collision volume network is output for collision detection. The spherical surface parameters include the initial radius r and the latitude and longitude resolution.

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

[0225] Existing convex hull algorithms (such as QuickHull) suffer from irregular vertex distribution, making LOD quantization difficult and limiting real-time efficiency. While regular spherical subdivision meshes facilitate LOD management, they lack a good fit with complex models and exhibit a loose envelope.

[0226] Through quantitative control of a small number of parameters, it can automatically generate multi-level spherical meshes and progressively fit the model algorithm, taking into account both envelope accuracy and generation speed, making it convenient to quickly establish efficient collision bodies in game engines, simulations, CAD and other scenarios; and it is easy to integrate into existing LOD / MeshColider pipelines to achieve integrated optimization of rendering and physics.

[0227] The specific steps are as follows:

[0228] Step S410: Determine the model center based on all vertex coordinates of the 3D model mesh data and use it as the center of the sphere network.

[0229] Determine the unified reference center point, collect vertex information, and read all N' vertex coordinates V of the target 3D model M i '(x i ,y i , z i ).

[0230] Calculate the geometric center according to the formula N′ represents the total number of vertices of the original target 3D model.

[0231] The model center C' is obtained as the center of the spherical mesh. C' is the unified center point.

[0232] Coordinate normalization: Perform translation T(-C) to move the entire model to the origin, eliminating subsequent floating-point error accumulation.

[0233] Step S420: Setting multi-level spherical parameters, wherein the spherical parameters include: an initial radius r and a degree of longitude and latitude refinement.

[0234] Multi-level spherical parameter setting, initial radius r = α·AABB bounding box diagonal length L bb ; Determine the initial radius r: take the longest diagonal d′ of the model axis-aligned bounding box max ,make Ensure that the spherical envelope completely covers the model. α is the initial radius coefficient, α∈[1.1, 1.5].

[0235] Subdivision setting: set the basic latitude and longitude

[0236] Level increment rule: Level l latitude subdivision Level 1 longitude subdivision l∈[0,L], where L is controlled by the accuracy threshold τ. The initialization radius covers the 3D model.

[0237] Step S430: Calculate the latitude and longitude angles based on the number of hierarchical longitude and latitude divisions. Calculate the corresponding vertex coordinates based on the sphere center coordinates and the initial radius. Create quadrilateral or triangular facets based on the i and j indices, and generate UVs to obtain a hierarchical latitude and longitude sphere network. Each vertex caches the ray vector in the direction of its spherical surface normal. The latitude and longitude sphere network is wrapped around the model.

[0238] Specifically, the process of generating the latitude and longitude sphere grid includes:

[0239] Step S431: Calculate and obtain discrete longitude and latitude angles according to the number of hierarchical longitude and latitude divisions.

[0240] The formula for calculating the latitude angle is: θ i Represents the latitude angle of node i; the longitude angle calculation formula is Represents the longitude angle of node j.

[0241] Step S432: Calculate vertex coordinates based on the sphere center, initial radius, and longitude and latitude.

[0242] The formula for calculating the coordinates of the spherical vertices is: in, is the vertex of the i-th and j-th nodes in the l-th layer.

[0243] Step S433: Create a quadrilateral or triangular face according to the i and j indexes; and synchronously generate UVs to obtain a longitude and latitude sphere network.

[0244] Topological connection, create quadrilateral or triangular facets according to i, j index; generate UV synchronously,

[0245] v=1-θ i / π.

[0246] Step S434: Cache the ray vector in the direction of the vertex sphere normal.

[0247] Cache vertex ray vectors and record the unit vector of the ray The unit vector representing the ray. The ray direction is consistent with the sphere normal vector and is used in subsequent steps. The ray is emitted along the outer normal direction of the sphere to detect collisions with the outer surface of the model.

[0248] Step S440: Perform ray detection along the spherical surface normal direction, and adjust the grid vertex positions layer by layer to approximate the target model surface.

[0249] Ray detection and vertex position correction. Emit rays from any vertex in layer l Along a ray Direction, maximum detection distance The sphere is maximally wrapped around the periphery of the Mesh point cloud, and each vertex emits to return the collision point.

[0250] Hit judgment. If the ray hits the model surface, the collision point p is obtained. ij And its distance to C, |p ij -C|.

[0251] Adjustable scaling update; Let the user's magnification factor k ∈ [0, 1], calculate k is specifically the vertex magnification factor for adjusting the tightness of the envelope.

[0252] Miss handling: If there is no collision, let ||v′ ij -C|| = 0.01 (the unit is the same as the model), and shrink to the safe distance.

[0253] Vertex cache replacement: Overwrite the original vertices of the spherical surface with v′ ij to complete the refinement of the current layer.

[0254] Step S450: When the maximum residual between the mesh vertex and the model surface is less than the preset threshold τ, the refinement is terminated.

[0255] Based on the comparison between the maximum residual and the preset threshold τ, determine whether to terminate the refinement correction. Error evaluation and hierarchical progression, calculate the maximum residual ε (l) is the maximum residual of layer l.

[0256] Threshold comparison. If ε (l) ≤ τ, typically τ = 0.5% of the diagonal length, then terminate the refinement; otherwise, execute steps S420 to S440 and enter layer l + 1. τ is the error stop threshold, and τ is determined according to the actual situation or empirical experiments.

[0257] Result caching, retaining the network data of each layer for LOD scheduling.

[0258] Step S460: Output and application of the wrapped network.

[0259] The convex hull is used as an intermediate result to optimize the calculation efficiency. The convex hull quickly eliminates the invisible area. The spherical network approximates the original model according to the LOD grading, achieving a balance between real-time performance and accuracy. The final collision body network is a hierarchical spherical mesh, supporting non-convex collision detection; if a convex collision body is required, an optimized convex hull can be regenerated based on the vertices of the spherical mesh, and the original convex hull is deleted. The number of faces of the original convex hull is dozens of times that of the convex hull regenerated after being wrapped by a uniform sphere. After the calculation is completed, the original convex hull is deleted.

[0260] Data collation, generating the file WrapSphere_L{1}.mesh / .bytes, containing vertices, indices, and UVs.

[0261] Collider baking: Call Physics.BakeMesh() or equivalent API to convert the network into a MeshCollider internal acceleration structure.

[0262] LOD binding: In a game engine or simulation system, mount the L0-L network to an LODGroup, or dynamically switch based on distance / error.

[0263] Performance calibration: record generation time Compression rate And compared with baseline algorithms such as QuickHull.

[0264] Result quantitative indicators: vertex compression rate That is, the vertex ratio, typical values ​​L0: 0.16%, L2: 0.64%; patch compression rate That is, the ratio of the number of patches, the typical value is L2≈1.2%; the maximum envelope error That is, the minimum distance from any model point to the envelope network, typical values ​​L0: 1.8% side length, L2: 0.4%; generation time That is, single-threaded CPU / GPU parallelism, typical values ​​L2 (26,000 vertices): CPU 42ms; GPU 7ms. Compared with classic QuickHull: at the same δ max The number of vertices is reduced by about 65%, and the latitude and longitude distribution is regular, which is convenient for GPU Batch; Unity LODGroup can be directly mapped at the level of 1, and the switching overhead is extremely small.

[0265] The beneficial effects of the embodiments of the present disclosure are as follows: 1. Parameterization and quantification: only The accuracy-efficiency curve can be reproduced and controlled. 2. Cross-LOD error closed loop: residual ε (l) As the stopping criterion, multi-level refinement is automatically completed without manual intervention. 3. Self-limited ray length: Effectively shield useless penetration, upper bound of calculation amount GPU parallelization is possible. 4. Regular topology: The warp and weft networks are naturally aligned with UVs, compatible with terrain baking and global illumination. Industrial applicability: Verified in Unity 2022.3LTS + Burst 1.9, a multi-level MeshCollider can be generated with one-click physics.BakeMese().

[0266] The advantage of the minimum distance is that it prevents numerical instability: if the vertex completely collapses to the center of the sphere (distance = 0), it will result in: triangle area being zero (rendering error) and normal calculation failure (lighting anomaly).

[0267] Maintain topological validity: The minimum distance ensures that the mesh always maintains a manifold structure and avoids non-manifold edges.

[0268] This disclosed embodiment achieves unified topological wrapping of multiple three-dimensional objects by establishing a unified point cloud set and combining an efficient incremental convex hull algorithm with spherical mesh shrinkage technology. This method significantly reduces the number of mesh vertices and faces while ensuring visual fidelity and collision accuracy, significantly reducing computing resource consumption, and is suitable for real-time, efficient interactive applications.

[0269] like Figure 3 As shown, another aspect of the present disclosure provides a three-dimensional object collision detection wrapping grid generation system, the system comprising:

[0270] The initial center generation module 100 is used to extract all vertex data of the first object according to the sub-Mesh data group after serialization of the three-dimensional model, and determine the initial center point of the first object.

[0271] The coordinate system transformation module 200 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 data set; wherein the global world coordinate system is a coordinate system with the initial center point as the origin.

[0272] The convex hull generation module 300 is used to construct an initial convex hull based on the point cloud data set using a matrix hierarchical extreme value retrieval algorithm, and to generate a final convex hull that encapsulates all objects in the three-dimensional model using a conflict graph and an incremental convex hull algorithm, wherein the incremental convex hull algorithm includes bucketing maximum distance selection and incremental horizon buffering.

[0273] The collision body network production module 400 is used to determine the center of the three-dimensional model as the center of the sphere network based on the coordinates of all vertices of the target three-dimensional model, and combine the pre-set spherical parameters to generate a hierarchical sphere network covering the target model, emit rays toward the surface of the target model along the direction of the spherical normal, correct the vertex positions layer by layer, approach the surface of the target model, and output the collision body network for collision detection; wherein, the spherical parameters include: the initial radius r and the latitude and longitude subdivision.

[0274] Another aspect of the embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-described method when executed by a processor.

[0275] Another aspect of an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

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

[0277] 1. A multi-object collision parcel calculation method based on spherical mesh shrinkage and incremental convex hull algorithm, characterized by efficient and unified processing of multiple three-dimensional objects, significantly optimizing computing performance and visual effects.

[0278] 2. Through unified point cloud data construction and conflict graph optimization, efficient incremental convex hull generation is achieved.

[0279] 3. Optimize the collision mesh structure and accuracy through fine spherical mesh parameterization and ray detection.

[0280] The above is only a preferred implementation of the embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present disclosure. These improvements and modifications should also be considered within the scope of protection of the embodiment of the present disclosure.

Claims

1. A method for generating a wrapping grid for collision detection of three-dimensional objects, characterized in that: The method comprises: Extract all vertex data of the first object from the sub-Mesh data group serialized from the 3D model and determine the initial center point of the first object; Convert each vertex of each sub-mesh data in the sub-mesh data set 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; the global world coordinate system is a coordinate system with the initial center point as the origin; An initial convex hull is constructed based on the point cloud dataset using a matrix hierarchical extreme value retrieval algorithm. A conflict graph and an incremental convex hull algorithm are then used to generate a final convex hull that encapsulates all objects in the 3D model. The incremental convex hull algorithm includes bucketed maximum distance selection and incremental horizon caching. According to the coordinates of all vertices of the target three-dimensional model, the center of the three-dimensional model is determined as the center of the sphere network. Combined with the pre-set spherical parameters, a hierarchical sphere network covering the target model is generated. Rays are emitted toward the surface of the target model along the spherical normal direction, and the vertex positions are corrected layer by layer to approximate the surface of the target model. The collision body network is output for collision detection. The spherical parameters include: the initial radius r and the 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 point set of all sub-mesh arrays; Determine whether the number of vertices is greater than or equal to the 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, c and calculate the modulus of the vector cross product ||(ba)×(ca)||. If ||(ba)×(ca)||≥ε L , then there are three non-collinear points, proceed to the next step; if ||(ba)×(ca)||<ε L , then iterative resampling is performed. If N consecutive random samplings satisfy ||(ba)×(ca)||<ε L , then the point set is determined to be collinear and FAIL_LINE is returned; where a, b, c are vertex coordinates, ba and ca represent the subtraction of coordinate vectors, ε L represents collinearity tolerance; Randomly sample any point d outside the non - collinear three points, calculate the scalar triple product \(|(b - a)\cdot((c - a)\times(d - a))|\times(1 / 6)\) to obtain the volume V. If \(V\geq\varepsilon\) P , then the four points d, a, b, c are not coplanar, and proceed to the next step; where \(\varepsilon\) P represents the coplanarity tolerance; Calculate the diagonal length L of the bounding box in the Mesh data bb , according to the formula ε L =L bb ×10 -6 and ε P =L bb 3 ×10 -12 Dynamically set tolerance value; Returns a set of points that pass the validation for use in convex hull generation.

3. The method according to claim 1 or 2, characterized in that The initial convex hull is constructed based on the point cloud data set using a matrix hierarchical extreme value retrieval algorithm, including: According to the point cloud dataset, a set of candidate extreme points is obtained through hierarchical matrix and extreme value retrieval, where the hierarchical matrix includes: 26 discrete direction vectors covering three-dimensional space; Calculate the volume of the tetrahedron and the condition number regularized by the condition number for any four points in the candidate extreme point set, obtain the volume-condition number coupling score based on the volume and condition number, and select the tetrahedron corresponding to the maximum volume-condition number coupling score as the initial convex hull T0; The vertices of the initial convex hull T0 are optimized along their corresponding directions with a one-way gradient, and the initial convex hull vertices are updated with the goal of maximizing the distance from the vertex to the point cloud boundary.

4. The method according to any one of claims 1 to 3, characterized in that The conflict graph is constructed using matrix shrinkage and smoothing group rule methods, including the following steps: Get the face set F and external point set P′ of the initial convex hull; According to the preset angle threshold α, adjacent faces are aggregated into a smoothing group set G = {g k }; For each point p, calculate the signed distance Δk from point p to the plane of smoothing group gk, Δ k =n k ·pd k If Δk>0, then point p is marked as a conflict outlier, and a sparse group conflict matrix C is generated. g , where n k Represents the group plane normal vector, d k represents the group plane constant term; For the sparse group conflict matrix C g Perform matrix contraction, delete all zero rows and all zero columns, and obtain the compressed group conflict matrix C g '; For the compression group conflict matrix C g ′’s intra-group face refinement to obtain a sparse face-point matrix C f ; Face-point matrix C f Eliminate all zero rows / columns to obtain the final conflict graph C MCS .

5. The method according to claim 4, characterized in that The compression group conflict matrix C g ′’s intra-group face refinement to obtain a sparse face-point matrix C f ,include: Screening compression group conflict matrix C g There is at least one conflicting smoothing group outside the ′; For each conflict group g k , traverse the face f∈g to which it belongs k , only for C g Calculate the signed distance Δ from the conflicting external point marked in ′ to the surface f f ; If Δ f >ε plane , then it is marked as a face-point conflict, and the sparse face-point matrix C is obtained. f .

6. The method according to any one of claims 1 to 5, characterized in that 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, including: Get the initial convex hull and conflict graph C MCS ; According to the initial convex hull face 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 p through the bucket heap * ; Collect visible faces Indicates that p * The set of visible surfaces, p * Indicates that the farthest outer point is selected in this round, where d f is the plane constant term of surface f, n f is the normal vector of face f; Search the horizon edge through the incremental cache IHC Cache; Delete the visible faces and update the face set F and conflict graph CMCS synchronously; Insert a new face, aligning the horizon edge with p * Form a new triangle f new Merge into F; update face normal and plane constant; Update the conflict graph based on the newly added face set, adjacency information, and outlier set; When the conflict graph C MCS When there is no non-zero element in ||CMCS||0=0, the convex hull construction is determined to be complete; otherwise, continue to iterate and select the farthest point; When the conflict graph C MCS When it is empty, the vertex and patch data of the convex hull are output to obtain the final convex hull.

7. The method according to claim 6, characterized in that The updating of the conflict graph according to the newly added face set, adjacency information and external point set includes: The incremental horizon cache is used to provide a candidate conflict outlier point set for the newly added surface; Only calculate the signed distance for the candidate outliers and update the conflict matrix; Dynamically trigger matrix shrinkage to remove empty rows / columns to maintain sparsity; Synchronize the index, update the IHCCache, write the edge information of the newly added face into EdgeHash, and synchronize its conflict points to DirtyFlag for subsequent retrieval.

8. The method according to any one of claims 1 to 7, characterized in that According to the coordinates of all vertices of the target three-dimensional model, the center of the three-dimensional model is determined as the center of the sphere network. In combination with the pre-set spherical parameters, a hierarchical sphere network covering the target model is generated. Rays are emitted toward the surface of the target model along the spherical normal direction, and the vertex positions are corrected layer by layer to approximate the surface of the target model. The collision body network is output for collision detection. The spherical parameters include: the initial radius r and the longitude and latitude subdivision, including: According to all vertices of the target 3D model, the model center is determined and used as the center of the sphere network; Presetting multi-level spherical parameters, wherein the spherical parameters include: initial radius r and longitude and latitude subdivision; According to the number of hierarchical longitude and latitude subdivisions, the longitude and latitude angles are obtained, and the corresponding vertex coordinates are calculated by combining the sphere center coordinates and the initial radius. Quadrilateral or triangular facets are created according to the i, j index, and UVs are generated to obtain a hierarchical longitude and latitude sphere network. Each vertex caches the ray vector in the direction of its spherical surface normal, and the longitude and latitude sphere network is wrapped around the outside of the model. Performing ray detection along the spherical surface normal direction, and adjusting the grid vertex positions layer by layer to approximate the target model surface; 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 wrapping grid generation system, characterized in that: The system comprises: The initial center generation module is used to extract all vertex data of the first object based on the sub-Mesh data group after serialization of the three-dimensional model and determine the initial center point of the first object; The coordinate system transformation module is used to 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; the global world coordinate system is a coordinate system with the initial center point as the origin; A 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 a final convex hull that encloses all objects in the 3D model using a conflict graph and an incremental convex hull algorithm, wherein the incremental convex hull algorithm includes bucketed maximum distance selection and incremental horizon caching; The collision body network production module is used to determine the center of the three-dimensional model as the center of the sphere network based on the coordinates of all vertices of the target three-dimensional model, and combine the pre-set spherical parameters to generate a hierarchical sphere network covering the target model. It emits rays toward the surface of the target model along the direction of the spherical normal, corrects the vertex positions layer by layer, approximates the surface of the target model, and outputs a collision body network for collision detection; wherein, the spherical parameters include: initial radius r and longitude and latitude subdivision.

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

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

  • FAST novel feed source cabin mechanism structure parameter optimization method

    CN116011137A

  • Mechanical arm path planning method based on BP neural network

    CN116985121A

  • Rigid body collision detection method and system based on adaptive resolution

    CN119026379A

Cited By

  • RoboBuilder model intersection detection method and device, terminal equipment and storage medium

    CN121074043A

  • A RoboBuilder model intersection detection method, apparatus, terminal device, and storage medium

    CN121074043B

  • Method and device for determining grabbing point position of mechanical arm, electronic equipment and storage medium

    CN121403359A

  • Node updating method and device in three-dimensional game, electronic equipment and storage medium

    CN121534389A

  • Interactive three-dimensional convex hull Decal generation and ray interaction detection method based on unreal engine

    CN122023661A