Voxelization processing method and system for three-dimensional model
By hierarchically dividing the bounding box and using the inside-outside judgment method to construct voxel information, the problems of low efficiency and insufficient precision in the voxelization processing of three-dimensional models are solved, and efficient and accurate voxelization processing is achieved, which is suitable for large-scale complex structures.
Patent Information
- Application Number
- CN202510580679.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-05-07
AI Technical Summary
Existing technologies are unable to efficiently and accurately voxelize three-dimensional models, especially large-scale complex structures. There are problems such as low efficiency of spatial segmentation algorithms, low segmentation accuracy, high memory consumption and data redundancy.
A hierarchical bounding box division and inside-outside judgment method are used to determine the sub-bounding boxes that intersect with the 3D model, the sub-bounding boxes inside the 3D model, and the sub-bounding boxes outside the 3D model, respectively. Voxel information is constructed, and the complex structure is represented by the signed distance field to generate the target voxel information.
It achieves efficient and accurate voxelization of 3D models, reduces data redundancy, improves processing efficiency and accuracy, and is suitable for voxelization of 3D models of large-scale complex structures.
Smart Images

Figure CN120689545A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional modeling, and in particular to a voxel processing method and system for a three-dimensional model. Background Art
[0002] With the rapid development of industrial technology, the requirements for workpiece structures are becoming increasingly stringent. For example, workpiece structures must meet application requirements such as high strength, high specific stiffness, high specific surface area, high temperature resistance, and high heat exchange rates. Currently, complex workpiece structures are typically manufactured using additive manufacturing methods. However, methods that represent workpiece structures using related models (for example, models that fit surfaces using triangular facets) struggle to meet the accuracy requirements of model applications and also pose challenges to model processing and additive manufacturing.
[0003] As a representation of 3D models, the voxel format divides the model space into a uniform array of cubes, with each cube corresponding to a voxel's data, including its position, size, and attributes. The voxel format is easy to process, parallel-friendly, and widely compatible. Furthermore, slicing based on voxel data can generate slice files for additive manufacturing, enabling rapid part fabrication.
[0004] In related technologies, voxelization is usually performed based on model coordinate points. This method is mainly used for three-dimensional scene reconstruction and rendering, so sparse voxel structures are usually used to represent large-scale scenes. However, this type of sparse voxel structure has low efficiency and low segmentation accuracy in the spatial segmentation algorithm when representing large-scale complex structures. In addition, there are also problems such as complex processing calculations and high memory consumption. At the same time, since the complex structure of the sparse voxel structure has many pores inside, these pores do not need to store detailed attribute information, resulting in a large amount of sparse voxel data and data redundancy. This makes it impossible to voxelize the three-dimensional model efficiently and accurately. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that it is impossible to perform voxel processing on a three-dimensional model efficiently and accurately.
[0006] To solve the above technical problems, the present invention provides a voxelization processing method and system for a three-dimensional model, which specifically adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a voxelization method for a three-dimensional model, the method comprising: first, extracting first bounding box information and facet information of a first model, wherein the first model is a mesh model composed of multiple polygonal facets, and the facet information is used to characterize the structure and properties of the polygonal facets. Then, the target bounding box corresponding to the first bounding box information is divided into blocks according to a first preset resolution to obtain multiple primary sub-bounding boxes, each of which corresponds to second bounding box information. Next, based on the facet information and the second bounding box information, the multiple primary sub-bounding boxes are respectively subjected to intersection detection with the surface of the first model to determine a first sub-bounding box and a second sub-bounding box; the first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is a primary sub-bounding box that does not intersect with the surface of the first model. Secondly, based on the second bounding box information corresponding to the second sub-bounding box, the second sub-bounding box is subjected to inner cavity detection to determine a third sub-bounding box and a fourth sub-bounding box; the third sub-bounding box is a second sub-bounding box located inside the first model, and the fourth sub-bounding box is a second sub-bounding box located outside the first model. Then, based on the second bounding box information corresponding to the first and third sub-bounding boxes, as well as the patch information, voxelization is performed on the first and third sub-bounding boxes to determine first voxel information. Second voxel information corresponding to the fourth sub-bounding box is also determined based on the preset voxel information. Finally, the first voxel information and the second voxel information are integrated to generate target voxel information, which includes a signed distance field.
[0008] This method has the beneficial effects of lightweight target voxel information data, high efficiency and high precision. Specifically, the method simplifies the blank area (i.e., the area corresponding to the fourth sub-bounding box), and the target voxel information can be processed in a compressed binary format, which reduces data redundancy and realizes the lightweight of the target voxel information. Moreover, for large-scale complex structures, the complex structure represented by the signed distance field can avoid grid description, and high-precision voxel data can be used to achieve higher-precision model expression with a smaller amount of data. Combining the signed distance value representation model with the hierarchical voxelization method avoids the problem that the traditional voxel format is difficult to describe complex geometric structures. The hierarchical voxel method adopted effectively realizes data lightweighting while solving the problems of complex calculation, low precision and low processing efficiency of sparse voxel structures. In this way, the accuracy and efficiency of voxelization of three-dimensional models can be effectively improved.
[0009] In combination with the first aspect, in an optional implementation method, the above-mentioned multiple primary sub-bounding boxes are respectively subjected to intersection detection with the surface of the first model based on the patch information and the second bounding box information, including: intersection detection of the coordinate axis of the primary sub-bounding box and the polygonal patch in the first model, intersection detection of the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box, and cross product axis intersection detection of the axis direction of the primary sub-bounding box and the edge direction of the polygonal patch.
[0010] In this implementation, the intersection detection can accurately determine whether the primary sub-bounding box intersects with the surface of the first model, and further accurately determine the first sub-bounding box and the second sub-bounding box.
[0011] In conjunction with the first aspect, in an optional implementation, the polygonal patch is a triangular patch. The coordinate axes of the primary sub-bounding box and the polygonal patch in the first model are determined to intersect when the coordinate axes of the primary sub-bounding box and the polygonal patch in the first model satisfy the following expression:
[0012]
[0013] in, Represents the primary sub-bounding box B i The minimum coordinate value on the x-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the x-axis, Represents the primary sub-bounding box B i The minimum coordinate value on the y-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the y-axis, Represents the primary sub-bounding box B i The minimum coordinate value on the z-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the z-axis; Represents the projection of the three edges of the polygonal patch on the x-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the x-axis of the primary sub-bounding box The maximum value in ; Represents the projection of the three edges of the polygonal patch on the y-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the y-axis of the primary sub-bounding box The maximum value in ; Represents the projection of the three edges of the polygonal patch on the z-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the z-axis of the primary sub-bounding box The maximum value in .
[0014] In conjunction with the first aspect, in an optional implementation, the intersection of the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box is determined when the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box satisfy the following expression:
[0015] n j b i,min ≤n j ·v j1 , or, n j b i,max ≥n j ·v j1 ;
[0016] Among them, n j Represents a polygonal patch f j Normal vector axis, b i,min Indicates the minimum coordinate value of the primary sub-bounding box on the three coordinate axes, b i,max Indicates the maximum coordinate value of the primary sub-bounding box on the three coordinate axes, v j1 Indicates the vertex coordinates of the polygonal patch; when i=1, it corresponds to the x-axis, when i=2, it corresponds to the y-axis, and when i=3, it corresponds to the z-axis.
[0017] In conjunction with the first aspect, in an optional implementation, the above-mentioned inner cavity detection of the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box to determine the third sub-bounding box and the fourth sub-bounding box includes: first, based on the second bounding box information corresponding to the second sub-bounding box, determining the same-layer sub-bounding box that is on the same layer as the second sub-bounding box. Then, based on the center point of the second sub-bounding box and the center point of the same-layer sub-bounding box, construct a two-dimensional convex polygon using a monotone chain algorithm. Finally, determine whether the center point of the second sub-bounding box is within the two-dimensional convex polygon, determine the second sub-bounding box whose center point is within the two-dimensional convex polygon as the third sub-bounding box, and determine the second sub-bounding box whose center point is outside the two-dimensional convex polygon as the fourth sub-bounding box.
[0018] In this implementation, a two-dimensional convex polygon is first constructed, and then the third and fourth sub-bounding boxes can be effectively and accurately distinguished by determining whether the center point of the second sub-bounding box is within the two-dimensional convex polygon.
[0019] In combination with the first aspect, in an optional implementation, the above-mentioned construction of a two-dimensional convex polygon based on the center point of the second sub-bounding box and the center point of the sub-bounding box on the same layer by a monotone chain algorithm includes: first, sorting the center point of the second sub-bounding box and the center point of the sub-bounding box on the same layer in ascending order of x-axis coordinate values, and when the x-axis coordinate values are the same, sorting them in ascending order of y-axis coordinate values to obtain a sorted set of center points. Then, in order of x-axis coordinate values from small to large, the center points in the sorted center point set that satisfy a cross product value greater than 0 are determined to construct a lower semi-convex hull. Secondly, in order of x-axis coordinate values from large to small, the center points in the sorted center point set that satisfy a cross product value greater than 0 are determined to construct an upper semi-convex hull. Finally, the lower semi-convex hull and the upper semi-convex hull are merged to obtain a two-dimensional convex polygon.
[0020] In conjunction with the first aspect, in an optional implementation, the voxelization of the first and third sub-bounding boxes based on the second bounding box information corresponding to the first and third sub-bounding boxes, as well as the patch information, to determine the first voxel information specifically includes: first, sampling the first and third sub-bounding boxes according to a second preset resolution to obtain a plurality of first sampling points. Then, based on the patch information, collision detection is performed on each of the plurality of first sampling points with the surface of the first model to determine an unsigned distance field corresponding to the first sampling point. The unsigned distance field is used to represent the shortest distance from the first sampling point to the surface of the first model. Next, inside-outside detection is performed on each of the plurality of first sampling points with the surface of the first model based on the patch information to determine a sign corresponding to the first sampling point. The sign is used to represent the inside-outside relationship between the first sampling point and the surface of the first model. Finally, a signed distance field is obtained based on the unsigned distance field and the sign determination.
[0021] In conjunction with the first aspect, in an optional implementation, performing internal and external detection on the surface of the first model for each of the plurality of first sampling points based on the patch information includes performing internal and external detection on the surface of the first model for each of the plurality of first sampling points using a normal vector consistency check method. The expression for the symbol corresponding to the first sampling point is:
[0022] sign(φ(P))=sign((PQ * )·n * );
[0023] Among them, sign(φ(P)) represents the sign corresponding to the first sampling point P, sign(·) represents the sign function, φ(P) represents the signed distance function from the first sampling point P to the surface of the first model, Q * Represents the closest projection point of the first sampling point P to the surface of the first model, n * Represents the normal vector from the first sampling point P to the nearest polygonal patch of the first model.
[0024] In combination with the first aspect, in an optional implementation, the above-mentioned integration of the first voxel information and the second voxel information to generate target voxel information includes: merging the first voxel information and the second voxel information, converting them into binary data format, and obtaining the target voxel information.
[0025] In this implementation, by generating target voxel information in binary data format, the target voxel information can be made more compact and lightweight, and the target voxel information can be read, written and processed conveniently and efficiently.
[0026] In a second aspect, the present invention provides a voxelization processing system for a three-dimensional model, which includes: an extraction module, a segmentation module, an intersection detection module, an inner cavity detection module and a voxelization module. Among them, the extraction module can be used to extract the first bounding box information and the patch information of the first model, the first model is a mesh model composed of multiple polygonal patches, and the patch information is used to characterize the structure and properties of the polygonal patches. The segmentation module can be used to block the target bounding box corresponding to the first bounding box information according to the first preset resolution to obtain multiple primary sub-bounding boxes, and the primary sub-bounding boxes correspond to the second bounding box information. The intersection detection module can be used to perform intersection detection on the surface of the first model based on the patch information and the second bounding box information, and determine the first sub-bounding box and the second sub-bounding box; the first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is a primary sub-bounding box that does not intersect with the surface of the first model. The inner cavity detection module can be used to perform inner cavity detection on the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box, and determine the third sub-bounding box and the fourth sub-bounding box; the third sub-bounding box is the second sub-bounding box located inside the first model, and the fourth sub-bounding box is the second sub-bounding box located outside the first model. The voxelization module can be used to perform voxelization processing on the first sub-bounding box and the third sub-bounding box based on the second bounding box information corresponding to the first sub-bounding box and the third sub-bounding box, as well as the patch information, to determine the first voxel information, and determine the second voxel information corresponding to the fourth sub-bounding box based on the preset voxel information. The voxelization module can be used to integrate the first voxel information with the second voxel information to generate target voxel information, and the target voxel information includes a signed distance field.
[0027] In a third aspect, the present invention provides an electronic device comprising: a memory, one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method provided by the above-mentioned first aspect and any optional implementation thereof.
[0028] In a fourth aspect, the present invention provides a computer-readable storage medium comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method provided in the first aspect and any optional implementation thereof.
[0029] It can be understood that the beneficial effects that can be achieved by the voxel processing system for three-dimensional models provided by the second aspect, the electronic device of the third aspect, and the computer-readable storage medium of the fourth aspect can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a flow chart of a voxelization method for a three-dimensional model provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a second sub-bounding box provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the process of constructing a lower semi-convex hull shape provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of performing inner cavity detection on the second sub-bounding box provided in an embodiment of the present application;
[0034] Figure 5 A schematic flow chart of a method for determining first voxel information provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of the structure of a voxel processing system for a three-dimensional model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following embodiments are described in detail, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numbers in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following embodiments are not intended to represent all possible implementations consistent with the present application. They are merely examples of systems and methods consistent with certain aspects of the present application, as detailed in the claims.
[0037] With the rapid development of industrial technology, the requirements for workpiece structures are becoming higher and higher. For example, the workpiece structure needs to meet the following application requirements: high strength, high specific stiffness, high specific surface area, high temperature resistance, high heat exchange rate, etc. In this way, the workpiece structure is becoming more and more complex. Complex workpiece structures can be represented by three-dimensional modeling through lattice structures, honeycomb structures, three-periodic minimal surface structures, etc. In order to meet the above application requirements, these structures often have characteristics such as complex curved surfaces and small features. At present, complex workpiece structures are usually manufactured by additive manufacturing methods. However, the method of representing the workpiece structure by a model of a surface fitted with triangular facets is difficult to meet the accuracy requirements of the model application, and also creates difficulties for model processing and additive manufacturing.
[0038] As a representation of 3D models, the voxel format divides the model space into a uniform array of cubes, with each cube corresponding to a voxel's data, including position, size, and attributes. The resolution of the cube array determines the accuracy of the 3D model. The voxel format is easy to process, parallel-friendly, and widely compatible. Furthermore, slicing based on voxel data can generate slice files for additive manufacturing, enabling rapid part fabrication.
[0039] In related technologies, voxelization is usually performed based on model coordinate points. This method is mainly used for three-dimensional scene reconstruction and rendering, so sparse voxel structures are usually used to represent large-scale scenes. However, this type of sparse voxel structure has low efficiency and low segmentation accuracy in the spatial segmentation algorithm when representing large-scale complex structures. In addition, there are also problems such as complex processing calculations and high memory consumption. At the same time, since the complex structure of the sparse voxel structure has many pores inside, these pores do not need to store detailed attribute information, resulting in a large amount of sparse voxel data and data redundancy. This makes it impossible to voxelize the three-dimensional model efficiently and accurately.
[0040] In order to solve the above problems, an embodiment of the present application provides a voxelization method and system for a three-dimensional model, which can be applied to the voxelization processing of three-dimensional models of large-scale (large data volume) complex structures. Specifically, the method can be based on the hierarchical division of bounding boxes and the internal and external judgment method for the three-dimensional model to determine the sub-bounding box (hereinafter referred to as sub-bounding box A) that intersects with the three-dimensional model, the sub-bounding box inside the three-dimensional model (hereinafter referred to as sub-bounding box B), and the sub-bounding box outside the three-dimensional model (hereinafter referred to as sub-bounding box C). Then, voxel information is constructed for the internal structure (i.e., sub-bounding box A and sub-bounding box B) and the external structure (i.e., sub-bounding box C) of the three-dimensional model respectively. Finally, the overall voxel data is generated by coupling the two voxel information inside and outside. In this way, efficient and accurate voxelization of the three-dimensional model can be achieved.
[0041] The following describes the solution provided by the embodiments of the present application in conjunction with the accompanying drawings.
[0042] Specifically, Figure 1 A flow chart of a voxelization method for a three-dimensional model provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the voxelization processing method of the three-dimensional model provided in the embodiment of the present application includes the following steps S101-S106:
[0043] S101: Extract bounding box information and facet information of a first model.
[0044] In the embodiment of the present application, the first model is a pre-acquired model used to construct a three-dimensional model of a lattice structure. Specifically, the first model is a mesh model composed of multiple polygonal patches. For example, the polygonal patches can be triangular patches, quadrilateral patches, pentagonal patches, etc. The first model can be a model in a mesh format such as stereolithography (STL) or OBJ.
[0045] To construct a lattice-structured 3D model corresponding to the first model, we first need to extract the bounding box information and facet information of the first model. The bounding box information can be used to represent a simplified geometric object (such as a cube or cuboid) that encloses the first model, i.e., a bounding box. This bounding box can represent the approximate spatial extent of the first model. For example, the bounding box can be an axis-aligned bounding box (AABB).
[0046] The patch information can be used to characterize the structure and properties of the polygon patch. For example, the patch information can include: patch vertex coordinate information and surface normal information.
[0047] In some embodiments, the vertex information, facet vertex coordinate information, and surface normal information of the first model can be extracted by parsing the mesh file of the first model. For example, taking the first model in STL or OBJ mesh format as an example, the vertex information and facet vertex coordinate information of the first model are typically stored in the mesh file of the first model and can be read. The surface normal information can be determined by performing a cross product calculation on the facet vertex coordinate information.
[0048] Furthermore, by traversing the vertex information of the first model, the maximum and minimum values in the vertex information are determined, and then the maximum coordinate max[3] and minimum coordinate min[3] of the bounding box (hereinafter referred to as the target bounding box) can be determined, that is, the bounding box information is obtained.
[0049] S102 : Divide the target bounding box corresponding to the first bounding box information into blocks according to a first preset resolution to obtain a plurality of primary sub-bounding boxes.
[0050] Specifically, the corresponding target bounding box can be determined based on the first bounding box information. Then, the first preset resolution R p [r1, r2, r3] performs primary fast processing on the target bounding box to obtain multiple primary sub-bounding boxes, which are used for intersection detection based on the primary sub-bounding boxes and facilitate subsequent voxel processing of different regions.
[0051] The primary sub-bounding box corresponds to the second bounding box information, and the second bounding box information can be used to represent the structural information of the primary sub-bounding box. For example, the second bounding box information may include vertex information, center point information, etc. of the primary sub-bounding box.
[0052] The above-mentioned first preset resolution can be preset according to the size of the target bounding box and actual application requirements, and this application does not make any specific limitations on this.
[0053] S103 : Based on the facet information and the second bounding box information, perform intersection detection on the plurality of primary sub-bounding boxes and the surface of the first model respectively to determine a first sub-bounding box and a second sub-bounding box.
[0054] Furthermore, collision detection is performed on each of the multiple primary sub-bounding boxes obtained by the block division in S102 with the surface of the first model, i.e., intersection detection is performed to obtain a first sub-bounding box and a second sub-bounding box. The first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is a primary sub-bounding box that does not intersect with the surface of the first model.
[0055] In one implementation, when the primary sub-bounding box intersects with at least one polygonal facet constituting the first model, it can be determined that the primary sub-bounding box intersects with the surface of the first model respectively.
[0056] In some embodiments, the primary sub-bounding box and the surface of the first model can be tested for intersection based on the Separating Axis Theorem (SAT). That is, if there exists an axis such that the projection intervals of the primary sub-bounding box and the polygonal patch do not overlap, then there is no intersection. Specifically, the following axes need to be tested: the three coordinate axes of the primary sub-bounding box, the normal axis of the polygonal patch, and the cross product axis of the primary sub-bounding box's axis direction and the polygonal patch's edge direction.
[0057] Specifically, in S103, based on the face information and the second bounding box information, intersection detection is performed on the plurality of primary sub-bounding boxes and the surface of the first model respectively, which may specifically include:
[0058] Intersection detection of the coordinate axis of the primary sub-bounding box and the polygonal patch in the first model, intersection detection of the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box, and cross product axis intersection detection of the axis direction of the primary sub-bounding box and the edge direction of the polygonal patch.
[0059] In some embodiments, taking the polygonal patch as a triangular patch as an example, when the coordinate axes of the primary sub-bounding box and the polygonal patch in the first model satisfy the following expression, it is determined that the coordinate axes of the primary sub-bounding box intersect the polygonal patch in the first model:
[0060]
[0061] in, Represents the primary sub-bounding box B i The minimum coordinate value on the x-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the x-axis, Represents the primary sub-bounding box B i The minimum coordinate value on the y-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the y-axis, Represents the primary sub-bounding box B i The minimum coordinate value on the z-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the z-axis; Represents the projection of the three edges of the polygonal patch on the x-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the x-axis of the primary sub-bounding box The maximum value in ; Represents the projection of the three edges of the polygonal patch on the y-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the y-axis of the primary sub-bounding box The maximum value in ; Represents the projection of the three edges of the polygonal patch on the z-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the z-axis of the primary sub-bounding box The maximum value in .
[0062] In some embodiments, the intersection of the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box is determined when the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box satisfy the following expression:
[0063] nj b i,min ≤n j ·v j1 , or, n j b i,max ≥n j ·v j1 ;
[0064] Among them, n j Represents a polygonal patch f j Normal vector axis, b i,min Indicates the minimum coordinate value of the primary sub-bounding box on the three coordinate axes, b i,max Indicates the maximum coordinate value of the primary sub-bounding box on the three coordinate axes, v j1 Indicates the vertex coordinates of the polygonal patch; when i=1, it corresponds to the x-axis, when i=2, it corresponds to the y-axis, and when i=3, it corresponds to the z-axis.
[0065] In some embodiments, the cross product axis intersection detection of the axis direction of the primary sub-bounding box and the edge direction of the polygonal patch specifically includes: first, calculating the cross product of the axis direction of the primary sub-bounding box and the edge direction of the polygonal patch to obtain a new separating axis. Then, based on the new separating axis, testing whether the projection interval overlaps. If no separation is found on all separating axes obtained by the cross product, it is determined that the primary sub-bounding box intersects with the surface of the first model.
[0066] For example, taking the polygonal patch as a triangular patch, the expression for the cross product of the axis direction of the primary sub-bounding box and the edge direction of the polygonal patch is:
[0067] a kl =e Ak ×e Tl ,k,l∈{1,2,3};
[0068] e A1 =(1,0,0),e A2 =(0,1,0),e A3 =(0,0,1);
[0069] e T1 =v j2 -v j1 , e T2 =v j3 -v j2 , e T3 =v j1 -v j3 ;
[0070] Among them, a kl represents the cross product, e Ak Represents the axial edge vector of the primary sub-bounding box, specifically, eA1 Represents the x-axis edge vector of the primary sub-bounding box, e A2 Represents the y-axis edge vector of the primary sub-bounding box, e A3 Represents the z-axis edge vector of the primary sub-bounding box. Tl Represents the edge vector of the triangle patch, specifically, e T1 Represents the first edge vector of the triangle patch, e T2 Represents the second edge vector of the triangle patch, e T3 Represents the third side vector of the triangle patch. v j1 Represents the three-dimensional coordinate vector of the first vertex of the triangle patch, v j2 Represents the three-dimensional coordinate vector of the second vertex of the triangle patch, v j3 A 3D coordinate vector representing the third vertex of the triangle patch.
[0071] S104 : Based on the second bounding box information corresponding to the second sub-bounding box, perform inner cavity detection on the second sub-bounding box to determine a third sub-bounding box and a fourth sub-bounding box.
[0072] Specifically, after the intersection detection in S103, there may be a situation where the cavity inside the first model is mistakenly judged as a blank area (ie, outside the first model). Figure 2 A schematic diagram of the second sub-bounding box provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the second sub-bounding box 201 is inside the first model 200 (inner cavity), and the second sub-bounding box 202, the second sub-bounding box 203, and the second sub-bounding box 204 are in the blank area (i.e., outside the first model 200). Since the blank area is not subjected to the subsequent voxelization process of S105, in the case of misjudgment, the complex structure inside the first model will not have corresponding voxel information. Therefore, it is further necessary to perform inner cavity detection on the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box to distinguish whether the second sub-bounding box that has no intersection detection with the first model surface is in the model inner cavity, that is, to determine the third sub-bounding box and the fourth sub-bounding box, wherein the third sub-bounding box is the second sub-bounding box inside the first model, and the fourth sub-bounding box is the second sub-bounding box outside the first model.
[0073] In some embodiments, S104 may specifically include the following steps S1041-S1043:
[0074] S1041 : Determine a sub-bounding box on the same layer as the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box.
[0075] Specifically, since the inner cavity of the first model is a closed space, the inner cavity area exists within a closed surface, that is, the center point of the second sub-bounding box within the inner cavity of the first model is within a closed image. Therefore, to improve the efficiency of inner cavity detection, in this embodiment of the application, the inner cavity detection can be performed layer by layer on the second sub-bounding box. In other words, the convex hull construction method can be optimized to a convex polygon construction method. In other words, a monotone chain algorithm can be used to construct a two-dimensional convex polygon.
[0076] Therefore, firstly, the second sub-bounding box in the same layer as the second sub-bounding box, ie, the same-layer sub-bounding box, can be determined based on the second bounding box information corresponding to the second sub-bounding box.
[0077] S1042: Construct a two-dimensional convex polygon using a monotone chain algorithm according to the center point of the second sub-bounding box and the center point of the sub-bounding box in the same layer.
[0078] Furthermore, a two-dimensional convex polygon can be constructed based on the center points of the second sub-bounding box and the sub-bounding boxes at the same layer through a monotone chain algorithm to determine whether the second sub-bounding box is in the inner cavity of the first model.
[0079] In some embodiments, S1042 may specifically include the following steps S10421-S10424:
[0080] S10421. Sort the center points of the second sub-bounding box and the center points of the sub-bounding box on the same layer in ascending order of x-axis coordinate values, and in ascending order of y-axis coordinate values when the x-axis coordinate values are the same, to obtain a sorted center point set.
[0081] S10422. According to the order of x-axis coordinate values from small to large, determine the center points after sorting and concentrate the center points whose cross product values are greater than 0, and construct a lower semi-convex hull.
[0082] Specifically, we first construct a stack (or list) and add the first two points in the sorted center point set to the stack, as the top two points. Then, for each subsequent point pi in the sorted center point set, in ascending order of x-axis coordinate value, determine whether the top two points and point pi form a "right turn" condition (i.e., cross product ≤ 0). If so, pop the top of the stack until the "left turn" condition is met (i.e., cross product > 0), and then push point pi onto the stack.
[0083] For example, Figure 3 A schematic diagram of the process of constructing a lower half convex hull provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, after the above construction process, the lower semi-convex hull consisting of point 0, point 2, point 6 and point 7 can be obtained.
[0084] S10423. According to the descending order of the x-axis coordinate values, determine the center points after sorting and concentrate the center points whose cross product values are greater than 0, and construct an upper semi-convex hull.
[0085] Specifically, the specific process of S10423 is similar to that of S10422, but the traversal order during the construction process is different, that is, the order of the x-axis coordinate values from large to small. The specific construction process can be referred to S10422 and will not be repeated here.
[0086] S10424. Merge the lower half convex hull shape and the upper half convex hull shape to obtain a two-dimensional convex polygon.
[0087] Furthermore, the lower semi-convex hull shape and the upper semi-convex hull shape are merged, that is, repeated endpoints (for example, the first and last points corresponding to the lower semi-convex hull shape and the upper semi-convex hull shape, respectively) are removed to obtain a constructed closed two-dimensional convex polygon.
[0088] In some embodiments, the two-dimensional convex polygon in S1042 can also be constructed by Graham scanning method, fast convex hull algorithm, incremental algorithm, etc.
[0089] S1043. Determine whether the center point of the second sub-bounding box is inside the two-dimensional convex polygon, determine the second sub-bounding box whose center point is inside the two-dimensional convex polygon as the third sub-bounding box, and determine the second sub-bounding box whose center point is outside the two-dimensional convex polygon as the fourth sub-bounding box.
[0090] For example, Figure 4 A schematic diagram of performing inner cavity detection on the second sub-bounding box provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the middle point A1 of the second sub-bounding box 401 and the center point A2 of the second sub-bounding box 402 are inside the two-dimensional convex polygon 400, so the second sub-bounding box 401 and the second sub-bounding box 402 can be determined as the third sub-bounding box. The middle point A3 of the second sub-bounding box 403 and the center point A4 of the second sub-bounding box 404 are outside the two-dimensional convex polygon 400, so the second sub-bounding box 403 and the second sub-bounding box 404 can be determined as the fourth sub-bounding box.
[0091] S105 : Based on the second bounding box information corresponding to the first sub-bounding box and the third sub-bounding box, and the patch information, voxelize the first sub-bounding box and the third sub-bounding box to determine first voxel information, and determine second voxel information corresponding to the fourth sub-bounding box according to the preset voxel information.
[0092] Next, voxelization is performed on the first sub-bounding box intersecting the surface of the first model and the third sub-bounding box within the interior of the first model, i.e., a signed distance field is determined to obtain first voxel information. This first voxel information includes the signed distance field. For the fourth sub-bounding box outside the first model, its corresponding second voxel information can be determined as preset voxel information (e.g., voxel constant value), which is different from the first voxel information. This voxel information can be used to distinguish the internal structure of the first model from the external blank area, reduce data redundancy, and improve the lightweightness of the 3D model's voxel information.
[0093] In some embodiments, Figure 5 A flow chart of a method for determining first voxel information provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, determining the first voxel information in S105 may specifically include the following steps S1051-S1054:
[0094] S1051: Sample the first sub-bounding box and the third sub-bounding box according to a second preset resolution to obtain a plurality of first sampling points.
[0095] Specifically, the first sub-bounding box and the third sub-bounding box are sampled based on the second preset resolution, that is, secondary division is implemented to obtain a plurality of first sampling points, so as to determine the signed distance field based on the first sampling points.
[0096] In some embodiments, the second preset resolution can be preset based on actual application requirements, which is not specifically limited in this application. For example, the second preset resolution can correspond to the 3D printing resolution and the rendering resolution, thereby facilitating rapid manufacturing and rendering, thereby improving the applicability and flexibility of the method.
[0097] S1052: Perform collision detection on the plurality of first sampling points and the surface of the first model respectively based on the patch information, and determine an unsigned distance field corresponding to the first sampling points.
[0098] Then, based on the patch information, a collision detection can be performed between the first sampling point determined in S1051 and the surface of the first model to determine the shortest distance from the first sampling point to the surface of the first model. The shortest distance is the unsigned distance field corresponding to the first sampling point. In other words, the unsigned distance field can be used to represent the shortest distance from the first sampling point to the surface of the first model.
[0099] In one implementation, first, the projection distance from the first sampling point P to all polygonal patches constituting the first model is determined. The expression for the projection distance is:
[0100] d j (P)=‖P-proj fi (P)‖;
[0101] Among them, d j (P) represents the projection distance, proj fi (P) is the closest projection point of the first sampling point P on the polygonal patch fi, and the closest projection point is usually located inside or at the edge of the polygonal patch.
[0102] Then, the minimum value (ie, the shortest distance) of the projection distances of all polygonal patches of the first sampling point P is determined as the unsigned distance field of the first sampling point P.
[0103] S1053: Perform internal and external detection on the surface of the first model and the plurality of first sampling points based on the patch information to determine symbols corresponding to the first sampling points.
[0104] The sign can be used to represent the inside-outside relationship between the first sampling point and the surface of the first model. For example, if the sign is positive, it means that the first sampling point is outside the first model. If the sign is negative, it means that the first sampling point is inside the first model. If the first sign is 0, it means that the first sampling point is on the surface of the first model.
[0105] In some embodiments, performing internal and external detection on the surface of the first model and the plurality of first sampling points based on the patch information in S1053 specifically includes:
[0106] The normal vector consistency test method is used to perform internal and external detection on multiple first sampling points and the surface of the first model. The expression of the symbol corresponding to the first sampling point is:
[0107] sign(φ(P))=sign((PQ * )·n * );
[0108] Where, sign(φ(P)) represents the sign corresponding to the first sampling point P, sign(·) represents the sign function, φ(P) represents the signed distance function from the first sampling point P to the surface of the first model, Q * Represents the closest projection point of the first sampling point P to the surface of the first model, n * Represents the normal vector from the first sampling point P to the nearest polygonal patch of the first model.
[0109] S1054: Obtain a signed distance field according to the unsigned distance field and the sign.
[0110] Furthermore, the unsigned distance field determined in S1052 is combined with the symbol determined in S1053 to obtain a signed distance field.
[0111] In some embodiments, the determination of the first voxel information in S1051-S1054 can be obtained by GPU parallel processing. This allows efficient calculation of the first voxel information of large-scale complex structures, avoids partitioning and subdividing the first model, and significantly improves the efficiency of calculating the first voxel information.
[0112] S106 : Integrate the first voxel information and the second voxel information to generate target voxel information.
[0113] Finally, the first voxel information corresponding to the first and third sub-bounding boxes within the first model structure can be integrated with the second voxel information corresponding to the fourth sub-bounding box outside the first model structure to obtain the target voxel information, which includes the signed distance field. This signed distance field based on the target voxel information can be directly used for additive manufacturing and model rendering, avoiding model pre-processing operations, simplifying the model processing and manufacturing process, and thus improving the flexibility and applicability of this method.
[0114] In some embodiments, integrating the first voxel information and the second voxel information to generate target voxel information specifically includes: merging the first voxel information and the second voxel information, converting the merged information into a binary data format, and obtaining the target voxel information.
[0115] For example, the target voxel information may be a file in a binary data format such as XML format, which can make the target voxel information more compact and lightweight, and can also be read, written and processed conveniently and efficiently.
[0116] In some embodiments, the target voxel information may further include preset texture information (e.g., texture coordinates) and model material information (e.g., density, elastic modulus). The preset texture information may be preset by the user based on actual application requirements. The preset texture information and model material information may be pre-acquired and integrated with the signed distance field to form the target voxel information.
[0117] Using the voxelization method for a three-dimensional model provided in the above embodiment of the present application, first, the target bounding box corresponding to the first bounding box information is divided into blocks according to a first preset resolution to obtain a plurality of primary sub-bounding boxes. Then, an intersection detection is performed on the primary sub-bounding box and the surface of the first model to determine a first sub-bounding box that intersects with the surface of the first model, and a second sub-bounding box that does not intersect with the surface of the first model. Furthermore, an inner cavity detection is performed on the second sub-bounding box to determine a third sub-bounding box inside the first model and a fourth sub-bounding box outside the first model. Next, the first sub-bounding box and the third sub-bounding box are voxelized to determine the first voxel information, and the second voxel information corresponding to the fourth sub-bounding box is determined based on the preset voxel information. Finally, the first voxel information and the second voxel information are integrated to generate the target voxel information.
[0118] This method has the beneficial effects of lightweight target voxel information data, high efficiency and high precision. Specifically, the method simplifies the blank area (i.e., the area corresponding to the fourth sub-bounding box), and the target voxel information can be processed in a compressed binary format, which reduces data redundancy and realizes the lightweight of the target voxel information. Moreover, for large-scale complex structures, the complex structure represented by the signed distance field can avoid grid description, and high-precision voxel data can be used to achieve higher-precision model expression with a smaller amount of data. Combining the signed distance value representation model with the hierarchical voxelization method avoids the problem that the traditional voxel format is difficult to describe complex geometric structures. The hierarchical voxel method adopted effectively realizes data lightweighting while solving the problems of complex calculation, low precision and low processing efficiency of sparse voxel structures. In this way, the accuracy and efficiency of voxelization of three-dimensional models can be effectively improved.
[0119] The embodiment of the present application further provides a voxel processing system for a three-dimensional model, specifically, Figure 6 A schematic diagram of the structure of a voxel processing system for a three-dimensional model provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the voxelization processing system 600 of the three-dimensional model includes: an extraction module 601 , a segmentation module 602 , an intersection detection module 603 , an inner cavity detection module 604 and a voxelization module 605 .
[0120] The extraction module 601 may be used to extract first bounding box information and facet information of the first model. The first model is a mesh model composed of multiple polygonal faces. The facet information is used to characterize the structure and properties of the polygonal faces.
[0121] The segmentation module 602 may be configured to perform block processing on the target bounding box corresponding to the first bounding box information according to a first preset resolution to obtain a plurality of primary sub-bounding boxes, each of which corresponds to the second bounding box information.
[0122] The intersection detection module 603 can be used to perform intersection detection on the surface of the first model with the multiple primary sub-bounding boxes based on the patch information and the second bounding box information, and determine the first sub-bounding box and the second sub-bounding box. The first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is a primary sub-bounding box that does not intersect with the surface of the first model.
[0123] The inner cavity detection module 604 can be configured to perform inner cavity detection on the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box, and determine a third sub-bounding box and a fourth sub-bounding box. The third sub-bounding box is the second sub-bounding box located inside the first model, and the fourth sub-bounding box is the second sub-bounding box located outside the first model.
[0124] The voxelization module 605 can be used to voxelize the first sub-bounding box and the third sub-bounding box based on the second bounding box information corresponding to the first sub-bounding box and the third sub-bounding box, as well as the patch information, to determine the first voxel information, and to determine the second voxel information corresponding to the fourth sub-bounding box based on the preset voxel information.
[0125] The voxelization module 605 may also be configured to integrate the first voxel information with the second voxel information to generate target voxel information, where the target voxel information includes a signed distance field.
[0126] Using the voxelization processing system for a three-dimensional model provided in an embodiment of the present application, first, the target bounding box corresponding to the first bounding box information is divided into blocks according to a first preset resolution to obtain a plurality of primary sub-bounding boxes. Then, an intersection detection is performed on the primary sub-bounding box and the surface of the first model to determine a first sub-bounding box that intersects with the surface of the first model and a second sub-bounding box that does not intersect with the surface of the first model. Furthermore, an inner cavity detection is performed on the second sub-bounding box to determine a third sub-bounding box inside the first model and a fourth sub-bounding box outside the first model. Next, the first sub-bounding box and the third sub-bounding box are voxelized to determine the first voxel information, and the second voxel information corresponding to the fourth sub-bounding box is determined based on the preset voxel information. Finally, the first voxel information and the second voxel information are integrated to generate the target voxel information. This system can effectively improve the accuracy and efficiency of voxelization processing of three-dimensional models.
[0127] An embodiment of the present invention further provides an electronic device, which may include: a display screen, a memory, and one or more processors. The display screen, memory, and processor are coupled. The memory is configured to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device may perform the various methods or steps described in the aforementioned embodiment of the voxelization method for a three-dimensional model. Of course, the electronic device includes, but is not limited to, the aforementioned display screen, memory, and one or more processors.
[0128] An embodiment of the present invention further provides a computer-readable storage medium for storing computer instructions for executing the above-mentioned voxelization processing method for a three-dimensional model.
[0129] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0130] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0131] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0132] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without expending creative work shall fall within the scope of protection of this application.
Claims
1. A voxelization method for a three-dimensional model, characterized in that: include: Extracting first bounding box information and facet information of a first model, where the first model is a mesh model composed of a plurality of polygonal faces, and the facet information is used to characterize the structure and properties of the polygonal faces; performing block processing on the target bounding box corresponding to the first bounding box information according to a first preset resolution to obtain a plurality of primary sub-bounding boxes, each of which corresponds to the second bounding box information; Based on the face information and the second bounding box information, performing intersection detection on the multiple primary sub-bounding boxes and the surface of the first model respectively to determine a first sub-bounding box and a second sub-bounding box; the first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is a primary sub-bounding box that does not intersect with the surface of the first model; Based on the second bounding box information corresponding to the second sub-bounding box, perform inner cavity detection on the second sub-bounding box to determine a third sub-bounding box and a fourth sub-bounding box; the third sub-bounding box is the second sub-bounding box located inside the first model, and the fourth sub-bounding box is the second sub-bounding box located outside the first model; Based on the second bounding box information corresponding to the first sub-bounding box and the third sub-bounding box, and the patch information, voxelize the first sub-bounding box and the third sub-bounding box to determine first voxel information, and determine the second voxel information corresponding to the fourth sub-bounding box according to preset voxel information; The first voxel information and the second voxel information are integrated to generate target voxel information, where the target voxel information includes a signed distance field.
2. The method according to claim 1, characterized in that The performing intersection detection on the plurality of primary sub-bounding boxes and the surface of the first model respectively based on the face information and the second bounding box information includes: Intersection detection of the coordinate axis of the primary sub-bounding box and the polygonal face in the first model, intersection detection of the normal vector axis of the polygonal face and the coordinate axis of the primary sub-bounding box, and intersection detection of the cross product axis of the axis direction of the primary sub-bounding box and the edge direction of the polygonal face.
3. The method according to claim 2, characterized in that The polygonal patch is a triangular patch; when the coordinate axis of the primary sub-bounding box and the polygonal patch in the first model satisfy the following expression, it is determined that the coordinate axis of the primary sub-bounding box intersects the polygonal patch in the first model: in, Represents the primary sub-bounding box B i The minimum coordinate value on the x-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the x-axis, Represents the primary sub-bounding box B i The minimum coordinate value on the y-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the y-axis, Represents the primary sub-bounding box B i The minimum coordinate value on the z-axis, Represents the primary sub-bounding box B i The maximum coordinate value on the z-axis; Represents the projection of the three edges of the polygonal patch on the x-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the x-axis of the primary sub-bounding box The maximum value in ; Represents the projection of the three edges of the polygonal patch on the y-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the y-axis of the primary sub-bounding box The maximum value in ; Represents the projection of the three edges of the polygonal patch on the z-axis of the primary sub-bounding box The minimum value in Represents the projection of the three edges of the polygonal patch on the z-axis of the primary sub-bounding box The maximum value in .
4. The method according to claim 2 or 3, characterized in that When the normal vector axis of the polygonal patch and the coordinate axis of the primary sub-bounding box satisfy the following expression, it is determined that the normal vector axis of the polygonal patch intersects the coordinate axis of the primary sub-bounding box: n j b i,min ≤n j ·v j1 , or, n j b i,max ≥n j ·v j1 ; Among them, n j Represents a polygonal patch f j Normal vector axis, b i,min Indicates the minimum coordinate value of the primary sub-bounding box on the three coordinate axes, b i,max Indicates the maximum coordinate value of the primary sub-bounding box on the three coordinate axes, v j1 Indicates the vertex coordinates of the polygonal facet; when i=1, it corresponds to the x-axis, when i=2, it corresponds to the y-axis, and when i=3, it corresponds to the z-axis.
5. The method according to claim 1, wherein The performing inner cavity detection on the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box to determine the third sub-bounding box and the fourth sub-bounding box includes: Determining, based on the second bounding box information corresponding to the second sub-bounding box, a same-layer sub-bounding box that is on the same layer as the second sub-bounding box; Constructing a two-dimensional convex polygon according to the center point of the second sub-bounding box and the center point of the sub-bounding box on the same layer by using a monotone chain algorithm; Determine whether the center point of the second sub-bounding box is within the two-dimensional convex polygon, determine the second sub-bounding box whose center point is within the two-dimensional convex polygon as the third sub-bounding box, and determine the second sub-bounding box whose center point is outside the two-dimensional convex polygon as the fourth sub-bounding box.
6. The method according to claim 5, characterized in that The constructing a two-dimensional convex polygon by a monotone chain algorithm according to the center point of the second sub-bounding box and the center point of the sub-bounding box on the same layer includes: sorting the center points of the second sub-bounding box and the center points of the sub-bounding box on the same layer in ascending order of x-axis coordinate values, and in ascending order of y-axis coordinate values if the x-axis coordinate values are the same, to obtain a sorted center point set; According to the order of x-axis coordinate values from small to large, the center points after sorting are determined to have a center point whose cross product value is greater than 0, and a lower semi-convex hull is constructed; According to the order of x-axis coordinate values from large to small, the center points after sorting are determined to have a center point whose cross product value is greater than 0, and an upper semi-convex hull is constructed; The lower half convex hull shape and the upper half convex hull shape are merged to obtain the two-dimensional convex polygon.
7. The method according to claim 1, characterized in that The performing voxelization processing on the first sub-bounding box and the third sub-bounding box based on the second bounding box information corresponding to the first sub-bounding box and the third sub-bounding box and the patch information to determine the first voxel information includes: Sampling the first sub-bounding box and the third sub-bounding box according to a second preset resolution to obtain a plurality of first sampling points; performing collision detection on each of the plurality of first sampling points and the surface of the first model based on the patch information, and determining an unsigned distance field corresponding to the first sampling point, wherein the unsigned distance field is used to represent the shortest distance from the first sampling point to the surface of the first model; Performing internal and external detection on the plurality of first sampling points and the surface of the first model based on the patch information, and determining symbols corresponding to the first sampling points, where the symbols are used to represent the internal and external relationship between the first sampling points and the surface of the first model; The signed distance field is determined according to the unsigned distance field and the sign.
8. The method according to claim 7, characterized in that The performing internal and external detection on the plurality of first sampling points and the surface of the first model based on the patch information includes: The plurality of first sampling points are respectively inspected for internal and external aspects of the surface of the first model using a normal vector consistency check method. The expression of the symbols corresponding to the first sampling points is: sign(φ(P))=sign((P-Q * )·n * ); Wherein, sign(φ(P)) represents the sign corresponding to the first sampling point P, sign(·) represents the sign function, φ(P) represents the signed distance function from the first sampling point P to the surface of the first model, Q * represents the closest projection point of the first sampling point P to the surface of the first model, n * Represents the normal vector from the first sampling point P to the nearest polygonal patch of the first model.
9. The method according to claim 1, characterized in that The integrating the first voxel information and the second voxel information to generate target voxel information includes: The first voxel information and the second voxel information are combined and converted into a binary data format to obtain the target voxel information.
10. A voxel processing system for a three-dimensional model, characterized in that: include: Extraction module, segmentation module, intersection detection module, lumen detection module and voxelization module; The extraction module is used to extract first bounding box information and facet information of a first model, where the first model is a mesh model composed of a plurality of polygonal faces, and the facet information is used to characterize the structure and properties of the polygonal faces; The segmentation module is configured to perform block processing on the target bounding box corresponding to the first bounding box information according to a first preset resolution to obtain a plurality of primary sub-bounding boxes, each of which corresponds to the second bounding box information; The intersection detection module is configured to perform intersection detection on the plurality of primary sub-bounding boxes and the surface of the first model based on the face information and the second bounding box information, to determine a first sub-bounding box and a second sub-bounding box; the first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is a primary sub-bounding box that does not intersect with the surface of the first model; The inner cavity detection module is configured to perform inner cavity detection on the second sub-bounding box based on the second bounding box information corresponding to the second sub-bounding box, and determine a third sub-bounding box and a fourth sub-bounding box; the third sub-bounding box is the second sub-bounding box located inside the first model, and the fourth sub-bounding box is the second sub-bounding box located outside the first model; The voxelization module is configured to perform voxelization processing on the first sub-bounding box and the third sub-bounding box based on the second bounding box information corresponding to the first sub-bounding box and the third sub-bounding box, and the patch information, to determine first voxel information, and to determine second voxel information corresponding to the fourth sub-bounding box based on preset voxel information; The voxelization module is further configured to integrate the first voxel information and the second voxel information to generate target voxel information, where the target voxel information includes a signed distance field.
Citation Information
Patent Citations
Triangular mesh model distance field generation method and system based on multi-information voxel
CN115423973A
Grid orientation discrimination method and device, electronic device and storage medium
CN116778110A
Method, system, and computer program product for efficient ray tracing of micropolygon geometry
US20100289799A1