A GPU parallel-based semantic voxel shell layer generation method
Patent Information
- Application Number
- CN202611179453.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-08-05
AI Technical Summary
[0003]目前,面向三维路径规划的传统体素化前处理技术存在诸多缺陷,难以满足高精度、高效率的规划需求;现有技术主要存在语义信息缺失、计算效率低下、壳层参数化不足、多部件合并困难以及多GPU资源利用不足的问题
本发明利用GPU并行计算三维三角网格模型上每个三角形的轴对齐包围盒和中心点的三维空间坐标交织编码,通过遍历层次包围盒树,以得到占用体素,形成体素壳层;利用占用体素对应的占用网格,在GPU上计算有符号距离场;于多个独立网格部件,依据有符号距离场,对每个体素执行语义标注,以得到语义体素壳层,能够高效地将三维三角网格模型转换为携带语义标注的体素壳层和有符号距离场,可同步实现参数化体素壳层生成、精准有符号距离场计算、自动多部件语义融合的高效GPU并行体素化生成,为三维路径规划算法提供语义丰富的空间表示。
Smart Images

Figure CN122695168B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial digital design technology, and more specifically, to a method for generating semantic voxel shells based on GPU parallelism. Background Technology
[0002] In the field of industrial digital design technology, for computer graphics and 3D spatial data processing, automated path planning in 3D space typically employs voxel meshes to discretize a continuous 3D space. The occupancy status, distance field information, and semantic information of the mesh cells provide data support for path search, collision detection, and the formulation of differentiated obstacle avoidance strategies. Specifically, the occupancy status identifies the location of obstacles in the scene, the signed distance field provides obstacle distance guidance for path planning, and the semantic information distinguishes obstacle categories and attributes, forming the core foundation for intelligent path planning.
[0003] Currently, traditional voxelization preprocessing techniques for 3D path planning have many shortcomings and cannot meet the requirements of high-precision and high-efficiency planning. Existing technologies mainly suffer from problems such as missing semantic information, low computational efficiency, insufficient shell parameterization, difficulty in merging multiple components, and insufficient utilization of multi-GPU resources. Summary of the Invention
[0004] To address the aforementioned problems, the present invention aims to provide a GPU-parallel semantic voxel shell generation method for industrial digital design technology, which achieves efficient GPU-parallel voxel generation by simultaneously realizing parameterized voxel shell generation, accurate signed distance field calculation, and automatic multi-component semantic fusion.
[0005] To achieve the above technical objectives, this application provides a GPU-parallel semantic voxel shell generation method applied in the field of industrial digital design technology, comprising the following steps: The GPU is used to perform parallel computation to encode the axis-aligned bounding box and the three-dimensional spatial coordinates of the center point of each triangle on the three-dimensional triangular mesh model to construct a hierarchical bounding box tree, in which the three-dimensional triangular mesh model contains multiple independent mesh components. By traversing the hierarchical bounding box tree, occupied voxels are obtained, forming voxel shells; Based on the voxel shell, the signed distance field is calculated on the GPU using the occupancy grid corresponding to the occupancy voxel; For multiple independent mesh components, based on the signed distance field, new meshes that exceed the occupied mesh range are merged with the occupied meshes, and semantic annotation is performed on each voxel to obtain a semantic voxel shell.
[0006] Preferably, when constructing the hierarchical bounding box tree, the GPU parallel sorting algorithm is used to sort the triangles according to the three-dimensional spatial coordinates through interleaved encoding, and then the hierarchical bounding box tree is constructed from bottom to top.
[0007] Preferably, a stack-based iterative method is used to traverse the hierarchical bounding box tree.
[0008] Preferably, when acquiring occupied voxels, the unsigned distance field is obtained by traversing the hierarchical bounding box tree to query the nearest distance from the voxel center to the triangular mesh, and voxels with unsigned distance values less than or equal to a preset threshold are marked as occupied voxels.
[0009] Preferably, when calculating the signed distance field, the Jump Flooding Algorithm is used on the GPU to calculate the signed distance field. The propagation process of the Jump Flooding Algorithm is as follows: starting from a step size equal to half the maximum dimension of the grid, each round checks the neighbors within the step size in the 26-neighborhood, takes the seed with the best distance to update, the step size is halved in each round until it reaches 1, and an additional round of fine propagation with a step size of 1 is performed.
[0010] Preferably, when performing the merging process, the global origin offset and mesh size change between the new component and the existing mesh are calculated. If the new component exceeds the current mesh range, the mesh is dynamically expanded. During merging, the occupied mesh is merged, the signed distance field is minimized, and the semantic labels are merged according to preset priority rules.
[0011] Preferably, when performing semantic annotation, the identifier of the component to which each voxel belongs is recorded to form a semantic label grid of the same size as the occupied grid, thereby forming a semantic voxel shell. The semantic voxel shell includes the occupied grid, the signed distance field, and the semantic label grid, which are used by the downstream path planning algorithm for the BRAP path planning algorithm.
[0012] Preferably, in the process of performing semantic annotation on each voxel to obtain the semantic voxel shell, a three-level parallel strategy is adopted to distribute the voxelization task to multiple GPUs for parallel processing, including: The first level is scene-level parallelism, which is used to allocate different 3D scenes to different GPUs for parallel processing. The second level is partition-level parallelism, which is used to allocate different partitions in a single scene to different GPUs for parallel processing. The third level is spatial parallelism, which is used for ultra-large grids to divide the grid space into sub-blocks and distribute them to multiple GPUs for parallel processing.
[0013] Based on the same inventive concept, this application also provides a smart terminal, including: a memory and a processor, wherein the memory stores a wire harness three-dimensional path design program, and when the wire harness three-dimensional path design program is executed by the processor, it implements the steps of the method described above.
[0014] Based on the same inventive concept, this application also provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0015] The present invention discloses the following technical effects: This invention utilizes GPU parallel computing to encode the axis-aligned bounding boxes and the three-dimensional spatial coordinates of the center point of each triangle in a 3D triangular mesh model. By traversing the hierarchical bounding box tree, occupied voxels are obtained to form voxel shells. Using the occupied meshes corresponding to the occupied voxels, a signed distance field is calculated on the GPU. For multiple independent mesh components, semantic annotation is performed on each voxel based on the signed distance field to obtain a semantic voxel shell. This can efficiently convert a 3D triangular mesh model into a voxel shell carrying semantic annotations and a signed distance field. It can simultaneously achieve efficient GPU parallel voxel generation of parameterized voxel shells, accurate signed distance field calculation, and automatic multi-component semantic fusion, providing a semantically rich spatial representation for 3D path planning algorithms. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the overall process of the method described in this invention.
[0018] Figure 2 This is a flowchart of the GPU BVH construction process based on three-dimensional spatial coordinate interleaving encoding as described in this invention.
[0019] Figure 3 This is a flowchart of GPU parallel UDF calculation and threshold shell generation as described in this invention.
[0020] Figure 4 This is a flowchart of GPU parallel SDF computation based on JFA as described in this invention.
[0021] Figure 5 This is a schematic diagram of the automatic merging and semantic annotation generation of multi-component voxels as described in this invention.
[0022] Figure 6 This is a schematic diagram of the multi-GPU three-level parallel scheduling described in this invention.
[0023] Figure 7 This is a schematic diagram of the system architecture described in this invention.
[0024] Figure 8 This is a schematic diagram of the semantic voxel shell data structure described in this invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0026] Example 1: As Figure 1 As shown, this invention provides a GPU-parallel semantic voxel shell generation method for industrial digital design technology. This method is a way to convert a three-dimensional triangular mesh model into a voxel shell carrying semantic annotations and a signed distance field, which is used to provide a semantically rich spatial representation for three-dimensional path planning algorithms.
[0027] For example, GPU stands for Graphics Processing Unit, used for massively parallel computing; CUDA stands for NVIDIA GPU parallel computing platform and programming model; BVH stands for Hierarchical Bounding Box Structure, used to accelerate triangular mesh distance lookup. AABB stands for Axis-Aligned Bounding Box, used to describe the spatial extent of triangles or nodes; UDF stands for Unsigned Distance Field, representing the nearest distance from the voxel center to the geometric surface; SDF stands for Signed Distance Field, representing the signed distance of a voxel relative to the geometric surface; JFA stands for Jump Flooding Algorithm, used for GPU parallel distance propagation; Morton Code stands for 3D spatial coordinate interleaving encoding, preserving spatial locality; Voxel Shell represents a set of voxels with configurable thickness that is retained only near the geometric surface; Part ID stands for Part Identifier, used to record the input mesh part to which the voxel belongs; BRAP stands for Downstream Path Planning Algorithm Name, used in the source documentation to illustrate the application scenarios of the semantic voxel shell.
[0028] Step S100 is based on GPU parallel BVH construction using three-dimensional spatial coordinate interleaving encoding.
[0029] In step S100 of one embodiment, as Figure 2 As shown, the three-dimensional triangular mesh model is read, the triangle data is uploaded to the GPU memory, and the axis-aligned bounding box (AABB) and the three-dimensional spatial coordinate interleaving encoding of the center point of each triangle are calculated in parallel on the GPU. The triangles are sorted according to the three-dimensional spatial coordinate interleaving encoding using the GPU parallel sorting algorithm, and then a hierarchical bounding box (BVH) tree is built from bottom to top.
[0030] For example, the three-dimensional spatial coordinate interleaving encoding uses 30-bit 3D encoding to interleave the three-dimensional spatial coordinates into one-dimensional integers, so that spatially adjacent triangles maintain locality after sorting, thereby constructing a high-quality BVH tree structure.
[0031] Step S200 is based on GPU parallel UDF computation and threshold shell generation accelerated by BVH.
[0032] In step S200 of one embodiment, as Figure 3 As shown, memory space is allocated for the voxel mesh on the GPU. Each CUDA thread queries the nearest distance from the voxel center to the triangular mesh by traversing the hierarchical bounding box tree to obtain the unsigned distance field. A threshold filter is applied to the unsigned distance field, and voxels with unsigned distance values less than or equal to the preset threshold are marked as occupied voxels, forming a voxel shell with a specific thickness. At the same time, a semantic label is generated for each occupied voxel to mark the part identifier to which it belongs.
[0033] For example, the hierarchical bounding box tree is traversed using a stack-based iterative method. When the shortest distance from the axis-aligned bounding box of a child node to the query point is greater than the currently found nearest distance, the traversal of that child node is skipped.
[0034] For example, the preset threshold is parameterized according to the accuracy requirements of path planning, and the threshold value corresponds to the shell thickness, which is used to control the collision detection range during path planning.
[0035] For example, the semantic labels are part-level semantic annotations, and the semantic label of each voxel identifies the input mesh part to which it belongs.
[0036] For example, the threshold value of the threshold screening corresponds to the shell thickness of collision detection in path planning. The thickness range of the voxel shell is controlled by adjusting the threshold parameter to adapt to path planning requirements with different accuracy requirements.
[0037] For example, the priority rules for semantic labels include merging by component category priority or merging by the nearest distance principle; when merging by the nearest distance principle, the component label with the smallest absolute value of the signed distance field is taken as the semantic label of the voxel of the overlapping region.
[0038] Step S300 is based on GPU parallel SDF computation using JFA.
[0039] In step S300 of one embodiment, as Figure 4 As shown, based on the occupancy grid obtained in step S200, the signed distance field (SDF) is calculated on the GPU using the Jump Flooding Algorithm (JFA).
[0040] For example, the propagation process of the Jump Flooding Algorithm is as follows: starting with a step size equal to half the maximum dimension of the grid, each round checks the neighbors within the step size in the 26-neighborhood, takes the seed with the best distance to update, the step size is halved in each round until it reaches 1, and an additional round of fine propagation with a step size of 1 is performed.
[0041] For example, in step S301, the distance of the occupied voxel is initialized to 0, the seed coordinate is the self position, and the distance of the non-occupied voxel is initialized to infinity. For example, step S302 starts with a step size equal to half the maximum dimension of the grid. In each round, the neighbors with a step size of step are checked in the 26 neighborhoods, and the seed with the best distance is selected. The step size is halved in each round until it reaches 1. For example, in step S303, occupied voxels are given a negative sign to indicate the interior, and unoccupied voxels are kept positive to indicate the exterior, thus obtaining the complete signed distance field.
[0042] In one embodiment, the three-dimensional triangular mesh model contains multiple independent mesh components. Steps S100 to S300 are executed sequentially for each component, and automatic merging is performed each time a new mesh component is processed: the global origin offset and mesh size change between the new mesh component and the occupied mesh are calculated; if the new mesh component exceeds the range of the occupied mesh, the mesh is dynamically expanded; during merging, the occupied mesh is taken as the union, the signed distance field is taken as the minimum value, and the semantic labels are merged according to preset priority rules.
[0043] Step S400: Automatic merging of multiple voxels and generation of semantic annotations.
[0044] In step S400 of one embodiment, as Figure 5 As shown, for a 3D scene containing multiple independent mesh components, steps S100 to S300 are executed sequentially for each component, and automatic merging and semantic annotation are performed each time a new mesh component is processed: Calculate the global origin offset and grid size change between the new grid component and the occupied grid. If the new grid component exceeds the occupied grid range, dynamically expand the grid and merge the old and new data. Simultaneously, semantic annotation data is generated: for each voxel, its part ID is recorded, forming a semantic label grid of the same size as the occupied grid; for voxels in areas with overlapping parts, semantic attribution is determined according to preset priority rules.
[0045] For example, the semantic label grid and the occupancy grid have the same three-dimensional dimensions, enabling the path planning algorithm to formulate differentiated obstacle avoidance strategies based on the voxel's part affiliation.
[0046] For example, semantically labeled data, together with occupancy grid and SDF, constitute a semantic voxel shell, providing component-level semantic information for downstream path planning algorithms, enabling the path planning algorithms to formulate differentiated obstacle avoidance strategies based on the semantic attributes of different components.
[0047] For example, the downstream path planning algorithm is the BRAP path planning algorithm, which uses a semantic label grid to set differentiated safety distances according to component categories, adjust path cost weights according to component attributes, and apply path constraints to obstacles of specific semantic categories.
[0048] Step S500 involves multi-GPU three-level parallel scheduling and outputting semantic voxel shells.
[0049] In one implementation, such as Figure 6 As shown, a three-level parallel strategy is adopted to distribute the voxelization task to multiple GPUs: the first level L1 is scene-level parallelism: different 3D scenes are assigned to different GPUs for parallel processing; the second level L2 is partition-level parallelism: different partitions in a single scene (such as static obstacle partitions and dynamic contact surface partitions) are assigned to different GPUs for parallel processing; the third level L3 is spatial-level parallelism: for ultra-large meshes, the mesh space is divided into sub-blocks and assigned to multiple GPUs for parallel processing.
[0050] For example, such as Figure 8 As shown, the semantic voxel shell contains an occupancy grid, a signed distance field, and a semantic label grid for use by downstream path planning algorithms.
[0051] Example 2: This invention discloses a GPU-parallel semantic voxel shell generation method applied to the field of industrial digital design technology, specifically including the following steps: Step S100: Data preprocessing.
[0052] In one implementation, the STL (STereoLithography) format triangular mesh file exported by the 3D modeling system is read and parsed to obtain the vertex array vertices (float32 type, shape (N,3)) and the face index array faces (int32 type, shape (M,3)), where N is the number of vertices and M is the number of triangle faces.
[0053] For example, each STL file corresponds to an independent part with a unique part ID. The part's classification information (such as part type, surface properties, etc.) is specified by the input configuration file.
[0054] For example, the triangle data is flattened into a continuous array of vertex coordinates (9 float values per triangle) and passed to the GPU memory in a zero-copy manner through a bridging layer.
[0055] Step S200, GPUBVH build based on MortonCode.
[0056] In one implementation, such as Figure 2 As shown, the following sub-steps are performed on the GPU: S201 processes one triangle per CUDA thread, calculates its axis-aligned bounding box (AABB), and obtains the minimum and maximum values of the three axes; S202 calculates the union of all triangles AABB through GPU parallel reduction operations to obtain the global scene bounding box; S203 maps the three-dimensional coordinates of each triangle's center point to a 30-bit Morton Code.
[0057] For example, the coordinates of the center point are normalized to the integer range of [0, 1023], and then the three dimensions of x, y, and z are interleaved and encoded into one-dimensional integers.
[0058] S204 uses the sort_by_key function from the thrust library to perform GPU parallel sorting of MortonCode and simultaneously rearranges the triangle data; S205 constructs BVH internal nodes from bottom to top. Leaf nodes correspond to the sorted triangle sequence, and internal nodes are constructed by merging the AABBs of adjacent child nodes. For the case of an odd number of nodes, the last node is promoted to the next higher level for processing.
[0059] For example, the data structure of the BVH node is as follows: struct BVHNode{ AABBbbox; / / Bounding box of nodes (containing xmin, ymin, zmin, xmax, ymax, zmax) intleft; / / Index of the left child node (internal node) or the starting index of the triangle (leaf node) intright; / / Index of the right child node (internal node) or number of triangles (leaf node) intis_leaf; / / Leaf node flag }; Once constructed, the BVH tree can be used for nearest-point queries with O(logn) complexity.
[0060] Step S300: GPU parallel UDF calculation and threshold shell generation.
[0061] In one implementation, such as Figure 3 As shown, the following sub-steps are performed on the GPU: S301 calculates the origin coordinates and 3D dimensions (NX×NY×NZ) of the voxel mesh based on the global scene bounding box, voxel side length (voxel_size), and pad_voxels (pad_voxels), and allocates voxel arrays and semantic label arrays on the GPU.
[0062] S302 processes one voxel (x, y, z) per CUDA thread and calculates its world coordinates: world_pos = origin + (x + 0.5) voxel_size, (y+0.5) voxel_size, (z+0.5) voxel_size.
[0063] S303 starts from the root node of the BVH tree and uses a stack-based iterative traversal to find the shortest distance from the voxel center to the triangular mesh.
[0064] For example, during the traversal, if the shortest distance from the AABB of a child node to the query point is greater than the currently found nearest distance, the child node is skipped (early pruning).
[0065] S304 For triangles that reach leaf nodes, the Voronoi region classification method is used to calculate the shortest distance from the point to the triangle.
[0066] For example, this method divides the space into 7 regions (3 vertex regions, 3 edge regions, and 1 face region), and calculates them separately: Vertex region: Euclidean distance from a point to a vertex; Edge region: the perpendicular distance from a point to a line segment; Surface region: the perpendicular distance from a point to the plane (it needs to be verified that the projection is inside the triangle); Take the minimum value as the final distance.
[0067] S305 performs threshold filtering on the calculated UDF values.
[0068] For example, the UDF value is compared with a preset threshold. If UDF≤threshold, the voxel is marked as occupied (value is 1), otherwise it is marked as empty (value is 0).
[0069] S306 generates semantic annotations simultaneously.
[0070] For example, for an occupied voxel, its semantic label is set to the PartID of the current part, forming a semantic label grid of the same size as the occupied grid.
[0071] For example, the occupied grid represents the voxel grid corresponding to the occupied voxel.
[0072] For example, the occupied grid after threshold filtering and its corresponding semantic label is the voxel shell—only a layer of voxels carrying semantic information is retained near the geometric surface, while the space inside and far away is empty.
[0073] Step S400: Perform GPU parallel JFA-SDF computation.
[0074] In one implementation, such as Figure 4 As shown, the following sub-steps are performed on the GPU: S401 seed initialization.
[0075] For example, for each voxel (x,y,z) in the occupied grid, if it is occupied, the distance is set to 0 and the seed coordinate is set to (x,y,z); if it is empty, the distance is set to FLT_MAX (the maximum floating-point number) and the seed coordinate is set to (-1,-1,-1).
[0076] S402JFA propagation.
[0077] For example, starting with a step size of step = max(NX, NY, NZ) / 2, in each round of propagation, each voxel checks its 26 neighbors with a step size of step (i.e., neighbors with coordinate offsets of (-step ~ +step, -step ~ +step, -step ~ +step)). If a neighbor's seed produces a shorter distance, the seed and distance value of the current voxel are updated. The step size is halved in each round: step = step / 2, until step = 1.
[0078] S403 additional fine propagation.
[0079] For example, perform an additional round of propagation with step=1 to ensure the convergence of JFA; S404 symbol assignment.
[0080] For example, the final SDF value for each voxel is calculated: if the voxel is occupied in the occupied grid, then SDF = -distance (negative value indicates inside); if it is empty, then SDF = +distance (positive value indicates outside).
[0081] Step S500: Automatic merging of multiple components and generation of semantic annotations.
[0082] In one execution method, such as Figure 5 As shown, for a 3D scene containing multiple mesh components: S501 performs steps S200-S400 on the first mesh component to generate an initial voxel mesh and a semantic label mesh, and records the mesh origin and dimensions (NX, NY, NZ).
[0083] For each subsequent mesh component, steps S200-S400 are performed in the same way to obtain the voxel mesh and semantic labels of that component.
[0084] S53 calculates the coordinate relationship between the new mesh component and the occupied mesh: Calculate the position offset of the voxel mesh of the new mesh component in the world coordinate system; Transform the voxel coordinates of the new mesh component to the coordinate system of the occupying mesh; If the voxels of the new mesh component exceed the occupied mesh area, calculate the direction and size of the expansion required.
[0085] S504 Dynamic Expanding Mesh.
[0086] For example, a new extended mesh is created, the occupied mesh data is copied to the corresponding position in the new mesh, and the occupied voxels of the new mesh components are written to the new mesh.
[0087] For example, the merging rules are as follows: Occupied grids are merged: voxels that are not occupied in any grid remain occupied after merging; the minimum SDF value is taken to retain the distance value closer to the surface; semantic labels are merged according to priority: for voxels in overlapping areas of multiple parts, semantic attribution is determined based on part priority; priority rules are configurable, for example, by part category priority (structural parts take precedence over decorative parts) or by the nearest distance principle (taking the part label with the smallest absolute SDF value). S505 semantic annotation aggregation.
[0088] For example, the merged semantic label grid provides a unique part identifier for each occupied voxel, and downstream path planning algorithms (such as the BRAP algorithm) can be implemented based on semantic labels: Differentiated safety clearances should be set according to component category; Adjust path cost weights based on component attributes; Impose additional path constraints on obstacles of a specific semantic category.
[0089] Step S600: Multi-GPU three-level parallel scheduling.
[0090] In one implementation, such as Figure 6 As shown, in the process of performing semantic annotation on each voxel to obtain the semantic voxel shell, a three-level parallel strategy is adopted to distribute the voxelization task to multiple GPUs for parallel processing: S601 Level 1 L1 Scenario-level Parallelism.
[0091] For example, the system detects a list of available GPU devices and assigns different 3D scenes to different GPUs for parallel processing.
[0092] For example, a round-robin scheduling method is used: gpu_id=scene_index%num_gpus.
[0093] S602 Level 2 L2 partitioning parallelism.
[0094] For example, for a single 3D scene, the static obstacle partitions and contact surface partitions are assigned to different GPUs for parallel processing.
[0095] For example, after the two partitions are voxelized independently, the results are saved separately.
[0096] S603 third-level L3 spatial parallelism.
[0097] For example, for very large meshes (when single GPU memory is insufficient), the 3D mesh is divided into sub-blocks along the maximum dimension, and each sub-block is assigned to a different GPU for independent processing.
[0098] For example, overlapping areas (padding) need to be maintained between sub-blocks to ensure the correctness of SDF calculation at the boundaries, and finally the sub-block results are combined.
[0099] For example, semantic tags are merged synchronously when sub-blocks are combined.
[0100] Step S700: Output the semantic voxel shell results.
[0101] In one implementation, the GPU computation results are returned to the orchestration layer via a zero-copy bridging layer, and the output file is saved in NPZ format, including: voxels is a uint8 type occupied grid array with shape (NX, NY, NZ); sdf is a signed range field array of type float32 with shape (NX,NY,NZ); semantic_labels is an array of semantic labels of type int32 with shape (NX, NY, NZ), and the value of each voxel is the part ID to which it belongs; `origin` is the world coordinate origin of a float32 type grid with a shape of (3,). voxel_size is a scalar of voxel side length of type float64; This semantic voxel shell data structure provides downstream path planning algorithms with comprehensive information on occupancy status, distance guidance, and semantic annotation in three-dimensional space.
[0102] Example 3, based on the same inventive concept, such as Figure 7 As shown, this invention discloses a GPU-parallel semantic voxel shell generation system for industrial digital design technology, which has a three-layer architecture.
[0103] In one implementation, the first layer of the system is the CUDA core computing layer, which runs entirely on the GPU.
[0104] For example, the CUDA core computing layer includes a BVH building block for implementing SAH BVH tree construction based on three-dimensional spatial coordinate interleaving encoding.
[0105] For example, the CUDA core computing layer includes a UDF computing module for implementing parallel point-to-grid distance queries based on BVH acceleration. For example, the CUDA core computing layer includes a threshold filtering module for implementing GPU-parallel threshold filtering and occupancy grid generation. For example, the CUDA core computing layer includes a semantic annotation module for implementing GPU-parallel semantic label generation and multi-component semantic merging. For example, the CUDA core computing layer includes an SDF computing module for implementing JFA-based parallel signed range field computation. For example, the CUDA core compute layer includes a multi-component merging module for parallel merging of GPUs occupying multiple components on the same grid. In one implementation, the second layer of the system is a bridging layer responsible for zero-copy data transfer between C++ and Python, and is used to encapsulate the interface.
[0106] For example, the interface includes voxelize_mesh() as a single-mesh voxelization interface (with semantic annotations).
[0107] For example, the interface includes compute_sdf() as an interface for computed SDF from the occupied grid.
[0108] For example, the interface includes query_distances() as a BVH distance query interface (for accuracy verification).
[0109] For example, the interfaces include get_device_count() / get_device_properties() as GPU device information query interfaces.
[0110] In one implementation, the third layer of the system is the orchestration layer, which is responsible for file I / O, process scheduling, and service interfaces.
[0111] For example, the orchestration layer includes a CLI entry module for parsing command-line arguments and supports CPU / GPU mode switching. For example, the orchestration layer includes a GPU orchestration module for implementing multi-GPU scheduling logic and multi-component semantic merging processes. For example, the orchestration layer includes a CPU orchestration module for implementing an OpenVDB-based CPU voxelization process (rollback scheme). For example, the orchestration layer includes a web service module for providing a visual interface and API interfaces.
[0112] Example 5: Taking large-scale scene voxelization as an example.
[0113] In one implementation, the preprocessing of a large 3D scene is taken as an example.
[0114] For example, the input includes 10 STL files containing approximately 5 million triangles, covering different categories of obstacles and structures.
[0115] For example, the parameters are set to voxel_size=3.0mm, threshold=1.5mm, and pad_voxels=5.
[0116] For example, the processing includes: sequentially loading 10 STL files, each assigned a unique PartID and part category label. For each file, BVH construction (average 50-200ms / part), UDF calculation (average 1-3s / part), threshold filtering, and semantic annotation (<1s / part) are performed. After processing each part, multi-part merging and semantic annotation aggregation are performed, dynamically expanding the mesh. The final mesh size is approximately 800×600×400 = 192 million voxels. JFA-SDF calculation is performed on the merged occupancy mesh, taking approximately 5-10 seconds. Semantic voxel shell data is output, including the occupancy mesh, SDF, and semantic label mesh. Performance comparisons are shown in Table 1.
[0117] Table 1
[0118] For example, accuracy verification: the difference between the occupied grid of the GPU solution and the CPU solution is less than 2%, the near-surface SDF error is less than 1 voxel, and the semantic annotation is completely consistent with the input part classification.
[0119] For example, semantic annotation application: the downstream BRAP path planning algorithm uses a semantic label grid to set differentiated safety distances and path weights for different types of obstacles, which significantly improves path quality compared to voxelization schemes without semantic information.
[0120] Example 6: Application of semantic annotation in path planning.
[0121] In one implementation method, such as Figure 8 As shown, the semantic tag mesh of the semantic voxel shell is specifically applied in the BRAP path planning algorithm: (1) Differentiated safety distance. The BRAP algorithm queries the corresponding safety distance parameters based on the semantic labels of voxels. Different minimum avoidance distances are set for different types of obstacles to avoid using a uniform minimum distance that would lead to an overly conservative or unsafe path.
[0122] (2) Differentiated path cost. During the path search process, the BRAP algorithm calculates the path cost based on the semantic labels and SDF values of voxels. Different cost weights are assigned to neighboring regions of different semantic categories, guiding the path search to tend to stay away from high-cost regions.
[0123] (3) Semantic constraint path planning. The BRAP algorithm supports path constraints based on semantic labels, such as requiring the path to pass through regions of a specific semantic category, or requiring the path to avoid regions of a specific semantic category.
[0124] (4) Semantic-aware path optimization. In the post-processing stage of the path, the BRAP algorithm uses semantic labels to perform semantic-aware smoothing and optimization of the path, ensuring that the path transitions smoothly in different semantic regions and meets the constraints of each region.
[0125] In summary, this invention constructs a BVH accelerated structure on a GPU based on three-dimensional spatial coordinate interleaving encoding; it computes the unsigned distance field (UDF) through parallel BVH traversal on the GPU and applies a threshold to filter and generate voxel shells; it simultaneously generates part-level semantic labels for each occupied voxel, forming a semantic label mesh; it employs the Jump Flooding Algorithm (JFA) to compute the signed distance field (SDF) in parallel on the GPU; and it supports automatic merging of multi-part voxels and semantic label aggregation, as well as three-level parallel scheduling across multiple GPUs. The semantic voxel shells generated by this invention simultaneously contain occupancy status, distance information, and semantic labels, providing a semantically rich three-dimensional spatial representation for the downstream BRAP path planning algorithm, enabling path planning to formulate differentiated strategies based on the semantic attributes of obstacles.
[0126] This application also provides a smart terminal, including a memory and a processor. The memory stores a wire harness 3D path design program. When the wire harness 3D path design program is executed by the processor, it implements the steps of a GPU-based parallel semantic voxel shell generation method in any of the above embodiments.
[0127] This application embodiment also provides a storage medium storing a wire harness 3D path design program. When the wire harness 3D path design program is executed by a processor, it implements the steps of a GPU-based parallel semantic voxel shell generation method in any of the above embodiments.
[0128] In the embodiments of the smart terminal and storage medium provided in this application, all the technical features of any of the above-mentioned embodiments of the GPU-based parallel semantic voxel shell generation method may be included. The extended and explanatory content of the specification is basically the same as that of the embodiments of the above method, and will not be repeated here.
[0129] This application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to perform the methods described in the various possible implementations above.
[0130] This application also provides a chip, including a memory and a processor. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device with the chip installed performs the methods described in the various possible implementations above.
[0131] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0132] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for generating semantic voxel shells based on GPU parallelism, characterized in that, Includes the following steps: The GPU is used to perform parallel computing to encode the axis-aligned bounding box and the three-dimensional spatial coordinates of the center point of each triangle on the three-dimensional triangular mesh model to construct a hierarchical bounding box tree, wherein the three-dimensional triangular mesh model contains multiple independent mesh components; By traversing the hierarchical bounding box tree, occupied voxels are obtained, forming voxel shells; Based on the voxel shell, the signed distance field is calculated on the GPU using the occupancy grid corresponding to the occupancy voxel. For multiple independent mesh components, based on the signed distance field, new meshes exceeding the occupied mesh range are merged with the occupied meshes, and semantic annotation is performed on each voxel to obtain a semantic voxel shell.
2. The method for generating semantic voxel shells based on GPU parallelism according to claim 1, characterized in that: When constructing the hierarchical bounding box tree, the triangles are sorted by interleaving the three-dimensional spatial coordinates using a GPU parallel sorting algorithm, and then the hierarchical bounding box tree is constructed from bottom to top.
3. The method for generating semantic voxel shells based on GPU parallelism according to claim 1, characterized in that: When traversing the hierarchical bounding box tree, a stack-based iterative method is used to traverse the hierarchical bounding box tree.
4. The method for generating semantic voxel shells based on GPU parallelism according to claim 1, characterized in that: When acquiring occupied voxels, the nearest distance from the voxel center to the triangular mesh is queried by traversing the hierarchical bounding box tree to obtain the unsigned distance field. Voxels with unsigned distance values less than or equal to a preset threshold are marked as occupied voxels.
5. The method for generating semantic voxel shells based on GPU parallelism according to claim 1, characterized in that: When calculating the signed distance field, the Jump Flooding Algorithm is used on the GPU. The propagation process of the Jump Flooding Algorithm is as follows: starting from a step size equal to half the maximum dimension of the grid, each round checks the neighbors within the step size in the 26-neighborhood, takes the seed with the best distance and updates it, the step size is halved in each round until it reaches 1, and an additional round of fine propagation with a step size of 1 is performed.
6. The method for generating semantic voxel shells based on GPU parallelism according to claim 1, characterized in that: During the merging process, the global origin offset and mesh size change between the new component and the existing mesh are calculated. If the new component exceeds the current mesh range, the mesh is dynamically expanded. During merging, the occupied mesh is merged, the signed distance field is minimized, and the semantic labels are merged according to preset priority rules.
7. A method for generating semantic voxel shells based on GPU parallelism according to any one of claims 1-6, characterized in that: During semantic annotation, the identifier of the component to which each voxel belongs is recorded to form a semantic label grid of the same size as the occupied grid, thereby forming a semantic voxel shell. The semantic voxel shell includes the occupied grid, the signed distance field, and the semantic label grid, which are used by the downstream path planning algorithm for the BRAP path planning algorithm.
8. The method for generating semantic voxel shells based on GPU parallelism according to claim 7, characterized in that: In the process of performing semantic annotation on each voxel to obtain the semantic voxel shell, a three-level parallel strategy is adopted to distribute the voxelization task to multiple GPUs for parallel processing, including: The first level is scene-level parallelism, which is used to allocate different 3D scenes to different GPUs for parallel processing. The second level is partition-level parallelism, which is used to allocate different partitions in a single scene to different GPUs for parallel processing. The third level is spatial parallelism, which is used for ultra-large grids to divide the grid space into sub-blocks and distribute them to multiple GPUs for parallel processing.
9. A smart terminal, characterized in that, The smart terminal includes a processor and a memory; The memory stores a computer program that, when executed by the processor, implements the steps of a GPU-based parallel semantic voxel shell generation method as described in any one of claims 1-8.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of a GPU-based parallel semantic voxel shell generation method as described in any one of claims 1-8.
Citation Information
Patent Citations
Conservative collision detection method for industrial robot path planning
CN114742944A
Disaster scene reconstruction method based on multi-source information fusion and scene dynamic update
CN122066865A