A method and system for voxelization of a three-dimensional model
By using a hierarchical method to divide bounding boxes and determine whether a model is inside or outside, voxelization of the 3D model is performed. This solves the problems of low efficiency, low accuracy, and data redundancy in existing technologies, and achieves efficient and accurate voxelization processing.
Patent Information
- Application Number
- CN202510580679.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-05-07
AI Technical Summary
Existing technologies cannot efficiently and accurately perform voxelization of 3D models, especially when dealing with large-scale complex structures, which suffer from problems such as low efficiency and low segmentation accuracy of spatial segmentation algorithms, large data volume, and data redundancy.
A hierarchical bounding box division and inside/outside determination method is adopted 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. Voxel information is constructed for the internal and external structures respectively, and the complex structure is represented by a symbolic distance field to generate target voxel information.
It achieves efficient and accurate voxelization of 3D models, reduces data redundancy, and improves processing efficiency and accuracy. It is suitable for voxelization of 3D models with large-scale complex structures.
Smart Images

Figure CN120689545B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D modeling technology, specifically to a method and system for voxelization of 3D models. Background Technology
[0002] With the rapid development of industrial technology, the requirements for workpiece structures are becoming increasingly stringent. For example, workpiece structures need to meet application requirements such as high strength, high specific stiffness, high specific surface area, high temperature resistance, and high heat exchange rate. Currently, complex workpiece structures are usually manufactured using additive manufacturing methods. However, the methods of representing workpiece structures using relevant models (e.g., models that fit curved surfaces with triangular facets) are difficult to meet the accuracy requirements of model applications and also pose difficulties for model processing and additive manufacturing.
[0003] Voxel format, as a representation of 3D models, divides the space of a 3D model into a uniform array of cubes, with each cube corresponding to a voxel data point, which can include location, size, and attributes. Voxel format is characterized by ease of processing, parallel compatibility, and wide compatibility. Furthermore, slicing based on voxel data can generate slice files for additive manufacturing, enabling rapid workpiece fabrication.
[0004] In related technologies, voxelization is typically performed using model-based coordinate points. This method is mainly used for 3D scene reconstruction and rendering, and therefore often employs sparse voxel structures to represent large-scale scenes. However, these sparse voxel structures suffer from low efficiency and low segmentation accuracy in representing large-scale complex structures. Furthermore, they also suffer from computational complexity and high memory consumption. Additionally, due to the numerous pores within the complex structure of sparse voxels, these pores do not require storing detailed attribute information, resulting in large data volumes and data redundancy in the sparse voxel data. This makes it impossible to efficiently and accurately voxelize 3D models. Summary of the Invention
[0005] The technical problem to be solved by this invention is the inability to efficiently and accurately perform voxelization processing on three-dimensional models.
[0006] To address the aforementioned technical problems, this invention provides a method and system for voxelization of three-dimensional models, specifically employing the following technical solution:
[0007] In a first aspect, the present invention provides a voxelization method for a three-dimensional model. The method includes: First, extracting first bounding box information and patch information of a first model, wherein 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. Then, according to a first preset resolution, the target bounding box corresponding to the first bounding box information is segmented to obtain multiple primary sub-bounding boxes, each primary sub-bounding box corresponding to second bounding box information. Next, based on the patch information and the second bounding box information, the multiple primary sub-bounding boxes are subjected to intersection detection with the surface of the first model to determine the first and second sub-bounding boxes; 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. Second, based on the second bounding box information corresponding to the second sub-bounding box, the second sub-bounding box undergoes interior cavity detection to determine the third and fourth sub-bounding boxes; 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, the first and third sub-bounding boxes are voxelized to determine the first voxel information, and the second voxel information corresponding to the fourth sub-bounding box is determined according to the preset voxel information. Finally, the first and second voxel information are integrated to generate the target voxel information, which includes the symbolic distance field.
[0008] This method offers advantages such as lightweight target voxel information data, high efficiency, and high accuracy. Specifically, it simplifies blank regions (i.e., the region corresponding to the fourth sub-bounding box) and uses compressed binary format for target voxel information, reducing data redundancy and achieving lightweight target voxel information. Furthermore, for large-scale complex structures, the symbolic distance field representation avoids mesh description, enabling higher-precision model representation with less data using high-precision voxel data. Combining the symbolic distance value representation model with a hierarchical voxelization method avoids the problem of traditional voxel formats being unable to describe complex geometric structures. The hierarchical voxel method effectively achieves data lightweighting while solving the problems of computational complexity, low accuracy, and low processing efficiency associated with sparse voxel structures. Thus, it effectively improves the accuracy and efficiency of voxelization processing for 3D models.
[0009] In conjunction with the first aspect, in one alternative implementation, the above-mentioned intersection detection of multiple primary sub-bounding boxes with the surface of the first model is performed based on the patch information and the second bounding box information, including: intersection detection of the coordinate axes of the primary sub-bounding boxes with the polygonal patches in the first model, intersection detection of the normal vector axis of the polygonal patches with the coordinate axes of the primary sub-bounding boxes, and intersection detection of the cross product axis of the axial direction of the primary sub-bounding boxes with the edge direction of the polygonal patches.
[0010] In this implementation, the intersection detection described above can accurately determine whether the primary sub-bounding box intersects with the surface of the first model, thereby accurately determining the first sub-bounding box and the second sub-bounding box.
[0011] In conjunction with the first aspect, in one alternative implementation, the aforementioned polygonal facet is a triangular facet. Then, the intersection of the coordinate axes of the primary sub-bounding box and the polygonal facet in the first model is determined when the coordinate axes of the primary sub-bounding box and the polygonal facet in the first model satisfy the following expression:
[0012]
[0013] in, Indicates the primary sub-boundary box B i The minimum coordinate value on the x-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the x-axis. Indicates the primary sub-boundary box B i The minimum coordinate value on the y-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the y-axis. Indicates the primary sub-boundary box B i The minimum coordinate value on the z-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the z-axis; This represents the projection of the three edges of a polygonal face onto the x-axis of its primary sub-boundary. The minimum value in, This represents the projection of the three edges of a polygonal face onto the x-axis of its primary sub-boundary. The maximum value in; This represents the projection of the three edges of a polygonal patch onto the y-axis of its primary sub-boundary. The minimum value in, This represents the projection of the three edges of a polygonal patch onto the y-axis of its primary sub-boundary. The maximum value in; This represents the projection of the three edges of a polygonal patch onto the z-axis of its primary sub-bounding box. The minimum value in, This represents the projection of the three edges of a polygonal patch onto the z-axis of its primary sub-bounding box. The maximum value in.
[0014] In conjunction with the first aspect, in one alternative implementation, the intersection of the normal axis of the polygonal facet and the coordinate axis of the primary sub-bounding box is determined when the normal axis of the polygonal facet 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] Where, n j Represents a polygonal patch f j normal vector axis, b i,min b represents the minimum coordinate value of the primary sub-bounding box on the three coordinate axes. i,max This represents the maximum coordinate value of the primary sub-bounding box on the three coordinate axes, v. j1 Represents the vertex coordinates of the polygonal face; 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 one alternative implementation, the above-mentioned method of performing 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 and fourth sub-bounding boxes includes: First, based on the second bounding box information corresponding to the second sub-bounding box, determining the same-layer sub-bounding boxes that are 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 points of the same-layer sub-bounding boxes, constructing a two-dimensional convex polygon using a monotonic chain algorithm. Finally, determining whether the center point of the second sub-bounding box is inside the two-dimensional convex polygon, identifying the second sub-bounding box whose center point is inside the two-dimensional convex polygon as the third sub-bounding box, and identifying 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. Then, by determining whether the center point of the second sub-bounding box is inside the two-dimensional convex polygon, the third and fourth sub-bounding boxes can be effectively and accurately distinguished.
[0019] In conjunction with the first aspect, in one alternative implementation, the construction of a two-dimensional convex polygon using a monotonic chain algorithm based on the center points of the second sub-bounding box and the center points of sub-bounding boxes at the same level includes: First, sorting the center points of the second sub-bounding box and the center points of sub-bounding boxes at the same level in ascending order of x-axis coordinate values, and, if x-axis coordinate values are the same, in ascending order of y-axis coordinate values, to obtain a sorted set of center points. Then, in ascending order of x-axis coordinate values, determining the center points in the sorted set that satisfy the cross product value greater than 0, to construct the lower semi-convex hull. Second, in descending order of x-axis coordinate values, determining the center points in the sorted set that satisfy the cross product value greater than 0, to construct the upper semi-convex hull. Finally, merging the lower and upper semi-convex hulls to obtain the two-dimensional convex polygon.
[0020] In conjunction with the first aspect, in one alternative implementation, the first and third sub-bounding boxes are voxelized 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, this includes: First, sampling the first and third sub-bounding boxes according to a second preset resolution to obtain multiple first sampling points. Then, based on the patch information, collision detection is performed between the multiple first sampling points and the surface of the first model to determine the unsigned distance field corresponding to each first sampling point. The unsigned distance field is used to characterize the shortest distance from the first sampling point to the surface of the first model. Next, based on the patch information, in-situ detection is performed between the multiple first sampling points and the surface of the first model to determine the sign corresponding to each first sampling point. The sign is used to characterize the in-situ relationship between the first sampling point and the surface of the first model. Finally, a signed distance field is determined based on the unsigned distance field and the sign.
[0021] In conjunction with the first aspect, in one alternative implementation, the aforementioned detection of the interior and exterior of multiple first sampling points relative to the surface of the first model based on patch information includes: performing interior and exterior detection of multiple first sampling points relative to the surface of the first model 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] Where, sign(φ(P)) represents the sign corresponding to the first sampling point P, sign(·) represents the sign function, φ(P) represents the sign distance function from the first sampling point P to the surface of the first model, and Q * n represents the nearest projection point from the first sampling point P to the surface of the first model. * This represents the normal vector from the first sampling point P to the nearest polygonal face of the first model.
[0024] In conjunction with the first aspect, in one alternative 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, achieving data lightweighting, and the target voxel information can be read, written and processed conveniently and efficiently.
[0026] Secondly, this invention provides a voxelization system for a three-dimensional model, comprising: an extraction module, a segmentation module, an intersection detection module, an interior cavity detection module, and a voxelization module. The extraction module extracts first bounding box information and facet information of a first model, where the first model is a mesh model composed of multiple polygonal faces, and the facet information characterizes the structure and properties of the polygonal faces. The segmentation module divides the target bounding box corresponding to the first bounding box information into blocks according to a first preset resolution, obtaining multiple primary sub-bounding boxes, each corresponding to second bounding box information. The intersection detection module performs intersection detection between the multiple primary sub-bounding boxes and the surface of the first model based on the facet information and the second bounding box information, determining the first and second sub-bounding boxes; the first sub-bounding box is a primary sub-bounding box that intersects with the surface of the first model, and the second bounding box is a primary sub-bounding box that does not intersect with the surface of the first model. The cavity detection module can be used to perform cavity detection on the second sub-bounded box based on the second bounding box information corresponding to the second sub-bounded box, and determine the third and fourth sub-bounded boxes; the third sub-bounded box is the second sub-bounded box located inside the first model, and the fourth sub-bounded box is the second sub-bounded box located outside the first model. The voxelization module can be used to perform voxelization processing on the first and third sub-bounded boxes based on the second bounding box information corresponding to the first and third sub-bounded boxes, as well as the patch information, to determine the first voxel information, and to determine the second voxel information corresponding to the fourth sub-bounded box according to preset voxel information. The voxelization module can be used to integrate the first and second voxel information to generate target voxel information, which includes the symbolic distance field.
[0027] Thirdly, the present invention provides an electronic device, comprising: a memory and one or more processors; the memory being coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method provided by the first aspect and any of its alternative implementations.
[0028] Fourthly, the present invention provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method provided by the first aspect and any alternative implementation thereof.
[0029] Understandably, the beneficial effects achievable by the voxelization system for the three-dimensional model provided in the second aspect, the electronic device in the third aspect, and the computer-readable storage medium in the fourth aspect can be referenced to the beneficial effects in the first aspect and any of its possible design methods, and will not be elaborated here. Attached Figure Description
[0030] Figure 1 A flowchart illustrating the voxelization process for a three-dimensional model provided in this application embodiment;
[0031] Figure 2 A schematic diagram of the second sub-boundary box provided in an embodiment of this application;
[0032] Figure 3 A schematic diagram illustrating the process of constructing the lower semi-convex hull shape provided in an embodiment of this application;
[0033] Figure 4 A schematic diagram illustrating the internal cavity detection of the second sub-enclosing box provided in an embodiment of this application;
[0034] Figure 5 This is a schematic flowchart of a method for determining first voxel information provided in an embodiment of this application;
[0035] Figure 6 This is a schematic diagram of the structure of the voxelization system for the three-dimensional model provided in the embodiments of this application. Detailed Implementation
[0036] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described below do not represent all embodiments consistent with this application. They are merely examples of systems and methods consistent with some aspects of this application as detailed in the claims.
[0037] With the rapid development of industrial technology, the requirements for workpiece structures are becoming increasingly stringent. For example, workpiece structures need to meet application requirements such as high strength, high specific stiffness, high specific surface area, high temperature resistance, and high heat exchange rate. Consequently, workpiece structures are becoming increasingly complex. Complex workpiece structures can be represented in three dimensions using lattice structures, honeycomb structures, and three-period minimal surface structures. These structures, to meet the aforementioned application requirements, often possess characteristics such as complex curved surfaces and intricate features. Currently, complex workpiece structures are typically manufactured using additive manufacturing methods. However, the method of representing workpiece structures by fitting curved surfaces with triangular facets is insufficient to meet the accuracy requirements of model applications and also creates difficulties for model processing and additive manufacturing.
[0038] Voxel format, as a representation of 3D models, divides the space of a 3D model into a uniform array of cubes, with each cube corresponding to a voxel data point, which can include position, size, and attributes. The segmentation resolution of the cube array determines the accuracy of the 3D model. Voxel format is characterized by ease of processing, parallel processing capability, and wide compatibility. Furthermore, slicing based on voxel data can generate slice files for additive manufacturing, enabling rapid workpiece fabrication.
[0039] In related technologies, voxelization is typically performed using model-based coordinate points. This method is mainly used for 3D scene reconstruction and rendering, and therefore often employs sparse voxel structures to represent large-scale scenes. However, these sparse voxel structures suffer from low efficiency and low segmentation accuracy in representing large-scale complex structures. Furthermore, they also suffer from computational complexity and high memory consumption. Additionally, due to the numerous pores within the complex structure of sparse voxels, these pores do not require storing detailed attribute information, resulting in large data volumes and data redundancy in the sparse voxel data. This makes it impossible to efficiently and accurately voxelize 3D models.
[0040] To address the aforementioned issues, this application provides a voxelization method and system for 3D models. This method and system can be applied to voxelization of large-scale (data-volume) complex 3D models. Specifically, for 3D models, this method, based on hierarchical bounding box division and an inside / outside determination method, identifies sub-bounding boxes that intersect with the 3D model (hereinafter referred to as sub-bounding box A), sub-bounding boxes inside the 3D model (hereinafter referred to as sub-bounding box B), and sub-bounding boxes outside the 3D model (hereinafter referred to as sub-bounding box C). Then, voxel information is constructed for the internal structure (i.e., sub-bounding boxes A and B) and the external structure (i.e., sub-bounding box C) of the 3D model. Finally, the two voxel information are coupled to generate overall voxel data. This allows for efficient and accurate voxelization of 3D models.
[0041] The solutions provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0042] Specifically, Figure 1 A flowchart illustrating the voxelization method for a three-dimensional model provided in this application embodiment is shown below. Figure 1 As shown, the voxelization method for a three-dimensional model provided in this application includes the following steps S101-S106:
[0043] S101. Extract the bounding box information and face information of the first model.
[0044] In this embodiment, 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 mesh format such as stereolithography (STL) or OBJ.
[0045] To construct the 3D lattice structure model corresponding to the first model, it is first necessary to extract the bounding box information and facet information of the first model. The bounding box information can be used to characterize a simplified geometry (such as a cube or cuboid) that encloses the first model; this bounding box represents the approximate spatial extent of the first model. For example, the bounding box can be an axis-aligned bounding box (AABB).
[0046] Patch information can be used to characterize the structure and properties of polygon patches. For example, patch information may include: patch vertex coordinate information and patch normal information.
[0047] In some embodiments, vertex information, face vertex coordinates, and face normals of the first model can be extracted by parsing the mesh file of the first model. For example, taking a first model in STL or OBJ mesh format, the vertex information and face vertex coordinates of the first model are typically stored in the mesh file of the first model and can be read. Face normals can be determined by calculating the cross product of the face vertex coordinates.
[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, thus obtaining the bounding box information.
[0049] S102. The target bounding box corresponding to the first bounding box information is divided into blocks according to the first preset resolution to obtain multiple primary sub-bounding boxes.
[0050] Specifically, firstly, the corresponding target bounding box can be determined based on the first bounding box information. Then, based on the first preset resolution R... p [r1,r2,r3] performs primary block segmentation 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 voxelization processing of the regions.
[0051] Each primary sub-bounding box corresponds to a second bounding box, which can be used to characterize 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 aforementioned first preset resolution can be preset according to the size of the target bounding box and the actual application requirements; this application does not impose any specific limitations on it.
[0053] S103. Based on the patch information and the second bounding box information, perform intersection detection between the multiple primary sub-bounding boxes and the surface of the first model to determine the first sub-bounding box and the second sub-bounding box.
[0054] Furthermore, collision detection, or intersection detection, is performed on the multiple primary sub-bounding boxes obtained from the block division in S102 with the surface of the first model to obtain the first sub-bounding box and the second sub-bounding box. The first sub-bounding box is the primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is the primary sub-bounding box that does not intersect with the surface of the first model.
[0055] In one implementation, the intersection of the primary sub-bounding box with at least one polygonal facet constituting the first model can be used to determine that the primary sub-bounding box intersects with the surface of the first model.
[0056] In some embodiments, the intersection detection between the primary sub-boundary box and the surface of the first model can be performed based on the Separating Axis Theorem (SAT). That is, if there exists an axis such that the projection regions of the primary sub-boundary box and the polygonal facet do not overlap, then they do not intersect. Specifically, the following axes need to be tested: the three coordinate axes of the primary sub-boundary box, the normal vector axis of the polygonal facet, and the cross product axis of the axis direction of the primary sub-boundary box and the edge direction of the polygonal facet.
[0057] Specifically, in S103, based on the patch information and the second bounding box information, multiple primary sub-bounding boxes are intersected with the surface of the first model, which may include:
[0058] Intersection detection of the coordinate axes of the primary sub-bounding box with the polygonal facets in the first model, intersection detection of the normal vector axis of the polygonal facets with the coordinate axes of the primary sub-bounding box, and intersection detection of the cross product axis of the axis direction of the primary sub-bounding box with the edge direction of the polygonal facets.
[0059] In some embodiments, taking a triangular polygonal facet as an example, the intersection of the coordinate axes of the primary sub-bounding box and the polygonal facet in the first model is determined when the coordinate axes of the primary sub-bounding box and the polygonal facet in the first model satisfy the following expression:
[0060]
[0061] in, Indicates the primary sub-boundary box B i The minimum coordinate value on the x-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the x-axis. Indicates the primary sub-boundary box B i The minimum coordinate value on the y-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the y-axis. Indicates the primary sub-boundary box B i The minimum coordinate value on the z-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the z-axis; This represents the projection of the three edges of a polygonal face onto the x-axis of its primary sub-boundary. The minimum value in, This represents the projection of the three edges of a polygonal face onto the x-axis of its primary sub-boundary. The maximum value in; This represents the projection of the three edges of a polygonal patch onto the y-axis of its primary sub-boundary. The minimum value in, This represents the projection of the three edges of a polygonal patch onto the y-axis of its primary sub-boundary. The maximum value in; This represents the projection of the three edges of a polygonal patch onto the z-axis of its primary sub-bounding box. The minimum value in, This represents the projection of the three edges of a polygonal patch onto the z-axis of its primary sub-bounding box. The maximum value in.
[0062] In some embodiments, the intersection of the normal axis of the polygonal facet and the coordinate axis of the primary sub-bounding box is determined when the normal axis of the polygonal facet 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] Where, n j Represents a polygonal patch f j normal vector axis, b i,min b represents the minimum coordinate value of the primary sub-bounding box on the three coordinate axes. i,max This represents the maximum coordinate value of the primary sub-bounding box on the three coordinate axes, v. j1 Represents the vertex coordinates of the polygonal face; 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 intersection detection of the cross product axis of the axial direction of the primary sub-bounding box and the edge direction of the polygonal facet specifically includes: First, calculating the cross product of the axial direction of the primary sub-bounding box and the edge direction of the polygonal facet to obtain a new separation axis. Then, testing whether the projection intervals overlap based on the new separation axis. If no separation is found on any of the separation axes obtained by the cross product, it is determined that the primary sub-bounding box intersects with the surface of the first model respectively.
[0066] For example, taking a polygonal facet as a triangular facet, the expression for the cross product of the axial direction of the primary sub-bounding box and the edge direction of the polygonal facet 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 This represents the axial edge vector of the primary sub-bounding box, specifically, eA1 Let e represent the x-axis edge vector of the primary sub-bounding box. A2 Let e represent the edge vector along the y-axis of the primary sub-bounding box. A3 This represents the z-axis edge vector of the primary sub-bounding box. Tl This represents the edge vector of a triangular facet, specifically, e. T1 Let e represent the first side vector of the triangular facet. T2 Let e represent the second side vector of the triangular facet. T3 Let v represent the third side vector of the triangular facet. j1 v represents the three-dimensional coordinate vector of the first vertex of the triangular facet. j2 v represents the three-dimensional coordinate vector of the second vertex of the triangular facet. j3 This represents the three-dimensional coordinate vector of the third vertex of the triangular facet.
[0071] S104. Based on the information of the second bounding box corresponding to the second sub-bounding box, perform internal cavity detection on the second sub-bounding box to determine the third and fourth sub-bounding boxes.
[0072] Specifically, after the intersection detection in S103, there is a possibility that the cavity inside the first model may be misidentified as a blank area (i.e., outside the first model). For example, Figure 2 This is a schematic diagram of the second sub-boundary box provided in an embodiment of this application, as shown below. Figure 2 As shown, the second sub-bounding box 201 is located inside the first model 200 (inner cavity), while the second sub-bounding boxes 202, 203, and 204 are located in the blank area (i.e., outside the first model 200). Since the blank area is not subjected to the subsequent voxelization process in S105, in the event of a misjudgment, the complex structure inside the first model will lack corresponding voxel information. Therefore, further, based on the second bounding box information corresponding to the second sub-bounding box, it is necessary to perform inner cavity detection on the second sub-bounding box to distinguish whether the second sub-bounding box that has no intersection detection with the surface of the first model is located inside the model cavity, that is, to determine the third and fourth sub-bounding boxes, where 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.
[0073] In some embodiments, S104 may specifically include the following steps S1041-S1043:
[0074] S1041. Based on the second bounding box information corresponding to the second sub-bounding box, determine the same-layer sub-bounding box that is in the same layer as the second sub-bounding box.
[0075] Specifically, since the cavity of the first model is a closed space, and the cavity region exists within a closed curved surface, the center point of the second sub-bounding box within the cavity of the first model lies within a closed image. Therefore, to improve the cavity detection efficiency, in this embodiment, cavity detection can be performed layer by layer on the second sub-bounding box, that is, the convex hull construction method can be optimized into a convex polygon construction method, that is, a monotonic chain algorithm can be used to construct a two-dimensional convex polygon.
[0076] Therefore, based on the information of the second bounding box corresponding to the second bounding box, we can first determine the second bounding box that is on the same layer as the second bounding box, i.e., the bounding box on the same layer.
[0077] S1042. Construct a two-dimensional convex polygon using the monotonic chain algorithm based on the center point of the second sub-bounding box and the center point of the sub-bounding boxes at the same level.
[0078] Furthermore, based on the center points of the second sub-bounding box and the sub-bounding boxes at the same layer, a two-dimensional convex polygon can be constructed using the monotonic chain algorithm to determine whether the second sub-bounding box is within the 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 boxes at the same level in ascending order of x-axis coordinate values, and in the case of the same x-axis coordinate values, sort them in ascending order of y-axis coordinate values to obtain the sorted set of center points.
[0081] S10422. According to the x-axis coordinate values in ascending order, determine the center points in the sorted center point set that satisfy the cross product value is greater than 0, and construct the lower semi-convex hull shape.
[0082] Specifically, first, a stack (or list) can be constructed. The first two points from the sorted set of centroids are added to the stack sequentially, serving as the top two points. Then, for each subsequent point pi in the sorted centroid set, arranged in ascending order of x-axis coordinates, it is determined whether the top two points of the stack and point pi constitute a "right turn" condition (i.e., cross product ≤ 0). If so, the top points are popped from the stack until a "left turn" condition (i.e., cross product > 0) is met, at which point pi is then pushed back onto the stack.
[0083] For example, Figure 3 This is a schematic diagram of the process for constructing the lower semi-convex hull shape provided in an embodiment of this application, as shown below. Figure 3 As shown, by going through the above construction process in sequence, a lower semi-convex hull shape composed of points 0, 2, 6 and 7 can be obtained.
[0084] S10423. According to the x-axis coordinate values from largest to smallest, determine the center points in the sorted center point set that satisfy the cross product value is greater than 0, and construct the upper semi-convex hull shape.
[0085] Specifically, the process of S10423 is similar to that of S10422, but the traversal order during construction is different, namely, it follows the order of x-axis coordinate values from largest to smallest. The specific construction process can be found in S10422, and will not be elaborated upon here.
[0086] S10424. Merge the lower and upper semi-convex hull shapes to obtain a two-dimensional convex polygon.
[0087] Furthermore, the lower and upper convex hulls are merged by removing duplicate endpoints (e.g., the first and last points of the lower and upper convex hulls, respectively), to obtain the constructed closed two-dimensional convex polygon.
[0088] In some embodiments, the two-dimensional convex polygon in S1042 can also be constructed using Graham scan, 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. The second sub-bounding box whose center point is inside the two-dimensional convex polygon is determined as the third sub-bounding box, and the second sub-bounding box whose center point is outside the two-dimensional convex polygon is determined as the fourth sub-bounding box.
[0090] For example, Figure 4 A schematic diagram illustrating the internal cavity detection of the second sub-enclosing box provided in an embodiment of this application, as shown below. Figure 4 As shown, the midpoint A1 of the second sub-bounding box 401 and the center point A2 of the second sub-bounding box 402 are located inside the two-dimensional convex polygon 400, so the second sub-bounding box 401 and the second sub-bounding box 402 can be identified as the third sub-bounding box. The midpoint A3 of the second sub-bounding box 403 and the center point A4 of the second sub-bounding box 404 are located outside the two-dimensional convex polygon 400, so the second sub-bounding box 403 and the second sub-bounding box 404 can be identified as the fourth sub-bounding box.
[0091] S105. Based on the second bounding box information corresponding to the first and third sub-bounding boxes, as well as the patch information, voxelize the first and third sub-bounding boxes to determine the first voxel information, and determine the 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 located within the cavity of the first model, i.e., the symbolic distance field is determined to obtain the first voxel information. This first voxel information includes the symbolic distance field. For the fourth sub-bounding box located outside the first model, its corresponding second voxel information can be determined as preset voxel information (e.g., voxel fixed value), which is different from the first voxel information. In this way, the internal structure and external blank areas of the first model can be distinguished through voxel information, and data redundancy can be reduced, improving the lightweight nature of the 3D model voxel information.
[0093] In some embodiments, Figure 5 This is a schematic flowchart of a method for determining first voxel information provided in an embodiment of this application, as shown below. 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-boundary box and the third sub-boundary box according to the second preset resolution to obtain multiple first sampling points.
[0095] Specifically, the first and third sub-bounding boxes are sampled based on the second preset resolution, that is, secondary partitioning is achieved to obtain multiple first sampling points, so as to determine the symbolic distance field based on the first sampling points.
[0096] In some embodiments, the second preset resolution can be preset according to actual application requirements, and this application does not specifically limit it. For example, the second preset resolution can correspond to the 3D printing resolution and the rendering resolution, thereby facilitating rapid manufacturing and rapid rendering, and thus improving the applicability and flexibility of the method.
[0097] S1052. Based on the patch information, collision detection is performed between multiple first sampling points and the surface of the first model to determine the unsigned distance field corresponding to the first sampling points.
[0098] Then, collision detection can be performed on the first sampling point determined in S1051 and the surface of the first model based on the patch information to determine the shortest distance from the first sampling point to the surface of the first model. This shortest distance is the unsigned distance field corresponding to the first sampling point, that is, the unsigned distance field can be used to characterize the shortest distance from the first sampling point to the surface of the first model.
[0099] In one implementation, firstly, the projected distance from the first sampling point P to all polygonal faces constituting the first model is determined, and the expression for this projected distance is:
[0100] d j (P)=‖P-proj fi (P)‖;
[0101] Where, d j (P) represents the projection distance, proj fi (P) is the nearest projection point of the first sampling point P on the polygonal patch fi. This nearest projection point is usually located inside or at the edge of the polygonal patch.
[0102] Then, the minimum value (i.e. the shortest distance) among the projected 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. Based on the patch information, perform internal and external detection on multiple first sampling points and the surface of the first model respectively, and determine the symbol corresponding to the first sampling point.
[0104] The sign can be used to characterize the relationship between the first sampling point and the surface of the first model. For example, a positive sign indicates that the first sampling point is outside the first model. A negative sign indicates that the first sampling point is inside the first model. A sign of 0 indicates that the first sampling point is on the surface of the first model.
[0105] In some embodiments, S1053 involves performing internal and external detection on multiple first sampling points and the surface of the first model based on patch information, specifically including:
[0106] The consistency test method for normal vectors is used to detect the internal and external surfaces of multiple first sampling points relative to the surface of the first model. The expression for the sign corresponding to the first sampling point is as follows:
[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 sign distance function from the first sampling point P to the surface of the first model, and Q * n represents the nearest projection point from the first sampling point P to the surface of the first model. * This represents the normal vector from the first sampling point P to the nearest polygonal face of the first model.
[0109] S1054. The signed distance field is obtained based on the unsigned distance field and the signed distance field.
[0110] Furthermore, by merging the unsigned distance field determined in S1052 with the coincidence determined in S1053, the signed distance field can be obtained.
[0111] In some embodiments, the first voxel information determined in S1051-S1054 above can be obtained by GPU parallel processing. This allows for efficient computation of the first voxel information for large-scale complex structures, avoiding the need for partitioning and subdividing the first model, thus significantly improving the efficiency of first voxel information computation.
[0112] S106. Integrate the first voxel information with 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 symbolic distance field. Thus, the symbolic distance field in the target voxel information can be directly used for additive manufacturing and model rendering, avoiding pre-processing operations on the model, simplifying the model processing and manufacturing process, and improving the flexibility and applicability of the method.
[0114] In some embodiments, the first voxel information and the second voxel information are integrated to generate target voxel information, specifically including: merging the first voxel information and the second voxel information and converting them into binary data format to obtain target voxel information.
[0115] For example, the target voxel information can be a file in a binary data format such as XML. This makes the target voxel information more compact, achieving data lightweighting, and also allows for convenient and efficient reading, writing, and processing of the target voxel information.
[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 can be preset by the user according to actual application requirements. The preset texture information and model material information can be pre-acquired and integrated with the symbolic distance field to constitute the target voxel information.
[0117] Using the voxelization method for a 3D model provided in the above embodiments of this application, firstly, the target bounding box corresponding to the first bounding box information is segmented according to a first preset resolution to obtain multiple primary sub-bounding boxes. Then, intersection detection is performed between the primary sub-bounding boxes and the surface of the first model to determine the first sub-bounding box that intersects with the surface of the first model and the second sub-bounding box that does not intersect with the surface of the first model. Further, cavity detection is performed on the second sub-bounding box to determine the third sub-bounding box located inside the first model and the fourth sub-bounding box located outside the first model. Next, voxelization processing is performed on the first and third sub-bounding boxes to determine the first voxel information, and the second voxel information corresponding to the fourth sub-bounding box is determined according to 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 offers advantages such as lightweight target voxel information data, high efficiency, and high accuracy. Specifically, it simplifies blank regions (i.e., the region corresponding to the fourth sub-bounding box) and uses compressed binary format for target voxel information, reducing data redundancy and achieving lightweight target voxel information. Furthermore, for large-scale complex structures, the symbolic distance field representation avoids mesh description, enabling higher-precision model representation with less data using high-precision voxel data. Combining the symbolic distance value representation model with a hierarchical voxelization method avoids the problem of traditional voxel formats being unable to describe complex geometric structures. The hierarchical voxel method effectively achieves data lightweighting while solving the problems of computational complexity, low accuracy, and low processing efficiency associated with sparse voxel structures. Thus, it effectively improves the accuracy and efficiency of voxelization processing for 3D models.
[0119] This application also provides a voxelization system for three-dimensional models, specifically... Figure 6 This is a schematic diagram of the structure of the voxelization system for the three-dimensional model provided in the embodiments of this application, as shown below. 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 internal cavity detection module 604, and a voxelization module 605.
[0120] The extraction module 601 can be used to extract the first bounding box information and 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.
[0121] The segmentation module 602 can be used to segment 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.
[0122] The intersection detection module 603 can be used to perform intersection detection between multiple primary sub-bounding boxes and the surface of the first model based on patch information and second bounding box information, thereby determining the first and second sub-bounding boxes. 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 cavity detection module 604 can be used to perform 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 and fourth sub-bounding boxes. 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-boundary box and the third sub-boundary box based on the second bounding box information corresponding to the first sub-boundary box and the third sub-boundary 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-boundary box according to the preset voxel information.
[0125] The voxelization module 605 can also be used to integrate the first voxel information with the second voxel information to generate target voxel information, which includes the symbolic distance field.
[0126] The voxelization system for 3D models provided in this application first divides the target bounding box corresponding to the first bounding box information into blocks according to a first preset resolution, obtaining multiple primary sub-bounding boxes. Then, it performs intersection detection between the primary sub-bounding boxes and the surface of the first model to determine the first sub-bounding box that intersects with the surface of the first model and the second sub-bounding box that does not intersect with the surface of the first model. Further, it performs interior cavity detection on the second sub-bounding boxes to determine the third sub-bounding box located inside the first model and the fourth sub-bounding box located outside the first model. Next, it performs voxelization processing on the first and third sub-bounding boxes to determine the first voxel information, and determines the second voxel information corresponding to the fourth sub-bounding box according to the preset voxel information. Finally, it integrates the first and second voxel information to generate the target voxel information. This system can effectively improve the accuracy and efficiency of voxelization processing of 3D models.
[0127] This invention also provides an electronic device, which may include a display screen, a memory, and one or more processors. The display screen, memory, and processors are coupled. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various methods or steps executed in the above-described embodiments of the voxelization processing method for three-dimensional models. Of course, this electronic device includes, but is not limited to, the display screen, memory, and one or more processors described above.
[0128] This invention also provides a computer-readable storage medium for storing computer instructions for running the voxelization processing method of the above-described three-dimensional model.
[0129] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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 this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0131] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0132] Similar parts between the embodiments provided in this application can be referred to mutually. 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 extended from the solution of this application without creative effort shall fall within the scope of protection of this application.
Claims
1. A method for voxelizing a three-dimensional model, characterized in that, include: Extract the first bounding box information and patch information of the first model. The first model is a mesh model composed of multiple polygonal patches. The patch information is used to characterize the structure and properties of the polygonal patches. According to the first preset resolution, the target bounding box corresponding to the first bounding box information is divided into blocks to obtain multiple primary sub-bounding boxes, and each primary sub-bounding box corresponds to second bounding box information. Based on the patch 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 the first sub-bounding box and the second sub-bounding box; the first sub-bounding box is the primary sub-bounding box that intersects with the surface of the first model, and the second sub-bounding box is the 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, the inner cavity of the second sub-bounding box is detected to determine the third and fourth sub-bounding boxes; 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, as well as the patch information, 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 according to the preset voxel information. The first voxel information and the second voxel information are integrated to generate target voxel information, which includes a symbolic distance field.
2. The method according to claim 1, characterized in that, The step of performing intersection detection between the plurality of primary sub-bounding boxes and the surface of the first model based on the patch information and the second bounding box information includes: The intersection detection of the coordinate axes of the primary sub-bounding box with the polygonal facets in the first model, the intersection detection of the normal vector axis of the polygonal facets with the coordinate axes of the primary sub-bounding box, and the intersection detection of the cross product axis of the axis direction of the primary sub-bounding box with the edge direction of the polygonal facets.
3. The method according to claim 2, characterized in that, The polygonal patch is a triangular patch; the coordinate axes of the primary sub-bounding box and the polygonal patch in the first model intersect if the coordinate axes of the primary sub-bounding box and the polygonal patch in the first model satisfy the following expression: in, Indicates the primary sub-boundary box B i The minimum coordinate value on the x-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the x-axis. Indicates the primary sub-boundary box B i The minimum coordinate value on the y-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the y-axis. Indicates the primary sub-boundary box B i The minimum coordinate value on the z-axis, Indicates the primary sub-boundary box B i The maximum coordinate value on the z-axis; This represents the projection of the three edges of a polygonal face onto the x-axis of its primary sub-boundary. The minimum value in, This represents the projection of the three edges of a polygonal face onto the x-axis of its primary sub-boundary. The maximum value in; This represents the projection of the three edges of a polygonal patch onto the y-axis of its primary sub-boundary. The minimum value in, This represents the projection of the three edges of a polygonal patch onto the y-axis of its primary sub-boundary. The maximum value in; This represents the projection of the three edges of a polygonal patch onto the z-axis of its primary sub-bounding box. The minimum value in, This represents the projection of the three edges of a polygonal patch onto the z-axis of its primary sub-bounding box. The maximum value in.
4. The method according to claim 2 or 3, characterized in that, The intersection of the normal axis of the polygonal facet and the coordinate axis of the primary sub-bounding box is determined when the following expression is satisfied: n j ·b i,min ≤n j ·v j1 Or, n j ·b i,max ≥n j ·v j1 ; Where, n j Represents a polygonal face f j normal vector axis, b i,min b represents the minimum coordinate value of the primary sub-bounding box on the three coordinate axes. i,max v represents the maximum coordinate value of the primary sub-bounding box on the three coordinate axes. j1 The coordinates of the vertices of the polygonal facet are represented; when i=1, they correspond to the x-axis; when i=2, they correspond to the y-axis; and when i=3, they correspond to the z-axis.
5. The method according to claim 1, characterized in that, The step of performing internal cavity detection on the second sub-bounded box based on the second bounded box information corresponding to the second sub-bounded box to determine the third and fourth sub-bounded boxes includes: Based on the second bounding box information corresponding to the second sub-bounding box, determine the same-layer sub-bounding box that is on the same layer as the second sub-bounding box; Based on the center point of the second sub-bounding box and the center point of the sub-bounding box at the same level, a two-dimensional convex polygon is constructed using the monotonic chain algorithm. Determine whether the center point of the second sub-bounding box is inside the two-dimensional convex polygon. The second sub-bounding box whose center point is inside the two-dimensional convex polygon is determined as the third sub-bounding box, and the second sub-bounding box whose center point is outside the two-dimensional convex polygon is determined as the fourth sub-bounding box.
6. The method according to claim 5, characterized in that, The step of constructing a two-dimensional convex polygon using a monotonic chain algorithm based on the center point of the second sub-bounding box and the center point of the sub-bounding box at the same level includes: The center points of the second sub-bounding box and the center points of the sub-bounding boxes at the same level are sorted in ascending order of x-axis coordinate values, and in the case of the same x-axis coordinate values, in ascending order of y-axis coordinate values, to obtain the sorted set of center points; Based on the x-axis coordinate values in ascending order, determine the center points in the sorted center point set that satisfy the cross product value greater than 0, and construct the lower semi-convex hull shape; Based on the x-axis coordinate values in descending order, determine the center points in the sorted center point set that satisfy the cross product value greater than 0, and construct the upper semi-convex hull shape; The lower convex hull shape and the upper convex hull shape are merged to obtain the two-dimensional convex polygon.
7. The method according to claim 1, characterized in that, The step of performing voxelization on the first and third sub-bounded boxes based on the second bounding box information corresponding to the first and third sub-bounded boxes, and the patch information, to determine the first voxel information, includes: The first sub-boundary box and the third sub-boundary box are sampled according to the second preset resolution to obtain multiple first sampling points; Based on the patch information, collision detection is performed between the plurality of first sampling points and the surface of the first model to determine the unsigned distance field corresponding to the first sampling point. The unsigned distance field is used to characterize the shortest distance from the first sampling point to the surface of the first model. Based on the patch information, the plurality of first sampling points are respectively detected to be inside and outside the surface of the first model to determine the symbol corresponding to the first sampling point. The symbol is used to characterize the inside and outside relationship between the first sampling point and the surface of the first model. The symbolic distance field is determined based on the unsigned distance field and the symbolic distance field.
8. The method according to claim 7, characterized in that, The step of 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 multiple first sampling points are subjected to in-situ and out-of-situ detection on the surface of the first model using the normal vector consistency test method. The expression for the sign corresponding to the first sampling point is: sign(φ(P))=sign((P-Q * )·n * ); Where, sign(φ(P)) represents the sign corresponding to the first sampling point P, sign(·) represents the sign function, φ(P) represents the sign distance function from the first sampling point P to the surface of the first model, and Q * n represents the nearest projection point from the first sampling point P to the surface of the first model. * This represents the normal vector from the first sampling point P to the nearest polygonal facet of the first model.
9. The method according to claim 1, characterized in that, The step of integrating the first voxel information and the second voxel information to generate target voxel information includes: After merging the first voxel information and the second voxel information, the data is converted into binary data format to obtain the target voxel information.
10. A voxelization system for a three-dimensional model, characterized in that, include: Extraction module, segmentation module, intersection detection module, cavity detection module, and voxelization module; The extraction module is used to extract the first bounding box information and patch information of the first model, wherein 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 is used to perform block processing on 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 is used to perform intersection detection between the plurality of primary sub-bounding boxes and the surface of the first model based on the patch information and the second bounding box information, and to 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 cavity detection module is used to perform 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 is used to voxelize the first sub-boundary box and the third sub-boundary box based on the second bounding box information corresponding to the first sub-boundary box and the third sub-boundary 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-boundary box according to the 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, wherein the target voxel information includes a symbolic 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