Triangular patch grid construction method and device, storage medium and electronic equipment

Through layered space division and layer by layer, the method of intersecting sub -virgin is determined, and the problem of low efficiency of the triangular facial grid construction efficiency in existing technologies has been solved, and parallel calculations were used to use the GPU to improve the construction efficiency.

CN119379953AActive Publication Date: 2025-01-28ZHEJIANG LAB

Patent Information

Application Number
CN202411941319.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-01-28
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In the process of building triangular mesh, the GPU cannot be used for parallel computing, resulting in low construction efficiency.

Method used

By obtaining the encirclement box of the target three -dimensional model, and layered in the space division, determine the sub -sterin of each level, according to the sequence of the space resolution from the low and high order, determine the sub -body of the three -dimensional model with the target three -dimensional model, until the construction is constructed Triangle grid.

Benefits of technology

This method is suitable for GPU parallel computing, which improves the efficiency of triangular facial grid construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379953A_ABST
    Figure CN119379953A_ABST
Patent Text Reader

Abstract

The invention discloses a triangular patch grid construction method and device, a storage medium and electronic equipment, and the method comprises the steps: determining a bounding box of a target three-dimensional model of a to-be-printed object, carrying out the layering of the bounding box, and obtaining the sub voxels of each division layer; and according to a sequence of the spatial resolutions from low to high, determining sub voxels intersecting with the target three-dimensional model in each sub voxel of the division hierarchy as intersecting voxels corresponding to the division hierarchy in sequence for each division hierarchy. And constructing a triangular patch grid of the target three-dimensional model according to the intersection point of the intersection voxel corresponding to the last division layer and the target three-dimensional model. In the method, the intersecting voxels are determined according to each division level, that is, the sub voxels of one division level are processed each time, the sub voxels of the same division level do not have a front-back dependency relationship, parallel computing can be performed, the method is suitable for the GPU, and the parallel computing capability of the GPU can be utilized to accelerate the construction process of the triangular patch grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for constructing a triangular face mesh. Background Art

[0002] Additive manufacturing, also known as 3D printing, is a technology that manufactures solid parts by adding materials layer by layer based on a three-dimensional model. When applied, the three-dimensional model needs to be meshed and reconstructed to obtain a triangular mesh. In the triangular mesh, the surface of the three-dimensional model is approximated by triangular patches composed of points and edges. Then, the cross-sectional profile of the solid part is obtained by intersecting the preset bottom-up cutting planes with the triangular mesh data. Finally, according to the cross-sectional profile, the material is added layer by layer from the bottom up to obtain the solid part.

[0003] At present, in the process of constructing a triangular mesh, a multi-tree data structure is used to represent the three-dimensional space. Each node of the multi-tree represents the volume space range of a cube. The volume space range represented by each child node of a node is equal to the volume space range represented by the node. The traditional multi-tree algorithm uses a depth-first traversal method to recursively split the root node from top to bottom until the predetermined maximum depth. GPU does not support recursive calls, so the traditional multi-tree algorithm cannot use GPU for parallel calculation, resulting in low efficiency in constructing triangular meshes.

[0004] Based on this, this specification provides a method for constructing a triangular patch mesh. Summary of the invention

[0005] The present specification provides a triangular mesh construction method, device, storage medium and electronic device to at least partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions: This specification provides a method for constructing a triangular patch mesh, including: Acquire a target three-dimensional model of the object to be printed, and determine a bounding box of the target three-dimensional model; Performing spatial division on the bounding box in layers to obtain sub-voxels at each division level; In order of spatial resolution from low to high, for each division level, in each sub-voxel of the division level, sub-voxels intersecting with the target three-dimensional model are determined as intersection voxels corresponding to the division level; according to each sub-voxel of the next division level among the intersection voxels corresponding to the division level, intersection voxels corresponding to the next division level are continuously determined until the intersection voxels corresponding to the last division level are determined; A triangular patch mesh of the target three-dimensional model is constructed according to intersection points of the intersecting voxels corresponding to the last division level and the target three-dimensional model.

[0007] Optionally, determining a bounding box of the target three-dimensional model specifically includes: Determine the spatial coordinate system where the target three-dimensional model is located; For each coordinate axis of the spatial coordinate system, determining two boundary points of the target three-dimensional model on the coordinate axis; Determine the spatial range of the target three-dimensional model on the coordinate axis according to the two boundary points; According to the spatial range of the target three-dimensional model on each coordinate axis, a bounding box of the target three-dimensional model is determined.

[0008] Optionally, spatially dividing the bounding box hierarchically to obtain sub-voxels at each division level specifically includes: According to the order of spatial resolution from low to high, for each division level, determine the voxels to be divided at the division level; Dividing the voxel to be divided according to the number of divisions corresponding to the division level to obtain sub-voxels of the voxel to be divided; Determining whether the size of each sub-voxel of the voxel to be divided meets the preset resolution; If so, stop the division process; If not, determine the number of divisions at the next division level and continue the division process.

[0009] Optionally, among the sub-voxels of the division level, determining the sub-voxels intersecting with the target three-dimensional model as the intersecting voxels corresponding to the division level specifically includes: Among the sub-voxels of the division level, determining the sub-voxels that need to be calculated as the voxels to be calculated at the division level; According to the distance between the voxel to be calculated at the division level and the surface of the target three-dimensional model, the sub-voxel intersecting with the target three-dimensional model is determined as the intersecting voxel corresponding to the division level; the intersecting voxel corresponding to the division level is used as the voxel to be calculated at the next division level.

[0010] Optionally, among the sub-voxels of the division level, determining the sub-voxels that need to be distance calculated as the voxels to be calculated of the division level specifically includes: When the division level is the first division level, each sub-voxel of the division level is used as the voxel to be calculated of the division level; When the division level is not the first division level, each sub-voxel obtained by dividing the intersecting voxels corresponding to the previous division level is used as the voxels to be calculated in the division level.

[0011] Optionally, according to the distance from the voxel to be calculated at the division level to the surface of the target three-dimensional model, determining the sub-voxel intersecting with the target three-dimensional model as the intersecting voxel corresponding to the division level specifically includes: Calculating the distances of the vertices of the voxels to be calculated at the divided level to the surface of the target three-dimensional model respectively; Determine whether there is a distance less than a preset value among the calculated distances; If yes, it is determined that the voxel to be calculated is the intersection voxel corresponding to the division level; If not, it is determined that the voxel to be calculated is not an intersection voxel corresponding to the division level.

[0012] Optionally, constructing a triangular face mesh of the target three-dimensional model according to the intersection points of the intersecting voxels corresponding to the last division level and the target three-dimensional model specifically includes: Determine each edge of the intersecting voxels corresponding to the last partition level; For each edge, respectively calculating the signed distance between two vertices corresponding to the edge and the target three-dimensional model; When the signed distances between the two vertices and the target three-dimensional model are of different signs, interpolation is performed on the edge to determine an interpolation point on the edge, and based on the interpolation point, an intersection point between the edge and the target three-dimensional model is determined; A triangular patch mesh of the target three-dimensional model is constructed according to the intersection points of the edges of the intersecting voxels corresponding to the last division level and the target three-dimensional model.

[0013] This specification provides a triangular face mesh construction device, the device comprising: An acquisition module is used to acquire a target three-dimensional model of the object to be printed and determine a bounding box of the target three-dimensional model; A division module is used to divide the bounding box into layers and obtain sub-voxels at each division level; The hierarchical calculation module determines, for each division level in order from low to high spatial resolution, sub-voxels intersecting with the target three-dimensional model in each sub-voxel of the division level as intersection voxels corresponding to the division level; and continues to determine intersection voxels corresponding to the next division level according to each sub-voxel of the next division level among the intersection voxels corresponding to the division level, until the intersection voxels corresponding to the last division level are determined; A mesh construction module constructs a triangular face mesh of the target three-dimensional model according to intersection points between the intersecting voxels corresponding to the last division level and the target three-dimensional model.

[0014] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned triangular patch mesh construction method is implemented.

[0015] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned triangular face mesh construction method when executing the program.

[0016] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects: In the triangular patch mesh construction method provided in the present specification, a target three-dimensional model of an object to be printed is obtained, a bounding box of the target three-dimensional model is determined, and the bounding box is spatially divided into layers to obtain sub-voxels of each division level. In order of spatial resolution from low to high, for each division level, in each sub-voxel of the division level, the sub-voxel that intersects with the target three-dimensional model is determined as the intersection voxel corresponding to the division level. According to the intersection point between the intersection voxel corresponding to the last division level and the target three-dimensional model, a triangular patch mesh of the target three-dimensional model is constructed. In the present method, the intersection voxel is determined according to each division level, that is, the sub-voxel of one division level is processed each time, and there is no front-to-back dependency between the sub-voxels of the same division level, and they can be calculated in parallel. Therefore, the present method is suitable for GPU, and the parallel computing capability of GPU can be used to accelerate the construction process of the triangular patch mesh. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings: Figure 1 A schematic diagram of a process of constructing a triangular face mesh in this specification; Figure 2 A tree structure diagram of a target three-dimensional model provided in an embodiment of this specification; Figure 3 A schematic diagram of the meaning of symbol distance provided in this manual; Figure 4 A schematic diagram of a triangular face mesh construction device provided in this specification; Figure 5 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0019] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0020] Figure 1 The following is a flow chart of a method for constructing a triangular mesh in this specification, which specifically includes the following steps: S100: Acquire a target three-dimensional model of an object to be printed, and determine a bounding box of the target three-dimensional model.

[0021] All steps in the triangular face mesh construction method provided in this specification can be implemented by any electronic device with computing functions, such as a terminal, a server, etc. For ease of description, the triangular face mesh construction method provided in this specification is described below using only a server as the execution subject.

[0022] In the application scenario of this specification, the object to be printed can be a solid part as a whole or a cell structure of a solid part. The target three-dimensional model of the object to be printed can be determined by an implicit function, designed by a modeling software, or scanned by a 3D scanner.

[0023] The server may then determine a bounding box for the target three-dimensional model.

[0024] In one or more embodiments of the present specification, the server determines the spatial coordinate system where the target three-dimensional model is located, and for each coordinate axis of the spatial coordinate system, determines two boundary points of the target three-dimensional model on the coordinate axis. Based on the two boundary points, the spatial range of the target three-dimensional model on the coordinate axis is determined.

[0025] This specification does not limit the specific method of determining the boundary points. For example, the server can determine the spatial range on the three coordinate axes based on the domain of the implicit function. The server can also determine the projection surface of the target three-dimensional model on the three coordinate planes, and determine the projection length of each projection surface parallel to the three coordinate axes. Among the projection lengths, the largest projection length is used as the side length of the cube to construct a bounding box. Alternatively, the server can also determine the axis-aligned bounding box (AABB), oriented bounding box (OBB), etc. of the target three-dimensional model as the bounding box of the target three-dimensional model in this step.

[0026] The bounding box represents the spatial range of the target 3D model in the 3D space coordinate system. The bounding box can be regarded as the root node of the space division. In the subsequent steps, the server can perform space division at various levels based on the bounding box.

[0027] S102: spatially divide the bounding box into layers to obtain sub-voxels at each division level.

[0028] In this specification, the server uses the bounding box of the target 3D model as the root node and divides the bounding box into layers according to the tree structure. The specific division level can be determined according to the volume of the target 3D model and the required spatial resolution. The deeper the division level, the smaller the size of each sub-voxel obtained by the division level, and the higher the corresponding spatial resolution.

[0029] The server determines the voxels to be divided at each division level in order from low to high spatial resolution.

[0030] Specifically, when the division level is the first division level, the server divides the volume space corresponding to the bounding box, and uses the bounding box of the target three-dimensional model as the voxel to be divided at the division level. When the division level is not the first division level, each sub-voxel obtained at the previous division level is used as the voxel to be divided at the division level. That is, the number of voxels to be divided at the first division level is one, and the number of voxels to be divided at other division levels is multiple.

[0031] Secondly, the server divides the voxel to be divided according to the number of divisions corresponding to the division level, and obtains sub-voxels of the voxel to be divided.

[0032] This specification does not limit the number of divisions at each division level, and the number of divisions at different division levels may be the same or different.

[0033] When the division level is the first division level, the voxel to be divided is the bounding box of the target three-dimensional model, and the server divides the bounding box of the target three-dimensional model according to the division quantity corresponding to the first division level to obtain each sub-voxel of the first division level.

[0034] When the division level is not the first division level, the voxels to be divided are the sub-voxels obtained from the previous division level. The server uses each sub-voxel obtained from the previous division level as the voxel to be divided, divides the voxel to be divided according to the number of divisions corresponding to the division level, and obtains the sub-voxels divided from the voxel to be divided.

[0035] Figure 2 A tree structure diagram of a target three-dimensional model provided in an embodiment of this specification is shown in FIG. Figure 2 As shown, the division level is 3, and the number of divisions at each division level is set to 64. 3 , 16 3 , 4 3 The first level of division is to divide each side of the bounding box of the target 3D model into 64 equal parts, and obtain 64 3 In the second division level, for each sub-voxel obtained in the first division, the sub-voxel is used as the voxel to be divided, and each side of the voxel to be divided is divided into 16 equal parts, so the voxel to be divided is divided into 16 3 After the second level of division, the bounding box of the target 3D model is divided into (64×16) 3 At the third division level, for each sub-voxel obtained from the second division, the sub-voxel is used as the voxel to be divided, and each side of the voxel to be divided is divided into 4 equal parts, so that the voxel to be divided is divided into 4 3 After the third level of division, the bounding box of the target 3D model is divided into (64×16×4) 3 Subvoxels.

[0036] Then, the server determines whether the size of each sub-voxel of the to-be-divided voxel meets the preset resolution. If so, the division process is stopped. If not, the number of divisions at the next division level is determined and the division process is continued.

[0037] For objects of different sizes or structures to be printed, the accuracy of the triangular mesh to be constructed is different. Generally, for objects to be printed that are larger in size or more complex in structure, the target 3D model needs to be divided into smaller sub-voxels, that is, the size of the sub-voxels obtained by division needs to achieve a higher spatial resolution.

[0038] For each division level, the size of each sub-voxel obtained at the division level is determined according to the size of the voxel to be divided at the division level and the number of divisions at the division level. For example, if the bounding box size of the target 3D model is a 3 , the number of partitions at the first partition level is 64 3 When , the size of each subvoxel obtained by the first partitioning level is .

[0039] For each division level, after obtaining the subvoxels of the division level, the server determines whether the size of the subvoxels obtained at the division level meets the preset resolution based on the preset resolution, and the preset resolution is the minimum distinguishing side length of adjacent subvoxels.

[0040] When the server determines that the side length of the sub-voxel obtained at the division level is not greater than the preset resolution, the server stops the division process.

[0041] S104: In order of spatial resolution from low to high, for each division level, in each sub-voxel of the division level, determine the sub-voxels that intersect with the target three-dimensional model as the intersection voxels corresponding to the division level; according to each sub-voxel of the next division level among the intersection voxels corresponding to the division level, continue to determine the intersection voxels corresponding to the next division level, until the intersection voxels corresponding to the last division level are determined.

[0042] After the above-mentioned hierarchical division, the three-dimensional space where the target three-dimensional model is located is represented by a multi-tree data structure, and the bounding box of the target three-dimensional model is the root node.

[0043] In the triangular mesh construction method of this specification, the server uses a hierarchical traversal method to calculate the nodes of each division level, that is, the sub-voxels obtained at each division level. For each sub-voxel of a division level, since there is no dependency relationship between the sub-voxels, a GPU thread can be allocated to each sub-voxel for parallel calculation to speed up the triangular mesh construction process.

[0044] The server determines, for each division level in order from low to high spatial resolution, sub-voxels intersecting with the target three-dimensional model in each sub-voxel of the division level as intersecting voxels corresponding to the division level.

[0045] First, the server determines, among the sub-voxels of the division level, the sub-voxels that need to be distance calculated as the voxels to be calculated of the division level.

[0046] In this specification, the server needs to determine the subvoxels that intersect with the target 3D model, and further determine the boundary of the target 3D model based on the intersecting subvoxels. Therefore, the server needs to calculate the distance between the subvoxel and the surface of the target 3D model to determine whether the subvoxel intersects with the target 3D model.

[0047] Specifically, when the division level is the first division level, each sub-voxel of the division level is used as the voxel to be calculated of the division level. When the division level is not the first division level, each sub-voxel obtained by dividing the intersecting voxel corresponding to the previous division level is used as the voxel to be calculated of the division level.

[0048] In this embodiment, the server allocates GPU threads to the determined voxels to be calculated, and does not calculate the voxels that are not to be calculated, thereby saving storage and computing resources.

[0049] Then, the server determines the sub-voxels intersecting with the target three-dimensional model as the intersecting voxels corresponding to the division level according to the distance from the voxels to be calculated at the division level to the surface of the target three-dimensional model; and uses the intersecting voxels corresponding to the division level as the voxels to be calculated at the next division level.

[0050] The voxel to be calculated is in the shape of a cube with 8 vertices. When any of the 8 vertices intersects with the target 3D model, the voxel to be calculated intersects with the target 3D model. Ideally, when the distance between a vertex and the surface of the target 3D model is 0, it means that the vertex intersects with the target 3D model. Due to the limitation of spatial resolution, the intersection point of the voxel to be calculated and the target 3D model may not be exactly the vertex of the voxel to be calculated. However, if the voxel to be calculated intersects with the target 3D model, there is a vertex in the voxel to be calculated that is smaller than the surface distance of the target 3D model.

[0051] Therefore, the server calculates the distances from each vertex of the voxel to be calculated in the division level to the surface of the target three-dimensional model, and determines whether there is a distance less than a preset value from each vertex to the surface of the target three-dimensional model. If so, it is determined that the voxel to be calculated is the intersection voxel corresponding to the division level. If not, it is determined that the voxel to be calculated is not the intersection voxel corresponding to the division level. The distance calculation method here can be Euclidean distance, signed distance field (SDF), etc.

[0052] The size of each sub-voxel obtained by the next division level of the division level is smaller than the size of each sub-voxel obtained by the division level of the division level. When it is determined that a sub-voxel of the division level is not an intersection voxel, it means that there is no intersection between the sub-voxel and the surface of the target three-dimensional model. Then, the sub-voxel with a smaller size obtained by further division of the sub-voxel will not have any intersection with the surface of the target three-dimensional model.

[0053] When a sub-voxel of the division level is determined to be an intersection voxel, it means that there is an intersection between the sub-voxel and the surface of the target 3D model. In order to determine the intersection between the surface of the target 3D model and the intersection voxel, it is necessary to continue to calculate the distance for the sub-voxels contained in the intersection voxel to determine the exact intersection position. Therefore, the server will continue to divide the sub-voxels obtained based on the intersection voxel of the division level as the voxels to be calculated in the next division level.

[0054] S106: Constructing a triangular patch mesh of the target three-dimensional model according to intersection points of the intersecting voxels corresponding to the last division level and the target three-dimensional model.

[0055] In the above steps, the server calculates the distance between each sub-voxel and the surface of the target three-dimensional model in parallel for the sub-voxels contained in each division level, and finally determines the intersecting voxels of the last division level.

[0056] The server may construct a triangular patch mesh based on intersection points of the intersecting voxels of the last partitioning level and the target three-dimensional model.

[0057] Specifically, the server determines the intersecting voxels of the last division level, which intersect with the contour of the surface of the target three-dimensional model.

[0058] For each intersecting voxel of the last partitioning level, determine the edges of the intersecting voxel. For each edge, calculate the signed distance field (SDF) between the two vertices of the edge and the target 3D model.

[0059] If the signed distance is a positive value, it means that the vertex is outside the target 3D model. If the signed distance is a negative value, it means that the vertex is inside the target 3D model. If the signed distance is zero, it means that the vertex is on the surface of the target 3D model.

[0060] If the edge intersects with the surface of the target 3D model, it means that the edge runs through the inside and outside of the target 3D model, and the two vertices of the edge have one positive value and one negative value. Therefore, when the signed distances of the two vertices of the edge have different signs, the server determines that the edge has an intersection with the target 3D model.

[0061] Specifically, when the server determines that there is an intersection between the edge and the target three-dimensional model, the midpoint of the edge may be taken as the intersection between the edge and the target three-dimensional model.

[0062] Figure 3A schematic diagram of the meaning of a signed distance provided in this specification, with shading indicating the range of voxels located inside the target three-dimensional model. In the voxel on the left, the signed distances of the eight vertices are all less than zero, indicating that the voxel is located inside the target three-dimensional model and has no intersection with the target three-dimensional model. In the voxel on the right, the signed distances of the eight vertices are all greater than zero, indicating that the voxel is located outside the target three-dimensional model and has no intersection with the target three-dimensional model. In the middle voxel, the voxel intersects with the target three-dimensional model, the signed distance of vertex A is greater than zero, the signed distance of vertex B is less than zero, and the position of vertex B is close to the intersection, and the signed distance of vertex B is close to zero.

[0063] Finally, after calculating the intersection of the voxel and the target 3D model, the server can generate a triangular mesh based on the intersection. There are many ways to generate a triangular mesh, such as Marching Cubes (MC) and Dual Contouring (DC).

[0064] In this specification, the distances between each sub-voxel of the same layer and the target three-dimensional model are calculated in parallel, which can quickly determine the intersecting voxels and speed up the generation of the triangular patch mesh.

[0065] In the triangular patch mesh construction method provided in the present specification, a target three-dimensional model of an object to be printed is obtained, a bounding box of the target three-dimensional model is determined, and the bounding box is spatially divided into layers to obtain sub-voxels of each division level. In order of spatial resolution from low to high, for each division level, in each sub-voxel of the division level, the sub-voxel that intersects with the target three-dimensional model is determined as the intersection voxel corresponding to the division level. According to the intersection point between the intersection voxel corresponding to the last division level and the target three-dimensional model, a triangular patch mesh of the target three-dimensional model is constructed. In the present method, the intersection voxel is determined according to each division level, that is, the sub-voxel of one division level is processed each time, and there is no front-to-back dependency between the sub-voxels of the same division level, and they can be calculated in parallel. Therefore, the present method is suitable for GPU, and the parallel computing capability of GPU can be used to accelerate the construction process of the triangular patch mesh.

[0066] In one embodiment, in the above step S108, after the triangular face mesh of the target three-dimensional model is obtained, the watertightness of the triangular face mesh can be detected by using mesh repair tools such as MeshLab and Netfabb to determine whether the triangular face mesh is watertight, that is, without any gaps or missing parts, before it is used for 3D printing of the object to be printed.

[0067] In the above step S108, for the edge determined to intersect with the target three-dimensional model, the server interpolates the edge, determines the interpolation point on the edge, and determines the intersection point of the edge with the target three-dimensional model based on the interpolation point.

[0068] For each interpolation point, the server calculates the distance between the interpolation point and the surface of the target 3D model. The distance can be Euclidean distance, Signed Distance Field (SDF), etc. The closer the value of the distance is to zero, the closer the interpolation point is to the actual intersection point of the surface of the target 3D model.

[0069] The server determines, among the interpolation points, an interpolation point whose distance to the surface of the target three-dimensional model is closest to zero as the intersection point of the edge with the target three-dimensional model.

[0070] This specification does not limit the specific number of interpolation points and the specific interpolation method, and interpolation methods such as linear interpolation and nonlinear interpolation can be used. The more interpolation points there are, the higher the accuracy of the final intersection point.

[0071] The above is the triangular face mesh construction method provided in this specification. Based on the same idea, this specification also provides a corresponding triangular face mesh construction device, such as Figure 4 shown.

[0072] Figure 4 A schematic diagram of a triangular face mesh construction device provided in this specification specifically includes: An acquisition module 200 is used to acquire a target three-dimensional model of the object to be printed and determine a bounding box of the target three-dimensional model; A division module 202 is used to perform spatial division on the bounding box layer by layer to obtain sub-voxels at each division layer; The hierarchical calculation module 204 is used to determine, in order of spatial resolution from low to high, for each division level, among the sub-voxels of the division level, the sub-voxels intersecting with the target three-dimensional model as the intersection voxels corresponding to the division level; and continue to determine the intersection voxels corresponding to the next division level according to the sub-voxels of the next division level among the intersection voxels corresponding to the division level, until the intersection voxels corresponding to the last division level are determined; The mesh construction module 206 is used to construct a triangular face mesh of the target three-dimensional model according to the intersection points of the intersecting voxels corresponding to the last division level and the target three-dimensional model.

[0073] Optionally, the acquisition module 200 is specifically used to determine the spatial coordinate system where the target three-dimensional model is located, and for each coordinate axis of the spatial coordinate system, determine two boundary points of the target three-dimensional model on the coordinate axis, determine the spatial range of the target three-dimensional model on the coordinate axis based on the two boundary points, and determine the bounding box of the target three-dimensional model based on the spatial range of the target three-dimensional model on each coordinate axis.

[0074] Optionally, the division module 202 is specifically used to determine the voxels to be divided at each division level in order from low to high spatial resolution, divide the voxels to be divided according to the number of divisions corresponding to the division level, obtain sub-voxels of the voxels to be divided, and determine whether the size of each sub-voxel of the voxel to be divided meets the preset resolution. If so, stop the division process; if not, determine the number of divisions at the next division level and continue the division process.

[0075] Optionally, the hierarchical calculation module 204 is specifically used to determine, among the sub-voxels of the division level, the sub-voxels that need to be distance calculated, as the voxels to be calculated of the division level, and according to the distance from the voxels to be calculated of the division level to the surface of the target three-dimensional model, determine the sub-voxels intersecting with the target three-dimensional model as the intersection voxels corresponding to the division level, and use the intersection voxels corresponding to the division level as the voxels to be calculated of the next division level.

[0076] Optionally, the hierarchical calculation module 204 is specifically used to, when the division level is the first division level, use each sub-voxel of the division level as the voxel to be calculated of the division level; when the division level is not the first division level, use each sub-voxel obtained by dividing the intersecting voxels corresponding to the previous division level as the voxel to be calculated of the division level.

[0077] Optionally, the hierarchical calculation module 204 is specifically used to calculate the distances from each vertex of the voxel to be calculated in the division level to the surface of the target three-dimensional model, and determine whether there is a distance less than a preset value among the calculated distances. If so, it is determined that the voxel to be calculated is the intersecting voxel corresponding to the division level. If not, it is determined that the voxel to be calculated is not the intersecting voxel corresponding to the division level.

[0078] Optionally, the mesh construction module 206 is specifically used to determine each edge of the intersecting voxels corresponding to the last division level, and for each edge, respectively calculate the signed distance between the two vertices corresponding to the edge and the target three-dimensional model; when the signed distances between the two vertices and the target three-dimensional model are of different signs, interpolation is performed on the edge to determine the interpolation point on the edge, and based on the interpolation point, the intersection of the edge and the target three-dimensional model is determined; and based on the intersection of the edges of the intersecting voxels corresponding to the last division level and the target three-dimensional model, a triangular face mesh of the target three-dimensional model is constructed.

[0079] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Provides a method for constructing a triangular patch mesh.

[0080] This manual also provides Figure 5 The schematic structure diagram of the electronic device shown in FIG. Figure 5 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The triangular mesh construction method described above. Of course, in addition to the software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0081] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0082] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0083] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0084] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0085] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0086] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0089] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0090] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0091] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0092] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0093] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0094] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0095] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0096] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.

Claims

1. A method for constructing a triangular patch mesh, characterized in that: include: Acquire a target three-dimensional model of the object to be printed, and determine a bounding box of the target three-dimensional model; Performing spatial division on the bounding box in layers to obtain sub-voxels at each division level; In order of spatial resolution from low to high, for each division level, in each sub-voxel of the division level, sub-voxels intersecting with the target three-dimensional model are determined as intersection voxels corresponding to the division level; according to each sub-voxel of the next division level among the intersection voxels corresponding to the division level, intersection voxels corresponding to the next division level are continuously determined until the intersection voxels corresponding to the last division level are determined; A triangular patch mesh of the target three-dimensional model is constructed according to intersection points of the intersecting voxels corresponding to the last division level and the target three-dimensional model.

2. The method according to claim 1, characterized in that Determining the bounding box of the target three-dimensional model specifically includes: Determine the spatial coordinate system where the target three-dimensional model is located; For each coordinate axis of the spatial coordinate system, determining two boundary points of the target three-dimensional model on the coordinate axis; Determine the spatial range of the target three-dimensional model on the coordinate axis according to the two boundary points; According to the spatial range of the target three-dimensional model on each coordinate axis, a bounding box of the target three-dimensional model is determined.

3. The method according to claim 1, characterized in that The bounding box is spatially divided into layers to obtain sub-voxels at each division level, specifically including: According to the order of spatial resolution from low to high, for each division level, determine the voxels to be divided at the division level; Dividing the voxel to be divided according to the number of divisions corresponding to the division level to obtain sub-voxels of the voxel to be divided; Determining whether the size of each sub-voxel of the voxel to be divided meets the preset resolution; If so, stop the division process; If not, determine the number of divisions at the next division level and continue the division process.

4. The method according to claim 1, characterized in that Among the sub-voxels of the division level, determining the sub-voxels intersecting with the target three-dimensional model as the intersecting voxels corresponding to the division level specifically includes: Among the sub-voxels of the division level, determining the sub-voxels that need to be calculated as the voxels to be calculated at the division level; According to the distance between the voxel to be calculated at the division level and the surface of the target three-dimensional model, the sub-voxel intersecting with the target three-dimensional model is determined as the intersecting voxel corresponding to the division level; the intersecting voxel corresponding to the division level is used as the voxel to be calculated at the next division level.

5. The method according to claim 4, characterized in that Among the sub-voxels of the division level, the sub-voxels that need to be calculated are determined as the voxels to be calculated of the division level, specifically including: When the division level is the first division level, each sub-voxel of the division level is used as the voxel to be calculated of the division level; When the division level is not the first division level, each sub-voxel obtained by dividing the intersecting voxels corresponding to the previous division level is used as the voxels to be calculated in the division level.

6. The method according to claim 4, characterized in that According to the distance from the voxel to be calculated at the division level to the surface of the target three-dimensional model, determining the sub-voxel intersecting with the target three-dimensional model as the intersecting voxel corresponding to the division level specifically includes: Calculating the distances of the vertices of the voxels to be calculated at the divided level to the surface of the target three-dimensional model respectively; Determine whether there is a distance less than a preset value among the calculated distances; If yes, it is determined that the voxel to be calculated is the intersection voxel corresponding to the division level; If not, it is determined that the voxel to be calculated is not an intersection voxel corresponding to the division level.

7. The method according to claim 1, characterized in that Constructing a triangular face mesh of the target three-dimensional model according to the intersection voxels corresponding to the last division level and the intersection points of the target three-dimensional model, specifically comprising: Determine each edge of the intersecting voxels corresponding to the last partition level; For each edge, respectively calculating the signed distance between two vertices corresponding to the edge and the target three-dimensional model; When the signed distances between the two vertices and the target three-dimensional model are of different signs, interpolation is performed on the edge to determine an interpolation point on the edge, and based on the interpolation point, an intersection point between the edge and the target three-dimensional model is determined; A triangular patch mesh of the target three-dimensional model is constructed according to the intersection points of the edges of the intersecting voxels corresponding to the last division level and the target three-dimensional model.

8. A triangular patch mesh construction device, characterized in that: include: An acquisition module is used to acquire a target three-dimensional model of the object to be printed and determine a bounding box of the target three-dimensional model; A division module is used to divide the bounding box into layers and obtain sub-voxels at each division level; The hierarchical calculation module determines, for each division level in order from low to high spatial resolution, sub-voxels intersecting with the target three-dimensional model in each sub-voxel of the division level as intersection voxels corresponding to the division level; and continues to determine intersection voxels corresponding to the next division level according to each sub-voxel of the next division level among the intersection voxels corresponding to the division level, until the intersection voxels corresponding to the last division level are determined; A mesh construction module constructs a triangular face mesh of the target three-dimensional model according to intersection points between the intersecting voxels corresponding to the last division level and the target three-dimensional model.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Automatic restoration method of three-dimensional digital geometric grid model structure

    CN103617603A

  • Voxelization processing method and device based on triangular mesh model

    CN108921928A

  • Three-dimensional model rapid voxelization method based on slicing strategy

    CN110889903A

  • Quick voxelization method for three-dimensional model based on GPU (Graphics Processing Unit)

    CN112927334A

  • Three-dimensional model voxelization and finite element mesh generation method based on symbolic distance field

    CN116757037A

Cited By

  • Slicing method and system, computer equipment, storage medium and product

    CN119577872A

  • Three-dimensional model filling method and device, storage medium and electronic equipment

    CN119579841A

  • Grid model normalizing method, related device, equipment and medium

    CN120876748A