Method and apparatus for detecting consistency of visual geometry and physical collision body overlays
Patent Information
- Application Number
- CN202611068324.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-30
AI Technical Summary
该方法依赖于预定义目标位置,可能遗漏未覆盖的中间姿态,无法动态评估在真实物理交互中是否存在碰撞穿透或覆盖不足问题
[0018]本发明的有益效果:本发明通过对三维资产中的视觉网格节点和碰撞体节点进行自动配对,并将不同类型的几何体转换为统一世界坐标系下的三角网格对象,使后续覆盖检测能够在统一几何基准下执行;通过顶点、表面和边缘分层采样,提高对视觉几何结构特征、面片区域及轮廓折痕区域的检测完整性;通过空间分层限流,在保持采样点空间分布均匀性的同时控制计算量;通过水密网格包含判断、非水密网格有向距离判定以及表面距离容差补偿,降低网格孔洞和边界误差造成的误判;通过分别检测多个碰撞体并综合覆盖状态,准确量化物理碰撞体对视觉几何的覆盖程度,同时利用未覆盖采样点的空间位置实现问题区域定位。
Smart Images

Figure CN123015887A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated quality inspection technology for three-dimensional assets, and in particular to a method and apparatus for detecting the consistency of visual geometry and physical collision body coverage. Background Technology
[0002] In robot simulation and automated quality inspection scenarios, 3D assets typically consist of two parts: visual geometry for rendering and physical colliders for physical collision calculations. Physical colliders are generally a simplified representation of the visual geometry and are used in the simulation engine to perform collision detection, grasping decisions, and motion planning. The consistency of coverage between the visual geometry and the physical colliders directly affects simulation quality: if certain areas of the visual geometry are not covered by the physical colliders, it can lead to problems such as clipping, grasping failures, and abnormal motion planning in the simulation.
[0003] Commonly used detection methods in existing technologies include: Bounding box comparison method: This method calculates axis-aligned bounding boxes (AABBs) for both the visual mesh and the collision mesh, and compares the volume ratio or size difference between the two bounding boxes. This method is severely inaccurate. Bounding boxes only describe the extreme range of the geometry and do not reflect shape details. For slender or irregularly shaped models, bounding box sizes may be similar, but actual coverage may be insufficient, leading to an incorrect report of "sufficient coverage." Furthermore, even if insufficient coverage is detected, it cannot pinpoint which specific region lacks colliders.
[0004] Manual visual inspection: The visual mesh and collision mesh are displayed simultaneously in the 3D software, and the designer compares them visually. This method is highly subjective, inefficient, lacks standardized judgment criteria, cannot provide quantitative indicators, and is time-consuming to inspect each component of complex models and is prone to missing small areas.
[0005] Target location or path-driven detection method: Move the asset joints to a preset position or path and observe whether the collider obstructs the visual mesh movement. This method relies on predefined target positions and may miss uncovered intermediate poses, failing to dynamically assess whether collision penetration or insufficient coverage issues exist in real physical interactions.
[0006] In addition, existing technologies, when dealing with complex collision scenarios, usually merge multiple collision meshes directly and then determine the coverage relationship, which is prone to misjudgment due to interference from internal surfaces; there is a lack of effective mechanisms for judging internal and external points for non-closed collision meshes; and there is a lack of means to control the amount of computation in large-scale sampling scenarios. Summary of the Invention
[0007] The purpose of this invention is to avoid the shortcomings of the prior art and provide a technology that can more rigorously evaluate whether there is collision penetration or insufficient coverage in real physical interactions.
[0008] The objective of this invention is achieved through the following technical solution: Therefore, according to one aspect of the present invention, a method for detecting the consistency of visual geometry and physical collider coverage is provided, comprising the following steps: parsing the scene file of the 3D asset to be detected, extracting the set of visual mesh nodes and the set of collider nodes to be detected, and pairing the set of visual mesh nodes and the set of collider nodes to generate a visual collision pairing set; wherein, each visual mesh node in the visual collision pairing set is associated with one or more collider nodes; performing geometric type discrimination and triangular mesh transformation on the visual mesh nodes and their associated collider nodes in the visual collision pairing set to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system; performing layered sampling on the visual triangular mesh objects to generate a set of sampling points, and determining whether the sampling points in the set of sampling points are located within the corresponding collision triangular mesh object; if so, marking the sampling points as covered sampling points; if not, further determining whether the surface distance between the sampling points and the collision triangular mesh object is less than a preset tolerance value; if so, marking the sampling points as covered sampling points; generating a corresponding coverage result; wherein, the coverage result includes at least one of a set of covered sampling points, a set of uncovered sampling points, and a coverage rate.
[0009] Specifically, the geometric type is determined and triangular mesh transformation is performed on the visual mesh nodes and their associated collider nodes in the visual collision pairing set to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system. The specific steps include: reading the geometric type and geometric parameters corresponding to the visual mesh nodes and / or collider nodes, and determining the geometric type; if the geometric type is a mesh type, the corresponding vertex coordinates, face vertex indices and the number of vertices per face are read from the geometric parameters, and non-triangular faces are triangulated to generate the corresponding local triangular mesh objects; if the geometric type is a basic geometry type, the corresponding local triangular mesh objects are generated based on the corresponding geometric parameters; coordinate transformation is performed on the local triangular mesh objects to generate visual triangular mesh objects and / or collision triangular mesh objects.
[0010] Another specific method involves performing layered sampling on the visual triangular mesh object to generate a set of sampling points. This includes the following steps: vertex sampling, extracting the vertex coordinates of the visual triangular mesh object to generate a vertex sampling point set; surface sampling, generating a surface sampling point set based on the triangular faces of the visual triangular mesh object; and edge sampling, generating an edge sampling point set based on the edges of the visual triangular mesh object. The vertex sampling point set, surface sampling point set, and edge sampling point set are then merged and deduplicated to generate a final sampling point set. The surface sampling point set includes the centroid sampling points of each triangular facet and supplementary surface sampling points allocated according to the facet area; the edge sampling point set includes the midpoint sampling points of each edge and interpolated sampling points allocated according to the edge length.
[0011] More specifically, the visual triangular mesh object is sampled hierarchically to generate a set of sampling points. This includes the following steps: determining whether the number of sampling points in the set exceeds a preset sampling threshold; if so, spatial hierarchical flow limiting is applied to the set of sampling points. The spatial hierarchical flow limiting process includes the following steps: determining the voxel side length based on the spatial range of the sampling point set and the number of target points; dividing the sampling point set into voxel buckets based on the spatial coordinates of each sampling point in the set, forming several voxel buckets; each voxel bucket includes sampling points located within the corresponding voxel's spatial range; and preferentially selecting at least one sampling point from each voxel bucket to generate a flow-limited set of sampling points.
[0012] More specifically, at least one sampling point is preferentially selected from each voxel bucket to generate a rate-limited sampling point set, including the following steps: selecting sampling points from each voxel bucket; determining whether the number of selected sampling points has reached the target number of points; if not, polling and supplementing the unselected sampling points in each voxel bucket until the number of sampling points reaches the target number of points; and generating a rate-limited sampling point set using the selected sampling points.
[0013] The above steps, which determine whether a sampling point in the sampling point set is located within the corresponding collision triangle mesh object, include the following steps: determining whether the collision triangle mesh is a watertight mesh; if it is, determining whether the sampling point is located within the collision triangle mesh object based on the number of ray intersections; if so, marking the sampling point as an covered sampling point; if the collision triangle mesh is not a watertight mesh, calculating the directed distance of the sampling point relative to the surface of the collision triangle mesh object, and determining whether the directed distance between the sampling point and the collision triangle mesh object is less than a preset tolerance value; if so, marking the sampling point as an covered sampling point.
[0014] More specifically, before determining whether the sampling point is located within the corresponding collision triangle mesh object, the following steps are also included: determining the bounding box of the collision triangle mesh object based on the minimum and maximum coordinates of the collision triangle mesh object along each coordinate axis in a unified world coordinate system; determining the effective tolerance based on the preset tolerance and the spatial scale of the bounding box; expanding the bounding box based on the effective tolerance, and determining whether the sampling point is located within the expanded bounding box.
[0015] According to another aspect of the present invention, a visual geometry and physical collider coverage consistency detection device is provided, comprising: an asset parsing module, used to parse the scene file of the 3D asset to be detected, extract the visual mesh node set and collider node set to be detected, and pair the visual mesh node set and collider node set to generate a visual collision pairing set; a detection pairing module, used to perform geometric type discrimination and triangular mesh transformation on the visual mesh nodes and their associated collider nodes in the visual collision pairing set, respectively, to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system; a layered sampling module, used to perform layered sampling on the visual triangular mesh objects to generate a sampling point set; a coverage detection module, used to determine whether the sampling points in the sampling point set are located within the corresponding collision triangular mesh objects, if so, mark the sampling points as covered sampling points, if not, further determine whether the directed distance between the sampling points and the collision triangular mesh objects is less than a preset tolerance value, if so, mark the sampling points as covered sampling points; and an output module, used to generate corresponding coverage results.
[0016] According to another aspect of the present invention, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the instructions to implement the steps of the above-described visual geometry and physical collision body coverage consistency detection method.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided that stores computer instructions which, when executed by a processor, implement the steps of the above-described method for detecting the consistency of visual geometry and physical collider coverage.
[0018] The beneficial effects of this invention are as follows: This invention automatically pairs visual mesh nodes and collider nodes in 3D assets and converts different types of geometry into triangular mesh objects in a unified world coordinate system, enabling subsequent coverage detection to be performed under a unified geometric reference; it improves the detection completeness of visual geometric structural features, patch regions, and contour crease regions through vertex, surface, and edge layer sampling; it controls the computational load while maintaining the uniformity of sampling point spatial distribution through spatial layer flow limiting; it reduces misjudgments caused by mesh holes and boundary errors through watertight mesh inclusion judgment, non-watertight mesh directed distance judgment, and surface distance tolerance compensation; and it accurately quantifies the coverage degree of physical colliders on visual geometry by detecting multiple colliders separately and integrating the coverage status, while using the spatial location of uncovered sampling points to locate problem areas. Attached Figure Description
[0019] The invention can be better understood by describing exemplary embodiments disclosed herein in conjunction with the accompanying drawings, in which: Figure 1 The diagram shown is a schematic flowchart of a visual geometry and physical collision body coverage consistency detection method according to Embodiment 1 of the present invention; Figure 2 The diagram shown is a schematic diagram of the program modules of a visual geometry and physical collision body coverage consistency detection device according to Embodiment 1 of the present invention; Figure 3 The diagram shown is a hardware structure schematic of a computing device according to Embodiment 1 of the present invention. Detailed Implementation
[0020] The following describes specific embodiments of the present invention. It should be noted that, in order to provide a concise description, this specification cannot exhaustively describe all features of the actual embodiments. It should be understood that, in the actual implementation of any embodiment, just as in any engineering or design project, various specific decisions are often made to achieve the developer's specific goals and to meet system-related or business-related constraints, and this can change from one embodiment to another. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this invention, some design, manufacturing, or production modifications based on the technical content disclosed in this invention are merely conventional technical means and should not be construed as insufficient content of this invention.
[0021] Unless otherwise defined, the technical or scientific terms used in the claims and description shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in the patent application description and claims of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. The terms "an" or "a" and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms "comprising" or "including" and similar terms mean that the element or object preceding "comprising" or "including" encompasses the element or object listed following "comprising" or "including" and its equivalents, and do not exclude other elements or objects. The terms "connected" or "linked" and similar terms are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.
[0022] Example 1 Please see Figure 1 This embodiment proposes a method for detecting the consistency of visual geometry and physical collision object coverage, including the following steps S1 to S7: S1: Parse the scene file and generate a set of visual collision pairs.
[0023] The scene file of the 3D asset to be detected is parsed, and the set of visual mesh nodes and the set of collider nodes to be detected are extracted. The visual mesh node set and the collider node set are then paired to generate a visual collision pairing set; each visual mesh node in the visual collision pairing set is associated with one or more collider nodes. Specifically, steps S11 to S12 are included: S11: Traverse each scene node in the scene tree corresponding to the scene file and identify the node type of each scene node.
[0024] The scene file is a Universal Scene Description (USD) format file, and parsing this file yields a scene tree.
[0025] Traverse each scene node in the scene tree and read the node type, purpose attribute, visibility attribute, and collision attribute configuration of each scene node.
[0026] In this embodiment, step S11 further includes the following steps S111 to S112: S111: Determine the node type of the scene node.
[0027] When a scene node has a node type of mesh (UsdGeom.Mesh), its purpose attribute is not a guide type, and its visibility attribute is not invisible, the scene node is identified as a visual mesh node.
[0028] When a scene node is configured with a collision property interface (UsdPhysics.CollisionAPI), the scene node is identified as a collider node of the Collision Mesh.
[0029] The collision attribute interface indicates that the node participates in physical collision detection, and therefore its corresponding geometry serves as the source of collision objects in subsequent coverage determination.
[0030] S112: Write the visual mesh nodes from the scene file to the visual mesh node set, and write the collider nodes from the scene file to the collider node set.
[0031] S12: Pair the visual mesh node set and the collider node set to generate a visual collision pairing set.
[0032] In this embodiment, step S12 specifically includes the following steps S121 to S124: S121: Perform path common prefix matching on the visual mesh node set and the collider node set.
[0033] In this embodiment, for the current visual mesh node, the node path of the visual mesh node in the scene tree is read, and the node path is divided into a list of visual path segments according to the path separator " / ". At the same time, the node paths of each collider node are read, and the node paths of each collider node are divided into a list of collision path segments according to the path separator " / ".
[0034] S122: Compare the list of visual path segments and the list of collision path segments segment by segment, and count the number of consecutive identical path segments starting from the root node to obtain the path common prefix depth (common_depth). The path common prefix depth represents the common parent depth of the visual mesh node path and the collider node path in the scene tree hierarchy. The larger the value, the closer they are in the USD scene organization structure.
[0035] S123, determine the maximum depth value from the multiple path common prefix depths corresponding to the current visual mesh node, and determine the collider node whose path common prefix depth is equal to the maximum depth value as the collider node associated with the current visual mesh node.
[0036] Specifically, if only one collider node corresponds to the maximum depth value, then that collider node is used as the associated collider node of the current visual mesh node.
[0037] If multiple collider nodes have the same path common prefix depth and are all equal to the maximum depth value, then all of these multiple collider nodes are included in the associated collider nodes of the current visual mesh node.
[0038] S124: Perform S121 to S123 on each visual mesh node in the visual mesh node set to generate a visual collision pairing set.
[0039] In this embodiment, the visual collision pairing set is represented in list form as [(visual_prim, [col_prim1, col_prim2, ...])].
[0040] Here, `visual_prim` represents the scene's basic node corresponding to the current visual mesh node, and `col_prim1` and `col_prim2` represent one or more collider nodes associated with this visual mesh node. Each element in the list represents a visual mesh node and its associated collider node list.
[0041] S2: Perform geometry type identification and triangular mesh conversion.
[0042] Geometric type discrimination and triangular mesh transformation are performed on the visual mesh nodes and their associated collider nodes in the visual collision pairing set to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system.
[0043] Among them, a triangular mesh object (Trimesh) represents a mesh model composed of triangular facets used for subsequent sampling, including detection and distance calculation.
[0044] In this embodiment, step S2 specifically includes steps S21 to S22: S21: Read the geometry type and geometry parameters corresponding to the visual mesh node or collider node, and perform triangular mesh conversion.
[0045] 1. If the geometry type is a mesh type (UsdGeom.Mesh), then perform the following conversion steps: 1) Read the list of vertex coordinates (points), face vertex indices (faceVertexIndices), and number of vertices per face (faceVertexCounts) of the node of this mesh type.
[0046] 2) Perform triangulation on grid-type nodes.
[0047] If the count of each vertex of the current face is equal to 3, then the face is already a triangular face and can be directly reorganized into a triangle index based on faceVertexIndices; If the number of vertices (count) on each face of the current polygon is greater than 3, then a sector triangulation method is used. This involves using the first vertex (v0) of the polygon as the base point, and sequentially connecting the i-th vertex (vi) and the (i+1)-th vertex (vi+1) to form a triangle (v0, vi, vi+1). Here, v0, vi, and vi+1 represent the vertex indices of the current polygon face. This process generates a local triangular mesh object.
[0048] 2. If the geometry type is a basic geometry type, then the corresponding geometric parameters are read, and a local triangular mesh object of the corresponding shape is generated based on these parameters. Specifically: If the geometry type is cube (UsdGeom.Cube), read the side length attribute (size), call the cube mesh generation function (trimesh.creation.box), and use the side length attribute as input to generate a standard cube local triangular mesh object composed of triangular facets; If the geometry type is sphere (UsdGeom.Sphere), read the radius attribute (radius), call the sphere mesh generation function (trimesh.creation.icosphere), and generate a local triangular mesh object of the sphere with the radius attribute and subdivision parameter subdivisions=3 as input; If the geometry type is a capsule (UsdGeom.Capsule), read the radius and height attributes, call the capsule mesh generation function (trimesh.creation.capsule), and generate a local triangular mesh object of the capsule with the radius and height as input; If the geometry type is cylinder (UsdGeom.Cylinder), read the radius and height attributes, call the cylinder mesh generation function (trimesh.creation.cylinder), and generate a local triangular mesh object of cylinder with the radius and height as input.
[0049] The trimesh.creation.* functions mentioned above are all used to convert basic geometric parameters into triangular mesh objects that can participate in unified containment detection.
[0050] S22: Perform a homogeneous transformation on the vertex coordinates of the local triangular mesh object, converting it to a unified world coordinate system. This includes the following steps: 1) Perform homogeneous coordinate expansion on the set of vertex coordinates local_points in the local coordinate system to obtain homogeneous(local_points).
[0051] Where local_points represents the set of vertex coordinates of the local triangular mesh object; The homogeneous(local_points) function represents the homogeneous coordinate matrix formed by adding homogeneous coordinate components to the coordinates of each local vertex.
[0052] 2) Perform matrix operations according to the formula world_points = (homogeneous(local_points)) @ usd_matrix.
[0053] Where @ denotes matrix multiplication; usd_matrix represents the 4×4 homogeneous transformation matrix obtained in step S22; world_points represents the set of vertex coordinates after transformation to the unified world coordinate system.
[0054] 3) Based on the transformed world_points and the corresponding triangle patch indices, generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system.
[0055] A triangular mesh object represents a mesh model composed of triangular facets used for subsequent sampling, detection, and distance calculation. Visual triangular mesh objects are used to generate a set of sampling points, while collision triangular mesh objects are used to determine whether a sampling point is covered by a collider.
[0056] Step S2 unifies different types of visual geometries and colliders in USD into triangular mesh objects under the same coordinate reference through geometry type discrimination, triangulation processing, and world coordinate transformation, so that subsequent sampling, inclusion detection, and distance detection have a consistent data format and spatial reference.
[0057] S3: Perform layered sampling on the visual triangular mesh object to generate a set of sampling points.
[0058] In this embodiment, a three-layer sampling strategy is constructed based on vertex sampling, surface sampling, and edge sampling. The total upper limit of sampling points is max_samples, and the target quotas for the surface layer and edge layer are determined according to 60% and 30%, respectively. Specifically, the following steps are included: 1. Perform vertex sampling. Read the vertex coordinates of the visual triangular mesh object and directly use these coordinates as vertex sampling points to generate a set of vertex sampling points. These vertex sampling points are used to cover the structural feature points of the model.
[0059] 2. Perform surface sampling to generate a set of surface sampling points. Surface sampling employs a two-stage approach: centroid-first sampling and area density supplementation. Specifically, it includes the following steps: 1) Perform centroid sampling.
[0060] For each triangular facet in the visual triangular mesh object, calculate the centroid coordinates of the triangular facet and use the centroid coordinates as the centroid sampling point.
[0061] Centroid sampling points are used to ensure that each triangular facet has at least one sampling point, reducing the chance of small facets being missed.
[0062] 2. Conduct supplementary area density sampling.
[0063] 1) Calculate the number of supplementary points based on the area density parameters.
[0064] For the current triangular facet, the number of additional surface sampling points is calculated according to the formula extra_n = min(area × density, max_surface - len(centroids)).
[0065] Where extra_n represents the number of surface sampling points that need to be added to the current triangular facet; area represents the area of the current triangular facet; density represents the area density parameter, which is used to control the number of supplementary samples per unit area; `max_surface` represents the sampling point quota for the surface layer, which is `max_samples × 60%`. centroids represents the set of centroid sampling points that have been generated; len(centroids) represents the number of centroid sampling points that have been generated.
[0066] 2) Call the surface sampling function (trimesh.sample.sample_surface), taking the visual triangular mesh object and the number of supplementary surface sampling points extra_n as input, and perform area-weighted sampling on the surface of the visual triangular mesh object to obtain supplementary surface sampling points.
[0067] The surface sampling function returns the coordinates of the sampling points located on the surface of the triangular patch, and the returned results are written into the surface sampling point set.
[0068] 3. Perform edge sampling to generate a set of edge sampling points. Edge sampling employs a two-stage approach: prioritizing edge midpoints and supplementing with edge length density. Specifically, it includes the following steps: 1) Perform edge midpoint sampling.
[0069] Extract all unique edges from the visual triangular mesh object, calculate the coordinates of the midpoint of each unique edge, and use the coordinates of the midpoint as the midpoint sampling point.
[0070] Among them, a unique edge refers to an edge object that is retained only once when two triangular facets share an edge; the midpoint sampling point of the edge is used to cover the model creases, contour edges, and edge areas that are prone to being missing by the collider.
[0071] 2) Perform side length density supplementary sampling.
[0072] The number of additional points (count) for the current edge is determined based on the edge length density parameter and the edge length of the current edge.
[0073] For the current edge, generate the interpolation parameter sequence according to the formula t = linspace(0, 1, count+2)[1:-1].
[0074] Where count represents the number of internal interpolation points that need to be added to the current edge; `linspace(0, 1, count+2)` means generating `count+2` parameter values at equal intervals between 0 and 1. [1:-1] means removing the first endpoint parameter 0 and the last endpoint parameter 1, and keeping only count interpolation parameters inside the edge.
[0075] 3) Calculate the edge interpolation sampling points according to the formula point = v0 + t × (v1 - v0) and write them into the edge sampling point set.
[0076] Where, point represents the coordinates of the edge sampling point corresponding to the current interpolation parameter t; v0 represents the coordinates of the first endpoint of the current edge; v1 represents the coordinates of the second endpoint of the current edge; t represents the interpolation parameter generated in step S332.
[0077] 4. Merge the vertex sampling point set, surface sampling point set, and edge sampling point set, and perform deduplication.
[0078] 1) Merge the vertex sampling point set, surface sampling point set, and edge sampling point set to obtain the merged sampling point coordinate array pts. Here, pts represents the sampling point coordinate array formed by merging the sampling results of the three layers. Each row in the array corresponds to the three-dimensional coordinates of a sampling point in a unified world coordinate system.
[0079] 2) Perform deduplication on the merged sampling point coordinate array pts.
[0080] Specifically, the sampling point coordinates are quantized using a tolerance threshold tol = 1e-9 meters to obtain the quantization key key = round(pts / tol).
[0081] Where, tol represents the spatial tolerance used to determine whether two sampling points overlap; pts / tol indicates that the coordinates of the sampling points are normalized according to the tolerance scale; round indicates rounding the normalized coordinates; key represents the quantization coordinate key used for deduplication comparison.
[0082] 3) Call the unique value extraction function (np.unique), take the key as input and set axis=0 and return_index=True, search for the unique quantization key along the sampling point dimension and return the index of the first occurrence, and extract the first occurrence sampling point from pts based on the returned index to generate a sampling point set.
[0083] Where axis=0 indicates that each sampling point is compared row by row; `return_index=True` means returning the index of the retained sample point in the original `pts` array.
[0084] Step S3 uses three layers of sampling—vertex, surface, and edge—to ensure that the structural points, facet regions, and contour crease regions of the visual triangular mesh object are all included in the detection range. By prioritizing the centroid, supplementing area density, and supplementing side length density, the missed detection of locally missing collision objects can be reduced. By using a 1e-9 meter tolerance for deduplication, redundant calculations caused by repeated sampling points can be reduced.
[0085] S4: Perform spatial hierarchical flow limiting on the set of sampling points.
[0086] Determine whether the number of sampling points in the sampling point set exceeds a preset sampling number threshold. If yes, perform spatial hierarchical flow limiting on the sampling point set; otherwise, proceed directly to step S5.
[0087] Specifically, the spatial stratified current limiting process includes the following steps S41 to S43: S41: Determine the voxel side length based on the spatial range of the sampling point set and the number of target points. Specifically, this includes the following steps: 1) Read the set of sampling points to be current limited and calculate the spatial range [pmin, pmax] of the set of sampling points to be current limited in the unified world coordinate system.
[0088] Where pmin represents a three-dimensional vector composed of the minimum coordinates of the sampling point to be current limited in each coordinate axis direction; pmax represents a three-dimensional vector consisting of the maximum coordinates of the sampling points to be current limited along each coordinate axis.
[0089] 2) Calculate the spatial scale extent according to the formula extent = pmax - pmin. The extent represents the span of the set of sampling points to be current limited along each coordinate axis.
[0090] 3) Estimate the voxel grid dimension and voxel edge length based on the target number of points max_pts.
[0091] The voxel grid dimension is calculated using the formula grid_dim = ceil(max_pts^(1 / 3)).
[0092] Where max_pts represents the number of target sampling points that need to be retained after rate limiting; ceil means round up; grid_dim indicates the target grid dimension used when dividing the voxel space in each coordinate axis direction.
[0093] 4) Calculate the voxel side length according to the formula voxel_size = extent / grid_dim.
[0094] Here, voxel_size represents the voxel size along each coordinate axis.
[0095] If the extent of a certain coordinate axis direction degenerates to close to 0, then the voxel_size of that axis is set to 1.0 to avoid division by zero.
[0096] S42: Based on the spatial coordinates of each sampling point in the sampling point set, the sampling point set is divided into voxel buckets to obtain multiple voxel buckets.
[0097] Specifically, for the current sampling point pt, the voxel key is calculated according to the formula key = floor((pt - pmin) / voxel_size), and the current sampling point is written into the bucket dictionary buckets according to the key. buckets represents a bucketed data structure with voxel key as index and a list of sampling points located within the corresponding voxel space as value.
[0098] Where pt represents the three-dimensional coordinates of the current sampling point in the unified world coordinate system; pt - pmin represents the offset of the current sampling point relative to the minimum point in the spatial range; voxel_size represents the voxel size obtained in step S41; floor indicates rounding down; key represents the integer triplet of the voxel bucket to which the current sampling point belongs.
[0099] S43: Select at least one sampling point from each voxel bucket to generate a current-limited sampling point set. This includes the following steps S431 to S433: S431: Prioritize broad coverage.
[0100] Iterate through each voxel bucket in buckets, and for each voxel bucket, select the first point to add to the rate limiting result set, until the number of selected sampling points reaches the target number of points max_pts, or all voxel buckets have completed the first round of selection.
[0101] S432: Perform polling to supplement the selection.
[0102] If the number of selected sampling points after step S431 is still less than the target number of points max_pts, then the unselected sampling points in each voxel bucket are polled and supplemented until the number of selected sampling points reaches the target number of points max_pts.
[0103] Specifically, if the number of voxel bins fails to reach the target number of points max_pts due to numerical degradation, the remaining sampling points are supplemented according to the original order of the sampling point set until the number of selected sampling points reaches the target number of points max_pts.
[0104] S433: Generate a set of sampling points after rate limiting from the selected sampling points, and use the set of sampling points after rate limiting as the set of sampling points for subsequent coverage determination.
[0105] The beneficial effects of this step are: by using voxel binning, wide coverage priority selection, and round-robin supplementary selection, the coverage uniformity of sampling points in three-dimensional space is maintained while controlling the number of sampling points; and this flow limiting process does not rely on random numbers, ensuring that the detection results are repeatable under the same input.
[0106] S5: Determine whether the sampling point is covered by a collision triangle mesh object.
[0107] Each sampling point in the sampling point set is determined to be located within the corresponding collision triangle mesh object. If it is, the sampling point is marked as an covered sampling point. If not, the sampling point is further determined to be less than the preset tolerance value. If it is, the sampling point is marked as an covered sampling point.
[0108] In this embodiment, step S5 specifically includes the following steps S51 to S56: S51: For each collision triangle mesh object associated with the current visual mesh node, perform inclusion determination, specifically including the following steps: S511: Perform axis-aligned bounding box pre-filtering on the current collision triangle mesh object.
[0109] Axis-Aligned Bounding Box (AABB) is used to quickly exclude sampling points that are significantly far from the collider.
[0110] In this embodiment, the minimum and maximum coordinates of the current collision triangular mesh object along each coordinate axis in the unified world coordinate system are calculated to obtain the bounding box bounds = [min_pt, max_pt].
[0111] Where min_pt represents the minimum coordinate vector of the current collision triangle mesh object in each coordinate axis direction; max_pt represents the maximum coordinate vector of the current collision triangle mesh object in each coordinate axis direction; `bounds` represents the bounding box defined by `min_pt` and `max_pt`.
[0112] S512: Calculate the effective tolerance and expand the bounding box, and determine whether the sampling point is located within the expanded bounding box.
[0113] 1) Calculate the diagonal length of the bounding box according to the formula diagonal = norm(max_pt - min_pt).
[0114] Wherein, diagonal represents the spatial scale of the current collision triangle mesh object's bounding box; norm indicates the calculation of vector length.
[0115] 2) Calculate the effective tolerance according to the formula eff_tol = max(user_tol, diagonal × 1e-6).
[0116] Where eff_tol represents the effective tolerance used to expand the bounding box; user_tol represents the preset user tolerance; diagonal × 1e-6 represents the lower limit of the scale tolerance determined based on the spatial scale of the collision triangular mesh object.
[0117] 3) Expand the bounding box to [min_pt - eff_tol, max_pt + eff_tol] based on eff_tol, and determine whether the sampling point is located within the expanded bounding box.
[0118] If it is determined that the sampling point is located within the expanded bounding box, then continue to execute step S513; If it is determined that the sampling point is outside the expanded bounding box, then skip step S513.
[0119] S513: Determine whether the current collision triangle mesh object is a watertight mesh.
[0120] Specifically, read the watertight property (mesh.is_watertight) and volume property (mesh.is_volume) of the current collision triangle mesh object.
[0121] Here, mesh represents the current collision triangle mesh object; `mesh.is_watertight` indicates whether the current collision triangle mesh object is a completely closed mesh without holes; `mesh.is_volume` indicates whether the currently colliding triangular mesh object forms a valid closed volume.
[0122] If both mesh.is_watertight and mesh.is_volume are satisfied, then the current collision triangle mesh object is treated as a watertight mesh. If not mesh.is_watertight or not mesh.is_volume exists, then the current collision triangle mesh object is treated as a non-watertight mesh.
[0123] S52: Perform batch inclusion detection on the watertight mesh.
[0124] The function containing detection (trimesh.Trimesh.contains(pts)) is called, taking the current collision triangle mesh object mesh and the current batch of sample point coordinate array pts as input. Rays are emitted from each sample point in a fixed direction using the ray method, and the number of intersections between the rays and the mesh surface is counted. If the number of intersections is odd, the corresponding sample point is determined to be inside the current collision triangle mesh object.
[0125] The detection function returns a boolean mask `contains_mask`, where each boolean value in `contains_mask` corresponds to whether a sample point in `pts` is located within the current collision triangle mesh object. `contains_mask` is then merged into the overlay mask of the current visual mesh node.
[0126] In this embodiment, the set of sampling points to be detected is divided into batches of no more than 2000 points each, resulting in the coordinate array pts of the current batch of sampling points. Here, pts represents the coordinate array of the sampling points to be detected in the current batch under a unified world coordinate system.
[0127] S53: Perform a catch-all detection of the Signed Distance Field (SDF) on non-watertight meshes.
[0128] Call the directed distance calculation function (trimesh.proximity.signed_distance) to calculate the directed distance of each sampling point relative to the surface of the current collision triangular mesh object according to sd =trimesh.proximity.signed_distance(mesh, pts).
[0129] Here, mesh represents the current collision triangle mesh object; pts represents the array of coordinates of the sampling points in the current batch; sd represents the directed distance array returned by the function.
[0130] Specifically, sd represents a directed distance array that corresponds one-to-one with each sampling point in pts. A directed distance boolean mask sdf_mask is generated according to the condition sd>= -tolerance.
[0131] Where tolerance represents the preset surface tolerance; sdf_mask indicates that the corresponding sampling point is located inside the collider or within the surface tolerance range.
[0132] S54: Perform a logical OR operation between the ray-based detection result from step S52 and the directional distance field catch-up result from step S53 to obtain inside = contains_mask | sdf_mask.
[0133] Wherein, inside represents the coverage judgment result of the current batch of sampling points relative to the current collision triangle mesh object; The `contains_mask` option indicates that the X-ray method includes the detection results. sdf_mask represents the result of the directed distance field catch-all judgment.
[0134] If the result corresponding to a sampling point in inside is true, then that sampling point is marked as a covered sampling point.
[0135] S55, for sampling points not identified as being within the collision triangle mesh object, further surface distance compensation is performed. Specifically, this includes the following steps: Read the points within the extended AABB of the current collision triangle mesh object from the uncovered sampling points, and form a near-surface query point coordinate array pts.
[0136] The nearest surface lookup function (trimesh.proximity.on_surface(pts)) is called, taking the current collision triangular mesh object and the coordinate array pts of the near-surface points to be queried as input, and returning the nearest point distance dist from each sampled point to the surface of the current collision triangular mesh object. Here, dist represents the nearest surface distance corresponding to each sampled point in pts. If dist < tolerance, the corresponding sampled point is marked as a near-surface sampled point and considered as an covered sampled point.
[0137] S56, perform a logical OR merge on the determination results of each collision triangle mesh object corresponding to the same visual mesh node: if the same sampling point is determined to be a covered sampling point by any collision triangle mesh object, then the sampling point is determined to be a covered sampling point.
[0138] In this embodiment, sampling points that have been marked as covered are stopped from being repeatedly detected in subsequent collision triangular mesh object detection, forming an early exit optimization.
[0139] Step S5 reduces invalid inclusion detection through AABB pre-filtering, and jointly determines the coverage relationship through watertight mesh ray method, non-watertight mesh directional distance field fallback and surface tolerance compensation. It also avoids misjudgment of internal surfaces of merged mesh by independently judging multiple colliders and taking logical OR. This improves the reliability of coverage judgment in irregular collider and composite collider scenarios.
[0140] S6: Generate the corresponding coverage result.
[0141] Based on the covered and uncovered sampling points, corresponding coverage results are generated; wherein, the coverage results include a set of covered sampling points, a set of uncovered sampling points, and a coverage rate. Specifically, this includes the following steps S61 to S62: S61: Count the number of covered sampling points and the total number of sampling points. Among them, the uncovered sampling points are those outside that are more than the surface tolerance at all colliders.
[0142] S62: Calculate coverage: truly_outside_count = the number of points outside that are at a distance greater than tolerance from all colliders; coverage_ratio = 1 - truly_outside_count / total_sample_count; Here, `coverage_ratio` represents the coverage ratio, `truly_outside_count` represents the number of uncovered sample points, and `total_sample_count` represents the total number of sample points. The coverage ratio is accurate to two decimal places.
[0143] S7: Generate coverage consistency test results based on coverage rate.
[0144] Determine the coverage ratio within the following threshold range: when coverage_ratio < 60%, generate a failure detection result; when 60% ≤ coverage_ratio < 85%, generate a warning detection result; when coverage_ratio ≥ 85%, generate a pass detection result.
[0145] Output a coverage consistency test report, which includes coverage rate, coverage consistency test results, number of covered sampling points, number of uncovered sampling points, total number of sampling points, and spatial location of uncovered sampling points. The spatial stratified sampling subset of uncovered points in the report is output as the outside_points_sample field for subsequent visualization labeling.
[0146] In this embodiment, the coverage consistency detection report is a structured JSON report.
[0147] Step S7 uses coverage threshold grading and output of the spatial location of uncovered points to make the detection results not only have quantitative judgment basis, but also to locate specific uncovered areas, providing a data foundation for subsequent visualization and repair.
[0148] In the above embodiments, S1 and S2 solve the problem of automatic identification, pairing, and unified geometric transformation of visual meshes and colliders in the absence of prior annotations; S3 covers the structural points, facet regions, and contour crease regions of the visual mesh through a three-layer sampling strategy of vertices, surfaces, and edges, with coverage calculation accuracy reaching two decimal places; S4 controls the computational load through spatial layering and flow limiting; S5 achieves complete coverage determination through AABB pre-filtering, watertight / non-watertight branch determination (including trimesh.Trimesh.contains ray casting and trimesh.proximity.signed_distance directed distance field fallback), surface distance compensation (including trimesh.proximity.on_surface nearest distance query), and logical OR merging of multiple colliders; S6 and S7 convert the coverage detection results into quantifiable coverage and locatable uncovered points as output.
[0149] Please continue reading. Figure 2 This invention discloses a visual geometry and physical collider coverage consistency detection device. In this embodiment, the visual geometry and physical collider coverage consistency detection device may include or be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the invention and implement the aforementioned visual geometry and physical collider coverage consistency detection method. The program module referred to in this invention is a series of computer program instruction segments capable of performing a specific function, and is more suitable than the program itself for describing the execution process of a visual geometry and physical collider coverage consistency detection device in a storage medium. The following description will specifically introduce the functions of each program module in this embodiment: The asset parsing module is used to parse the scene file of the 3D asset to be detected, extract the set of visual mesh nodes and the set of collider nodes to be detected, and pair the set of visual mesh nodes and the set of collider nodes to generate a visual collision pairing set.
[0150] The detection and pairing module is used to perform geometric type discrimination and triangular mesh transformation on the visual mesh nodes and their associated collider nodes in the visual collision pairing set, and generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system.
[0151] The layered sampling module is used to perform layered sampling on visual triangular mesh objects and generate a set of sampling points.
[0152] The coverage detection module is used to determine whether each sampling point in the sampling point set is located within the corresponding collision triangle mesh object. If so, the sampling point is marked as a covered sampling point. If not, it further determines whether the directed distance between the sampling point and the collision triangle mesh object is less than a preset tolerance value. If so, the sampling point is marked as a covered sampling point.
[0153] The output module is used to generate the corresponding coverage results.
[0154] This embodiment also provides a computing device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including standalone servers or server clusters composed of multiple servers) capable of executing programs. The computing device 20 in this embodiment includes, but is not limited to, a memory 21 and a processor 22 that can communicate with each other via a system bus. Figure 3 As shown. It should be noted that, Figure 3 Only a computing device 20 with components 21-22 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0155] In this embodiment, the memory 21 (i.e., the readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 21 may be an internal storage unit of the computing device 20, such as the hard disk or memory of the computing device 20. In other embodiments, the memory 21 may also be an external storage device of the computing device 20, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computing device 20. Of course, the memory 21 may include both the internal storage unit and the external storage device of the computing device 20. In this embodiment, the memory 21 is typically used to store the operating system and various application software installed on the computing device 20, such as the program code of a visual geometry and physical collision body coverage consistency detection device in Embodiment 1. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
[0156] In some embodiments, processor 22 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 22 is typically used to control the overall operation of computing device 20. In this embodiment, processor 22 is used to run program code stored in memory 21 or process data, for example, to run a visual geometry and physical collider coverage consistency detection device to implement a visual geometry and physical collider coverage consistency detection method according to Embodiment 1.
[0157] This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., which stores a computer program. When the program is executed by a processor, it implements the corresponding function. The computer-readable storage medium of this embodiment is used to store a visual geometry and physical collider coverage consistency detection device, which, when executed by a processor, implements a visual geometry and physical collider coverage consistency detection method of Embodiment 1.
[0158] In summary, according to the exemplary embodiments, the visual geometry and physical collision body coverage consistency detection method and apparatus of the present invention have the following beneficial effects: Automatic identification and pairing: Through an automatic pairing mechanism based on the common prefix depth of the scene tree path, the correspondence between the visual mesh and the collider is automatically established without prior annotation, eliminating the need for manual specification of the pairing relationship and reducing the cost of manual intervention.
[0159] Unified geometric representation: By identifying geometric types and converting triangular meshes, visual geometry and collision objects of different types and complexities are uniformly converted into triangular mesh objects and unified to the same world coordinate system. This enables subsequent detection algorithms to be executed on a unified geometric reference, avoiding detection errors caused by inconsistencies in coordinates or incompatible types.
[0160] High-precision layered sampling: A three-layer strategy of vertex sampling, surface sampling, and edge sampling ensures that structural feature points, patch areas, and contour crease areas of the visual mesh are all covered. Surface sampling combines centroid-priority with area density supplementation, while edge sampling combines edge midpoint-priority with edge length density interpolation. Compared to bounding box methods and purely random sampling, the coverage calculation accuracy reaches two decimal places, reducing the missed detection rate of missing local collision bodies such as cup handles and light bulb necks.
[0161] Spatial hierarchical flow limiting: By adopting a two-stage selection strategy of voxel binning and wide coverage priority selection plus polling supplementation, the computational efficiency of sampling points is maintained while controlling the amount of computation, thus ensuring the computational efficiency in large-scale grid asset detection scenarios.
[0162] Robust coverage determination: Ray intersection count is used to determine coverage for watertight meshes, and a directional distance field fallback mechanism is introduced for non-watertight meshes to reduce the false negative rate caused by mesh holes in the ray method; the surface distance compensation mechanism re-determines the sampling points near the surface of the collider as covered, eliminating false positives caused by tiny manufacturing gaps between the visual mesh and the collider.
[0163] Correct handling of multiple colliders: Perform logical OR operation on multiple colliders corresponding to the same visual grid after judgment to avoid misjudgment of internal surfaces caused by directly merging multiple grids and ensure the correct results in the case of composite colliders; at the same time, avoid repeated detection of covered sampling points by exiting the processing in advance.
[0164] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0165] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0166] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable medium, and when executed, it includes one or a combination of the steps of the method embodiments.
[0167] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0168] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0169] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for detecting the consistency of visual geometry and physical collision object coverage, characterized in that, Includes the following steps: The scene file of the 3D asset to be detected is parsed, the set of visual mesh nodes and the set of collider nodes to be detected are extracted, and the set of visual mesh nodes and the set of collider nodes are paired to generate a visual collision pairing set; wherein, each visual mesh node in the visual collision pairing set is associated with one or more collider nodes. Geometric type discrimination and triangular mesh transformation are performed on the visual mesh nodes and their associated collider nodes in the visual collision pairing set to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system. The visual triangular mesh object is sampled in layers to generate a set of sampling points. It is then determined whether each sampling point in the set is located within the corresponding collision triangular mesh object. If so, the sampling point is marked as a covered sampling point. If not, it is further determined whether the distance between the sampling point and the surface of the collision triangular mesh object is less than a preset tolerance value. If so, the sampling point is marked as a covered sampling point. Generate corresponding coverage results; wherein, the coverage results include at least one of the following: a set of covered sampling points, a set of uncovered sampling points, and coverage rate.
2. The method for detecting the consistency of visual geometry and physical collision object coverage according to claim 1, characterized in that, The process of performing geometric type discrimination and triangular mesh transformation on the visual mesh nodes and their associated collider nodes in the visual collision pairing set to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system specifically includes the following steps: Read the geometry type and geometry parameters corresponding to the visual mesh node and / or collider node, and determine the geometry type; If the geometry type is a mesh type, then the corresponding vertex coordinates, face vertex indices and number of vertices per face are read from the geometry parameters, and non-triangular faces are triangulated to generate corresponding local triangular mesh objects; If the geometry type is a basic geometry type, then a corresponding local triangular mesh object is generated based on the corresponding geometric parameters; Perform coordinate transformation on the local triangular mesh object to generate a visual triangular mesh object and / or a collision triangular mesh object.
3. The method for detecting the consistency of visual geometry and physical collision object coverage according to claim 1, characterized in that, The visual triangular mesh object is sampled hierarchically to generate a set of sampling points, specifically including the following steps: Vertex sampling is performed to extract the vertex coordinates of the visual triangular mesh object and generate a set of vertex sampling points; Perform surface sampling and generate a set of surface sampling points based on the triangular patches of the visual triangular mesh object; In addition, edge sampling is performed to generate a set of edge sampling points based on the edges of the visual triangular mesh object; The vertex sampling point set, surface sampling point set, and edge sampling point set are merged and deduplicated to generate the sampling point set.
4. Wherein, the set of surface sampling points includes the centroid sampling points of each triangular facet and supplementary surface sampling points allocated according to the facet area; The set of edge sampling points includes the midpoint sampling points of each edge and the interpolated sampling points allocated according to the edge length.
5. The method for detecting the consistency of visual geometry and physical collision object coverage according to claim 3, characterized in that, The visual triangular mesh object is subjected to hierarchical sampling to generate a set of sampling points, which specifically includes the following steps: Determine whether the number of sampling points in the sampling point set exceeds a preset sampling number threshold; If so, then spatial hierarchical flow limiting processing is applied to the set of sampling points; The spatial layered current limiting process specifically includes the following steps: The voxel side length is determined based on the spatial range of the sampling point set and the number of target points. Based on the spatial coordinates of each sampling point in the sampling point set, the sampling point set is divided into voxel buckets to form several voxel buckets; wherein, each voxel bucket includes sampling points located within the corresponding voxel space range; At least one sampling point is preferentially selected from each voxel bucket to generate a set of sampling points after flow limiting.
6. The method for detecting the consistency of visual geometry and physical collision object coverage according to claim 4, characterized in that, The step of preferentially selecting at least one sampling point from each voxel bucket to generate a current-limited sampling point set includes the following steps: Sampling points were selected from each voxel bucket; Determine whether the number of selected sampling points has reached the target number of points; If not, poll and select additional sampling points in each voxel bucket that have not yet been selected, until the number of sampling points reaches the target number. The selected sampling points are used to generate the current-limited sampling point set.
7. A method for detecting the consistency of visual geometric and physical collision object coverage according to any one of claims 1 to 5, characterized in that: The step of determining whether a sampling point in the sampling point set is located within the corresponding collision triangle mesh object specifically includes the following steps: Determine whether the collision triangle mesh is a watertight mesh. If the collision triangle mesh is a watertight mesh, then the sampling point is determined to be within the collision triangle mesh object based on the number of ray intersections. If so, the sampling point is marked as a covered sampling point. If the collision triangle mesh is a non-watertight mesh, the directed distance between the sampling point and the surface of the collision triangle mesh object is calculated, and it is determined whether the directed distance between the sampling point and the collision triangle mesh object is less than a preset tolerance value. If so, the sampling point is marked as a covered sampling point.
8. The method for detecting the consistency of visual geometry and physical collision body coverage according to claim 6, characterized in that: Before determining whether the sampling point is located within the corresponding collision triangle mesh object, the following steps are also included: The bounding box of the collision triangular mesh object is determined based on the minimum and maximum coordinates of the collision triangular mesh object along each coordinate axis in a unified world coordinate system. The effective tolerance is determined based on the preset tolerance and the spatial dimensions of the bounding box; The bounding box is expanded based on the effective tolerance, and it is determined whether the sampling point is located within the expanded bounding box.
9. A device for detecting the consistency of visual geometry and physical collider coverage, employing the method for detecting the consistency of visual geometry and physical collider coverage as described in any one of claims 1 to 7, characterized in that, include: The asset parsing module is used to parse the scene file of the 3D asset to be detected, extract the set of visual mesh nodes and the set of collider nodes to be detected, and pair the set of visual mesh nodes and the set of collider nodes to generate a visual collision pairing set. The detection and pairing module is used to perform geometric type discrimination and triangular mesh transformation on the visual mesh nodes and their associated collider nodes in the visual collision pairing set, respectively, to generate visual triangular mesh objects and collision triangular mesh objects in a unified world coordinate system. The hierarchical sampling module is used to perform hierarchical sampling on the visual triangular mesh object to generate a set of sampling points; The coverage detection module is used to determine whether each sampling point in the sampling point set is located within the corresponding collision triangle mesh object. If so, the sampling point is marked as a covered sampling point. If not, it further determines whether the directed distance between the sampling point and the collision triangle mesh object is less than a preset tolerance value. If so, the sampling point is marked as a covered sampling point. The output module is used to generate the corresponding coverage results.
10. A computing device, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the instructions, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the method according to any one of claims 1 to 7.
