Three-dimensional modeling method and system based on lattice structure
By using implicit methods to represent lattice structures using mathematical function expressions, the problems of large data volume and high computational cost in 3D modeling of large-scale lattice structures are solved, and efficient and accurate 3D modeling effects are achieved.
Patent Information
- Application Number
- CN202510580680.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-05-07
AI Technical Summary
When constructing three-dimensional models of large-scale lattice structures, existing technologies have problems such as large data volume, high computing processing costs and low precision, which makes it impossible to achieve efficient and accurate three-dimensional modeling based on lattice structures.
The structural function based on polygonal mesh model and target lattice unit cell is adopted. The implicit modeling method is used to express the lattice structure using mathematical function expression. The target lattice unit cell is filled and arranged to generate the target three-dimensional model, which avoids a large amount of mesh intersection processing and reduces computational cost and memory usage.
It enables the rapid and accurate construction of three-dimensional models of large-scale complex lattice structures, improves modeling accuracy and efficiency, and reduces computing costs and memory requirements.
Smart Images

Figure CN120689546A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional modeling, and in particular to a three-dimensional modeling method and system based on a lattice structure. Background Art
[0002] The lattice structure is composed of continuous and periodically arranged unit cells (or lattice unit cells). It has excellent properties such as high design freedom, high specific stiffness, high strength, and light weight. Therefore, it is widely used in aerospace, automotive engineering, life sciences, tissue engineering and other fields. Specifically, the structure of the lattice unit cell can be divided into a prismatic structure, a truss structure and a structure based on a three-periodic minimal surface. Among them, the lattice unit cell of the truss structure is more widely used. The lattice unit cell of the truss structure is formed by the connection between rods, and the distribution and number of rod units can be flexibly adjusted according to demand to meet diverse application needs.
[0003] Related methods for 3D modeling based on lattice structures primarily represent 3D models through skeleton structures or mesh representations. Skeleton structures construct 3D models based on the lattice structure using a node-to-node and line-to-line-segment structure, supplemented by other shape parameters. Mesh representations represent 3D models by fitting triangular facets to a surface.
[0004] However, for skeletal structures, as the size of the three-dimensional model increases or the size of the lattice unit cell decreases, the overall scale of the three-dimensional model will grow rapidly, and the number of pillars of the lattice structure can reach millions. Especially when constructing large-scale lattice structures, the structural data that needs to be stored will increase exponentially, and a large amount of structural data is difficult to store and process efficiently. The grid representation method is difficult to achieve a balance between accuracy and data volume when facing lattice structures with complex structures and fine features. High accuracy requires the fitting of more triangular facets, which will also greatly increase the data size, thereby increasing the computational cost and memory storage usage. It can be seen that for the construction of three-dimensional models with large-scale lattice structures, the relevant technologies have problems such as large data processing volume, high computational processing cost and low accuracy, which makes it impossible to efficiently and accurately implement three-dimensional modeling based on lattice structures. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that it is impossible to efficiently and accurately implement three-dimensional modeling based on a lattice structure.
[0006] To solve the above technical problems, the present invention provides a three-dimensional modeling method and system based on a lattice structure, which specifically adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a lattice-based three-dimensional modeling method, comprising: first, extracting 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, based on the bounding box information, the patch information, and a first preset point cloud resolution, the first model is converted into a first discrete point cloud model. The first discrete point cloud model includes a first signed distance field, which is used to characterize the distance and positional relationship between sampling points in the first discrete point cloud model and the surface of the first model. Next, determining the unit cell type and the structure function corresponding to the unit cell type of a target lattice unit cell. Next, based on the bounding box information and the structure function, a model filling algorithm is used to fill the target lattice unit cell within the target bounding box corresponding to the bounding box information to determine the target lattice structure function field. Then, voxelization is performed based on the target lattice structure function field and a second preset point cloud resolution to generate a second discrete point cloud model, which includes the first voxel information. Finally, the first discrete point cloud model and the second discrete point cloud model are merged to generate a target three-dimensional model, which includes the second voxel information.
[0008] This method, based on a polygonal mesh model and the structure functions of a target lattice unit cell, uses implicit modeling (i.e., mathematical function expression) to fill and arrange the target lattice unit cells to construct a lattice-based three-dimensional model. This method can also represent the lattice structure's three-dimensional model through an implicit field (function field). Because this method uses mathematical function expressions to represent the lattice structure, it avoids extensive mesh intersection processing during model construction, effectively reducing the computational cost, time, and memory usage of the model building process. It also addresses the low fitting accuracy of models represented by mesh-fitted surfaces, enabling rapid and accurate modeling of large-scale, complex lattice structures. This effectively improves the accuracy and efficiency of lattice-based three-dimensional modeling.
[0009] In conjunction with the first aspect, in an optional implementation, converting the first model into a first discrete point cloud model based on the bounding box information, the patch information, and the first preset point cloud resolution includes: first, determining a target bounding box based on the bounding box information. Then, generating a sampling point cloud model based on the target bounding box and the first preset point cloud resolution. Next, determining the distance and positional relationship between sampling points in the sampling point cloud model and the surface of the first model based on the patch information to obtain a first signed distance field. Finally, generating the first discrete point cloud model based on the sampling point cloud model and the first signed distance field.
[0010] In this implementation, a sampling point cloud model is generated based on the target bounding box at a first preset point cloud resolution, and then a first signed distance field is determined. Finally, based on the sampling point cloud model and the first signed distance field, a first discrete point cloud model can be accurately generated for constructing the target 3D model.
[0011] In combination with the first aspect, in an optional implementation, the above-mentioned patch information includes: patch vertex coordinate information and surface normal information; the first signed distance field includes: a first distance value and a first sign. The above-mentioned determination of the distance and positional relationship between the sampling point in the sampling point cloud model and the surface of the first model based on the patch information to obtain the first signed distance field includes: determining the first distance value based on the coordinate information of the sampling point in the sampling point cloud model and the patch vertex coordinate information. Determining the first sign based on the coordinate information of the sampling point in the sampling point cloud model, the patch vertex coordinate information, and the surface normal information. Wherein, when the first sign is a positive value, it indicates that the sampling point in the first discrete point cloud model is outside the first model; when the first sign is a negative value, it indicates that the sampling point in the first discrete point cloud model is inside the first model; when the first sign is 0, it indicates that the sampling point in the first discrete point cloud model is on the surface of the first model.
[0012] In this implementation, the first signed distance field can be accurately determined by sampling the coordinate information of the sampling points, the coordinate information of the surface vertices, and the surface normal information in the point cloud model.
[0013] In conjunction with the first aspect, in one optional implementation, the model filling algorithm includes a permutation function and a geometric control function. Based on the bounding box information and the structure function, the model filling algorithm fills the target lattice unit cells within the target bounding box corresponding to the bounding box information to determine the target lattice structure function field. This includes: first, performing a modulo operation on the target lattice unit cells based on the structure function using the permutation function to periodically arrange the target lattice unit cells within the target bounding box to obtain an arranged lattice function. Then, using the geometric control function, based on preset lattice geometric parameters, the target lattice unit cells in the arranged lattice function are adjusted to obtain the target lattice structure function field; the preset lattice geometric parameters include a size scaling factor and a thickness parameter.
[0014] In this implementation, the target lattice structure function field can be determined quickly and accurately through the arrangement function and the geometric control function.
[0015] In combination with the first aspect, in an optional implementation method, the above-mentioned first voxel information includes: a second signed distance field, which is a target lattice structure function field generated according to a second preset point cloud resolution; the second signed distance field is used to characterize the distance and position relationship between the sampling point and the target lattice unit cell in the second discrete point cloud model.
[0016] In conjunction with the first aspect, in an optional implementation, the unit cell type is one of the following structures: a simple cubic truss structure, a body-centered cubic truss structure, a face-centered cubic truss structure, or a custom unit cell structure. The structure function of the simple cubic truss structure is expressed as:
[0017]
[0018] Among them, sc(q1,e1) represents the structure function of the simple cubic truss structure, q1 represents a point in the unit cell domain of the simple cubic truss structure, e1 represents the thickness parameter of the simple cubic truss structure, q 1x Indicates the x-axis coordinate value of point q1, q 1y Indicates the y-axis coordinate value of point q1, q 1z Indicates the z-axis coordinate value of point q1, o x Indicates q 1x The square value of o y Indicates q 1y The square value of o z Indicates q 1z The square value of . The structural function of the body-centered cubic truss structure is expressed as:
[0019]
[0020] m1=|q2|=(|q 2x |,|q 2y |,|q 2z |);
[0021] m 1x =|q 2x |,m 1y =|q 2y |,m 1z =|q 2z |;
[0022] Among them, bcc(q2,e2) represents the structure function of the body-centered cubic truss structure, q2 represents a point in the unit cell of the body-centered cubic truss structure, e2 represents the thickness parameter of the body-centered cubic truss structure, q 2x Indicates the x-axis coordinate value of point q2, q 2y Indicates the y-axis coordinate value of point q2, q 2z represents the z-axis coordinate value of point q2, m1 represents the absolute value of the coordinate of point q2, and m 1x Indicates q 2x The absolute value of m 1y Indicates q 2y The absolute value of m 1z Indicates q 2z The absolute value of . The structural function of the face-centered cubic truss structure is expressed as:
[0023] fcc(q3,e3)=min(min(|m xy -(n x +n y ),m 2z |,|m xz -(n x +n z ),m 2y |),
[0024] |m yz -(n y +n z ),m 2x |)-e3;
[0025] m xy =|q 3x |·|q 3y |;
[0026] m xz =|q 3x |·|q 3z |;
[0027] m yz =|q 3y |·|q 3z |;
[0028] m 2x =|q 3x |,m 2y =|q 3y |,m 2z =|q 3z |;
[0029]
[0030] Among them, fcc(q3,e3) represents the structure function of the face-centered cubic truss structure, q3 represents a point in the unit cell of the face-centered cubic truss structure, e3 represents the thickness parameter of the face-centered cubic truss structure, q 3x Indicates the x-axis coordinate value of point q3, q 3y Indicates the y-axis coordinate value of point q3, q 3z Indicates the z-axis coordinate value of point q3, m 2x Indicates q 3x The absolute value of m 2y Indicates q 3y The absolute value of m 2z Indicates q 3z The absolute value of n x Indicates m 2x One half of n y Indicates m 2yOne half of n z Indicates m 2z One half of m xy Indicates m 2x With m 2y The product of m xz Indicates m 2x With m 2z The product of m yz Indicates m 2y With m 2z The structure function of the custom unit cell structure is determined by Boolean operations based on the constructive solid geometry (CSG) method.
[0031] In conjunction with the first aspect, in one optional implementation, the second voxel information includes a third signed distance field. Merging the first discrete point cloud model and the second discrete point cloud model to generate a target three-dimensional model includes: first, matching sampling points in the first discrete point cloud model with sampling points in the second discrete point cloud model to obtain a matched point cloud model. Then, determining the maximum value between the first signed distance field and the second signed distance field corresponding to the sampling points in the matched point cloud model as the third signed distance field.
[0032] In combination with the first aspect, in an optional implementation, the second voxel information further includes: unit cell type, preset lattice geometric parameters, and preset texture information.
[0033] In combination with the first aspect, in an optional implementation, the target three-dimensional model is in XML format.
[0034] In this implementation, XML format is used as a binary storage format, which can not only make the data of the target three-dimensional model more compact, but also facilitate the reading and writing of the target three-dimensional model and the processing of large-scale voxel data (i.e., second voxel information) in the target three-dimensional model.
[0035] In a second aspect, the present invention provides a three-dimensional modeling system based on a lattice structure, comprising: an extraction module, a module conversion module, a lattice unit cell definition module, a filling module, a voxelization module, and a model generation module. The extraction module is used to extract the 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. The module conversion module is used to convert the first model into a first discrete point cloud model based on the bounding box information, the patch information, and the first preset point cloud resolution. The first discrete point cloud model includes a first signed distance field, and the first signed distance field is used to characterize the distance and position relationship between the sampling point in the first discrete point cloud model and the surface of the first model. The lattice unit cell definition module is used to determine the unit cell type of the target lattice unit cell and the structure function corresponding to the unit cell type. The filling module is used to fill the target lattice unit cell in the target bounding box corresponding to the bounding box information through a model filling algorithm based on the bounding box information and the structure function, and determine the target lattice structure function field. The voxelization module is configured to perform voxelization based on the target lattice structure function field and the second preset point cloud resolution to generate a second discrete point cloud model, wherein the second discrete point cloud model includes the first voxel information. The model generation module is configured to merge the first discrete point cloud model and the second discrete point cloud model to generate a target three-dimensional model, wherein the target three-dimensional model includes the second voxel information.
[0036] In a third aspect, the present invention provides an electronic device comprising: a memory, one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method provided by the above-mentioned first aspect and any optional implementation thereof.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method provided in the first aspect and any optional implementation thereof.
[0038] It can be understood that the beneficial effects that can be achieved by the three-dimensional modeling system based on the lattice structure provided by the second aspect, the electronic device of the third aspect, and the computer-readable storage medium of the fourth aspect can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of the structure of a lattice unit cell provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of the principle of a lattice-based three-dimensional modeling method provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a process for a three-dimensional modeling method based on a lattice structure provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a lattice unit cell structure of a truss structure provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of a unit cell of a filled target lattice provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of the target lattice unit cell after filling provided in an embodiment of the present application;
[0045] Figure 7 A schematic structural diagram of a lattice-based three-dimensional modeling system according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following embodiments are described in detail, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numbers in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following embodiments are not intended to represent all possible implementations consistent with the present application. They are merely examples of systems and methods consistent with certain aspects of the present application, as detailed in the claims.
[0047] Lattice structures are composed of continuous and periodically arranged unit cells (or lattice unit cells). They offer excellent properties such as high design freedom, high specific stiffness, high strength, and lightweight. Therefore, they are widely used in aerospace, automotive engineering, life sciences, tissue engineering, and other fields. Specifically, lattice unit cell structures can be divided into prismatic structures, truss structures, and structures based on three-periodic minimal surfaces. Among them, truss lattice unit cells are more widely used. Figure 1 The schematic diagram of the structure of the lattice unit cell provided in the embodiment of the present application is as follows: Figure 1 As shown, the lattice unit cell of the truss structure is formed by the connection between rods, and the distribution and number of rod units can be flexibly adjusted according to needs to meet diverse application requirements.
[0048] Related methods for 3D modeling based on lattice structures primarily represent 3D models through skeleton structures or mesh representations. Skeleton structures construct 3D models based on the lattice structure using a node-to-node and line-to-line-segment structure, supplemented by other shape parameters. Mesh representations represent 3D models by fitting triangular facets to a surface.
[0049] However, for skeletal structures, as the size of the three-dimensional model increases or the size of the lattice unit cell decreases, the overall scale of the three-dimensional model will grow rapidly, and the number of pillars of the lattice structure can reach millions. Especially when constructing large-scale lattice structures, the structural data that needs to be stored will increase exponentially, and a large amount of structural data is difficult to store and process efficiently. The grid representation method is difficult to achieve a balance between accuracy and data volume when facing lattice structures with complex structures and fine features. High accuracy requires the fitting of more triangular facets, which will also greatly increase the data size, thereby increasing the computational cost and memory storage usage. It can be seen that for the construction of three-dimensional models with large-scale lattice structures, the relevant technologies have problems such as large data processing volume, high computational processing cost and low accuracy, which makes it impossible to efficiently and accurately implement three-dimensional modeling based on lattice structures.
[0050] In order to solve the above problems, the present invention provides a 3D modeling method and system based on a lattice structure, which can be applied to 3D modeling of large-scale (large data volume) lattice structures. Specifically, Figure 2 The schematic diagram of the principle of the three-dimensional modeling method based on the lattice structure provided in the embodiment of the present application is as follows: Figure 2 As shown, the method first converts a first model in polygonal mesh format into a first discrete point cloud model. Then, based on the bounding box information of the first model and the structure function of the target lattice unit cell, the target lattice unit cell is filled within the target bounding box to determine the target lattice structure function field. Next, voxelization is performed based on the target lattice structure function field to generate a second discrete point cloud model. Finally, the first and second discrete point cloud models are merged to generate the target 3D model.
[0051] This method uses implicit modeling (i.e., mathematical function expression) based on the structure functions of a polygonal mesh model and a target lattice unit cell to construct a lattice-based three-dimensional model by filling and arranging the target lattice unit cells. The lattice-based three-dimensional model can also be represented using an implicit field (function field). This method uses mathematical function expressions to represent the lattice structure, eliminating the need for extensive mesh intersection processing during model construction. This effectively reduces the computational cost, time, and memory usage of the model building process. It also addresses the low fitting accuracy of models represented by mesh-fitted surfaces, enabling rapid and accurate modeling of large-scale, complex lattice structures. This effectively improves the accuracy and efficiency of lattice-based three-dimensional modeling.
[0052] The following describes the solution provided by the embodiments of the present application in conjunction with the accompanying drawings.
[0053] Specifically, Figure 3 A schematic diagram of a process flow of a three-dimensional modeling method based on a lattice structure provided in an embodiment of the present application is shown in FIG. Figure 3As shown, the lattice structure-based three-dimensional modeling method provided in the embodiment of the present application includes the following steps S101-S106:
[0054] S101: Extract bounding box information and facet information of a first model.
[0055] In the embodiment of the present application, the first model is a pre-acquired model used to construct a three-dimensional model of a lattice structure. Specifically, the first model is a mesh model composed of multiple polygonal patches. For example, the polygonal patches can be triangular patches, quadrilateral patches, pentagonal patches, etc. The first model can be a model in a mesh format such as stereolithography (STL) or OBJ.
[0056] To construct a lattice-structured 3D model corresponding to the first model, we first need to extract the bounding box information and facet information of the first model. The bounding box information can be used to represent a simplified geometric object (such as a cube or cuboid) that encloses the first model, i.e., a bounding box. This bounding box can represent the approximate spatial extent of the first model. For example, the bounding box can be an axis-aligned bounding box (AABB).
[0057] The patch information can be used to characterize the structure and properties of the polygon patch. For example, the patch information can include: patch vertex coordinate information and surface normal information.
[0058] In some embodiments, the vertex information, facet vertex coordinate information, and surface normal information of the first model can be extracted by parsing the mesh file of the first model. For example, taking the first model in STL or OBJ mesh format as an example, the vertex information and facet vertex coordinate information of the first model are typically stored in the mesh file of the first model and can be read. The surface normal information can be determined by performing a cross product calculation on the facet vertex coordinate information.
[0059] Furthermore, by traversing the vertex information of the first model, the maximum and minimum values in the vertex information are determined, and then the maximum coordinate max[3] and minimum coordinate min[3] of the bounding box (hereinafter referred to as the target bounding box) can be determined, that is, the bounding box information is obtained.
[0060] S102: Convert the first model into a first discrete point cloud model based on the bounding box information, the patch information, and the first preset point cloud resolution.
[0061] Next, the first model is converted into a first discrete point cloud model using a first preset point cloud resolution. Specifically, the first discrete point cloud model includes a first signed distance field, which is used to represent the distance and positional relationship between sampling points in the first discrete point cloud model and the surface of the first model (i.e., the internal and external relationship with the first model).
[0062] In some embodiments, S102 may specifically include the following steps S1021-S1024:
[0063] S1021. Determine a target bounding box according to the bounding box information.
[0064] First, the target bounding box can be determined according to the bounding box information extracted in S101 to serve as the spatial range for generating the sampling point cloud, thereby facilitating point cloud sampling.
[0065] S1022: Generate a sampling point cloud model based on the target bounding box and a first preset point cloud resolution.
[0066] Then, point cloud sampling can be performed within the target bounding box according to the first preset point cloud resolution to generate a uniformly distributed 3D point cloud, thereby obtaining a sampled point cloud model. The sampled point cloud model facilitates the determination of the first signed distance field and serves as the point cloud basis for the first discrete point cloud model. The sampled point cloud model includes sampling points within the first model, sampling points on the surface of the first model, and sampling points outside the first model.
[0067] S1023: Determine the distance and position relationship between the sampling points in the sampling point cloud model and the first model surface according to the patch information to obtain a first signed distance field.
[0068] Specifically, the projection distance from the sampling point to the polygonal patch is calculated according to the patch information, and combined with the surface normal information, the internal and external relationship of the sampling point in the first model can be determined to determine the first signed distance field.
[0069] In some embodiments, the patch information may include: patch vertex coordinate information and surface normal information; the first signed distance field includes: a first distance value and a first sign. Then S1023 may specifically include:
[0070] The first distance value is determined based on the coordinate information of the sampling points and the coordinate information of the surface vertices in the sampling point cloud model. For example, the projection distance can be calculated based on the coordinate information of the sampling points and the coordinate information of the surface vertices to serve as the first distance value.
[0071] The first symbol is determined based on the coordinate information of the sampling points, the patch vertex coordinate information, and the surface normal information in the sampling point cloud model. For example, the positional relationship between the sampling points in the sampling point cloud model and the first model can be determined using a random ray casting method, a weighted pseudo-normal method, a spherical uniform sampling method, or the like, based on the coordinate information of the sampling points, the patch vertex coordinate information, and the surface normal information, thereby obtaining the first symbol.
[0072] Among them, when the first symbol is a positive value, it means that the sampling point in the first discrete point cloud model is outside the first model; when the first symbol is a negative value, it means that the sampling point in the first discrete point cloud model is inside the first model; when the first symbol is 0, it means that the sampling point in the first discrete point cloud model is on the surface of the first model.
[0073] S1024: Generate a first discrete point cloud model based on the sampled point cloud model and the first signed distance field.
[0074] Finally, the sampling point cloud model and the first signed distance field corresponding to the sampling points in the sampling point cloud model may be combined to generate a first discrete point cloud model.
[0075] S103: Determine the unit cell type of the target lattice unit cell and the structure function corresponding to the unit cell type.
[0076] In the embodiments of the present application, the unit cell type of the target lattice unit cell can be preset by the user based on the actual application requirements. Then, the corresponding structure function can be determined based on the preset unit cell type. In this way, the structure of the target lattice unit cell is represented by the structure function (i.e., a mathematical function expression), which facilitates the filling and arrangement of the target lattice unit cells and the construction of a 3D model based on the lattice structure, thereby improving the accuracy and efficiency of 3D model construction.
[0077] In some embodiments, the unit cell type can be divided into a truss structure and a custom structure. Specifically, the unit cell type can be one of the following structures: a simple cubic (SC) truss structure, a body-centered cubic (BCC) truss structure, a face-centered cubic (FCC) truss structure, or a custom unit cell structure. For example, Figure 4 The schematic diagram of the lattice unit cell structure of the truss structure provided in the embodiment of the present application is as follows: Figure 4 As shown in (a), it is a schematic diagram of the skeleton structure and model structure of a simple cubic truss structure; Figure 4 As shown in (b), it is a schematic diagram of the skeleton structure and model structure of the body-centered cubic truss structure; Figure 4 As shown in (c), it is a schematic diagram of the skeleton structure and model structure of the face-centered cubic truss structure. Figure 4As shown in Figure 1, the lattice unit cell of a truss structure is composed of rod elements. The structure function is concise and, combined with the periodic permutation function, can quickly fill the target regular lattice unit cell. Furthermore, the structure function representation facilitates the addition of attributes to the lattice structure through attribute field coupling, effectively adjusting parameters such as density, thickness, and radius.
[0078] Specifically, the function of the target lattice unit cell can be defined as:
[0079] F u =f(q),q∈D u =[q min ,q max ];
[0080] Among them, F u Represents the target lattice unit cell, q:(q x ,q y ,q z ) is the unit cell domain D u The point set inside. D u Defines a hexahedral region, D u The values of the three dimensions in define the size of the target lattice unit cell. The structure of the target lattice unit cell is usually based on a hexahedral framework and has a high degree of symmetry. For simple cubic truss structures, body-centered cubic truss structures, and face-centered cubic truss structures, the unit cell domain D u The corresponding structure is represented by the square or square root of the different components of q at any point in the interior, and a specific thickness parameter e is added to it to determine the structure function.
[0081] Specifically, the structural function of a simple cubic truss structure can be expressed as:
[0082]
[0083] Among them, sc(q1,e1) represents the structure function of the simple cubic truss structure, q1 represents a point in the unit cell domain of the simple cubic truss structure, e1 represents the thickness parameter of the simple cubic truss structure, q 1x Indicates the x-axis coordinate value of point q1, q 1y Indicates the y-axis coordinate value of point q1, q 1z Indicates the z-axis coordinate value of point q1, o x Indicates q 1x The square value of o y Indicates q 1y The square value of o z Indicates q 1z The square value of .
[0084] The structural function of the body-centered cubic truss structure can be expressed as:
[0085]
[0086] m1=|q2|=(|q 2x |,|q 2y |,|q 2z |);
[0087] m 1x =|q 2x |,m 1y =|q 2y |,m 1z =|q 2z |;
[0088] Among them, bcc(q2,e2) represents the structure function of the body-centered cubic truss structure, q2 represents a point in the unit cell of the body-centered cubic truss structure, e2 represents the thickness parameter of the body-centered cubic truss structure, q 2x Indicates the x-axis coordinate value of point q2, q 2y Indicates the y-axis coordinate value of point q2, q 2z represents the z-axis coordinate value of point q2, m1 represents the absolute value of the coordinate of point q2, and m 1x Indicates q 2x The absolute value of m 1y Indicates q 2y The absolute value of m 1z Indicates q 2z The absolute value of .
[0089] The structural function of the face-centered cubic truss structure can be expressed as:
[0090] fcc(q3,e3)=min(min(|m xy -(n x +n y ),m 2z |,|m xz -(n x +n z ),m 2y |),
[0091] |m yz -(n y +n z ),m 2x |)-e3;
[0092] m xy =|q 3x |·|q 3y |;
[0093] m xz =|q 3x |·|q 3z |;
[0094] m yz =|q 3y |·|q 3z |;
[0095] m 2x =|q 3x |,m 2y =|q 3y |,m 2z =|q 3z |;
[0096]
[0097] Among them, fcc(q3,e3) represents the structure function of the face-centered cubic truss structure, q3 represents a point in the unit cell of the face-centered cubic truss structure, e3 represents the thickness parameter of the face-centered cubic truss structure, q 3x Indicates the x-axis coordinate value of point q3, q 3y Indicates the y-axis coordinate value of point q3, q 3z Indicates the z-axis coordinate value of point q3, m 2x Indicates q 3x The absolute value of m 2y Indicates q 3y The absolute value of m 2z Indicates q 3z The absolute value of n x Indicates m 2x One half of n y Indicates m 2y One half of n z Indicates m 2z One half of m xy Indicates m 2x With m 2y The product of m xz Indicates m 2x With m 2z The product of m yz Indicates m 2y With m 2z The product of .
[0098] The structure function of the custom unit cell structure is determined by Boolean operations based on the constructive solid geometry (CSG) method.
[0099] Specifically, for customized unit cell structures, for example, when the topological structure of the target lattice unit cell is more complex, or cannot be expressed by a specific function, the structural function can be customized by constructing a solid geometry CSG method. The CSG method can define new geometric shapes through Boolean operations of a series of basic geometric primitives, which has significant advantages and convenience, and is especially suitable for implicit expression. Through binary operations, multiple implicit primitives can be Boolean operated. Commonly used unit cell primitives include rods, cubes, and spheres. The implicit expressions of these unit cell primitives are concise, which makes it easy to use the CSG method to combine them into new target lattice unit cell structures. Then, by combining periodic functions for repeated arrangement, the three-dimensional model can be filled to construct a three-dimensional model.
[0100] For example, the structure function of the custom unit cell structure can be obtained by performing Boolean operations on unit cell primitives. The Boolean operation is expressed in the distance field as follows:
[0101] f1∪f2=max(f1,f2);
[0102] f1∩f2=min(f1,f2);
[0103] f1-f2=min(f1,-f2);
[0104] Wherein, f1 represents the first unit cell primitive, and f2 represents the second unit cell primitive.
[0105] S104 , based on the bounding box information and the structure function, fill the target lattice unit cell in the target bounding box corresponding to the bounding box information through a model filling algorithm to determine the target lattice structure function field.
[0106] Specifically, based on the structure function determined in S103 , the target lattice unit cells may be repeatedly arranged within the target bounding box using a model filling algorithm to fill the target lattice unit cells and determine the target lattice structure function field.
[0107] For example, Figure 5 A schematic diagram of a filled target lattice unit cell provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, due to the unit cell domain D of the target lattice unit cell u is a hexahedral domain, so the unit cell domain D can be defined in the Cartesian coordinate system. u Perform coordinate mapping, and then map these hexahedrons with the same size (i.e., the unit cell domain D u ) can be arranged along the x, y, and z coordinate axes to achieve filling.
[0108] In some embodiments, the model filling algorithm includes: an arrangement function and a geometric control function. S104 may specifically include:
[0109] The target lattice unit cell is modulo-operated based on the structure function through the permutation function, so as to periodically arrange the target lattice unit cell within the target bounding box and obtain the arranged lattice function.
[0110] Exemplarily, the arrangement function may be a linear periodic function, a trigonometric periodic function, or the like. Figure 6 The schematic diagram of the structure of the target lattice unit cell after filling provided in the embodiment of the present application is as follows: Figure 6 As shown in (2), the Figure 6 The schematic diagram of the structure of the target lattice unit cell filled with a linear periodic function shown in (1). Figure 6 As shown in (4), the Figure 6 Schematic diagram of the structure of the target lattice unit cell filled with triangular periodic functions shown in (3).
[0111] The target lattice structure function field is obtained by adjusting the target lattice unit cell in the arranged lattice function based on the preset lattice geometric parameters through the geometric control function. The preset lattice geometric parameters include: size scaling factor and thickness parameter.
[0112] Specifically, the geometric control function can realize variable density lattice filling by processing the preset lattice geometric parameters based on the preset lattice geometric parameters. The preset lattice geometric parameters can be discrete control points or continuous geometric parameter fields. By interpolating the discrete control points, the lattice geometric parameters within the target bounding box can be assigned, thereby realizing customized lattice geometric parameters.
[0113] S105 , performing voxel processing based on the target lattice structure function field and the second preset point cloud resolution to generate a second discrete point cloud model.
[0114] Specifically, the voxel format is a representation method for 3D models that can make implicit functions (such as the target lattice structure function field) explicit in a concise and easy-to-process format. Therefore, voxelization can be performed based on the target lattice structure function field and a second preset point cloud resolution to generate a second discrete point cloud model. The second preset point cloud resolution can be the same as the first preset point cloud resolution to facilitate sampling point matching.
[0115] The second discrete point cloud model may include first voxel information. Specifically, the first voxel information may include a second signed distance field, where the second signed distance field is generated from a target lattice structure function field according to a second preset point cloud resolution. The second signed distance field may be used to represent the distance and positional relationship between a sampling point in the second discrete point cloud model and a target lattice unit cell. For example, the distance value in the second signed distance field may be the closest distance from a sampling point in the second discrete point cloud model to the surface of the nearest target lattice unit cell.
[0116] In some embodiments, a graphics processing unit (GPU) can be used for voxelization processing in a multi-threaded parallel manner. Specifically, the GPU multi-threaded parallel method calculates the first voxel information (e.g., the second signed distance field) based on the second preset point cloud resolution using the target lattice structure function field. This can reduce voxelization processing time and improve voxelization processing efficiency.
[0117] S106: Merge the first discrete point cloud model and the second discrete point cloud model to generate a target three-dimensional model.
[0118] Finally, the first discrete point cloud model and the second discrete point cloud model can be merged. Specifically, the first signed distance field of the first discrete point cloud model and the second signed distance field of the second discrete point cloud model can be integrated, and other information in the first voxel information of the second discrete point cloud model can be retained, that is, the second voxel information of the target three-dimensional model can be determined.
[0119] In some embodiments, the first signed distance field of the first discrete point cloud model and the second signed distance field of the second discrete point cloud model may be maximized. Specifically, the second voxel information may include: a third signed distance field. Then S106 may specifically include:
[0120] First, the sampling points in the first discrete point cloud model are matched with the sampling points in the second discrete point cloud model to obtain a matching point cloud model.
[0121] Then, a maximum value between the first signed distance field and the second signed distance field corresponding to the sampling point in the matching point cloud model is determined as a third signed distance field.
[0122] In some embodiments, the second voxel information further includes: unit cell type, preset lattice geometric parameters, and preset texture information. The preset texture information can be preset by the user according to actual application requirements. The preset texture information can be pre-acquired.
[0123] In one implementation, the unit cell type, preset lattice geometric parameters, and preset texture information may be included in the first voxel information, and during the merging process in S106 , the first voxel information is merged into the second voxel information.
[0124] In some embodiments, the generated target 3D model can be a file in XML format, which is a binary storage format. This can make the target 3D model data more compact, facilitate efficient reading and writing of the target 3D model, and facilitate processing of large-scale voxel data (i.e., second voxel information) in the target 3D model.
[0125] In some embodiments, the target three-dimensional model may also be in TXT text format, or in .vti format. Specifically, the format of the target three-dimensional model may be set according to the requirements of the actual application.
[0126] In some embodiments, the generated target three-dimensional model can be directly used for model slicing, additive manufacturing, and direct rendering, which can meet the modeling application requirements and visualization requirements of the three-dimensional model, greatly improving the practicality of the modeling method.
[0127] Using the lattice structure-based three-dimensional modeling method provided in an embodiment of the present application, first, the bounding box information and patch information of the first model are extracted, and the first model is converted into a first discrete point cloud model. Then, based on the bounding box information and the structure function of the target lattice unit cell, the target lattice unit cell is filled within the target bounding box to determine the target lattice structure function field. Next, voxelization is performed based on the target lattice structure function field to generate a second discrete point cloud model. Finally, the first discrete point cloud model and the second discrete point cloud model are merged to generate the target three-dimensional model. This method, based on large-scale lattice structure modeling using implicit (i.e., mathematical function expression) representation, effectively avoids the problems of low fitting accuracy, large model data size, and slow processing time of large-scale lattice models under traditional grid representation. Furthermore, this method uses mathematical function expressions to represent the lattice structure, eliminating the need for extensive grid intersection processing during model construction. This can effectively reduce the computational cost, time, and memory usage of the model building process, and can address the low fitting accuracy of models represented by grid-fitting surfaces, allowing for rapid and accurate modeling of large-scale complex lattice structures. In this way, the accuracy and efficiency of lattice structure-based three-dimensional modeling can be effectively improved.
[0128] The present application also provides a three-dimensional modeling system based on a lattice structure. Specifically, Figure 7 A schematic diagram of the structure of a three-dimensional modeling system based on a lattice structure provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the lattice structure-based three-dimensional modeling system 700 includes: an extraction module 701, a module conversion module 702, a lattice unit cell definition module 703, a filling module 704, a voxelization module 705 and a model generation module 706.
[0129] The extraction module 701 may be used to extract bounding box information and facet information of the first model. The first model is a mesh model composed of multiple polygonal faces. The facet information is used to characterize the structure and properties of the polygonal faces.
[0130] The module conversion module 702 can be configured to convert the first model into a first discrete point cloud model based on the bounding box information, the patch information, and the first preset point cloud resolution. The first discrete point cloud model includes a first signed distance field, which is configured to represent the distance and positional relationship between sampling points in the first discrete point cloud model and the surface of the first model.
[0131] The lattice unit cell definition module 703 may be used to determine the unit cell type of the target lattice unit cell and the structure function corresponding to the unit cell type.
[0132] The filling module 704 may be configured to fill the target lattice unit cells in the target bounding box corresponding to the bounding box information through a model filling algorithm based on the bounding box information and the structure function, and determine the target lattice structure function field.
[0133] The voxelization module 705 can be used to perform voxelization processing based on the target lattice structure function field and the second preset point cloud resolution to generate a second discrete point cloud model, where the second discrete point cloud model includes the first voxel information.
[0134] In one implementation, the voxelization module 705 may perform voxelization based on the target lattice structure function field and the second preset point cloud resolution in a GPU multi-threaded parallel manner, that is, calculate voxel information to generate a second discrete point cloud model.
[0135] The model generation module 706 can be used to merge the first discrete point cloud model and the second discrete point cloud model to generate a target three-dimensional model, where the target three-dimensional model includes the second voxel information.
[0136] Using the lattice structure-based three-dimensional modeling system provided in the embodiment of the present application, first, the bounding box information and facet information of the first model can be extracted through the extraction module, and the first model can be converted into a first discrete point cloud model through the module conversion module. Then, the target lattice unit cell can be filled in the target bounding box based on the bounding box information and the structure function of the target lattice unit cell through the filling module to determine the target lattice structure function field. Next, voxelization processing can be performed based on the target lattice structure function field through the voxelization module to generate a second discrete point cloud model. Finally, the first discrete point cloud model and the second discrete point cloud model can be merged and processed through the model generation module to generate a target three-dimensional model. This system can effectively improve the accuracy and efficiency of three-dimensional modeling based on the lattice structure.
[0137] An embodiment of the present invention further provides an electronic device, which may include: a display screen, a memory, and one or more processors. The display screen, memory, and processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various methods or steps performed in the above-mentioned embodiment of the lattice-based three-dimensional modeling method. Of course, the electronic device includes but is not limited to the above-mentioned display screen, memory, and one or more processors.
[0138] An embodiment of the present invention further provides a computer-readable storage medium for storing computer instructions for executing the above-mentioned lattice structure-based three-dimensional modeling method.
[0139] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0140] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0141] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0142] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without expending creative work shall fall within the scope of protection of this application.
Claims
1. A three-dimensional modeling method based on a lattice structure, characterized in that: include: Extracting bounding box information and facet information of a first model, where the first model is a mesh model composed of a plurality of polygonal faces, and the facet information is used to characterize the structure and properties of the polygonal faces; Converting the first model into a first discrete point cloud model based on the bounding box information, the patch information, and a first preset point cloud resolution, wherein the first discrete point cloud model includes a first signed distance field, and the first signed distance field is used to represent the distance and position relationship between sampling points in the first discrete point cloud model and the surface of the first model; Determining a unit cell type of a target lattice unit cell and a structure function corresponding to the unit cell type; Based on the bounding box information and the structure function, filling the target lattice unit cell in the target bounding box corresponding to the bounding box information by a model filling algorithm to determine the target lattice structure function field; Performing voxel processing based on the target lattice structure function field and the second preset point cloud resolution to generate a second discrete point cloud model, wherein the second discrete point cloud model includes the first voxel information; The first discrete point cloud model and the second discrete point cloud model are merged to generate a target three-dimensional model, where the target three-dimensional model includes second voxel information.
2. The method according to claim 1, characterized in that The converting the first model into a first discrete point cloud model based on the bounding box information, the patch information and a first preset point cloud resolution includes: Determine the target bounding box according to the bounding box information; Generate a sampling point cloud model based on the target bounding box according to the first preset point cloud resolution; Determine the distance and position relationship between the sampling point in the sampling point cloud model and the first model surface according to the patch information to obtain the first signed distance field; The first discrete point cloud model is generated based on the sampled point cloud model and the first signed distance field.
3. The method according to claim 2, characterized in that The patch information includes: patch vertex coordinate information and surface normal information; the first signed distance field includes: a first distance value and a first sign; Determining the distance and position relationship between the sampling point in the sampling point cloud model and the first model surface according to the patch information to obtain the first signed distance field includes: Determine the first distance value based on the coordinate information of the sampling points in the sampling point cloud model and the coordinate information of the surface vertices; Determine the first symbol based on the coordinate information of the sampling points in the sampling point cloud model, the coordinate information of the surface vertex and the surface normal information; In which, when the first symbol is a positive value, it indicates that the sampling point in the first discrete point cloud model is outside the first model; when the first symbol is a negative value, it indicates that the sampling point in the first discrete point cloud model is inside the first model; when the first symbol is 0, it indicates that the sampling point in the first discrete point cloud model is on the surface of the first model.
4. The method according to claim 1, wherein The model filling algorithm includes: an arrangement function and a geometric control function; The method of filling the target lattice unit cell in the target bounding box corresponding to the bounding box information by a model filling algorithm based on the bounding box information and the structure function to determine the target lattice structure function field includes: performing a modulo operation on the target lattice unit cell based on the structure function by using the permutation function to periodically arrange the target lattice unit cell within the target bounding box, thereby obtaining an arranged lattice function; The target lattice structure function field is obtained by adjusting the target lattice unit cell in the arranged lattice function based on preset lattice geometric parameters through the geometric control function; wherein the preset lattice geometric parameters include: size scaling factor and thickness parameter.
5. The method according to claim 1, wherein The first voxel information includes: a second signed distance field, which is generated by the target lattice structure function field according to the second preset point cloud resolution; the second signed distance field is used to represent the distance and position relationship between the sampling point in the second discrete point cloud model and the target lattice unit cell.
6. The method according to claim 1, wherein The unit cell type is one of the following structures: simple cubic truss structure, body-centered cubic truss structure, face-centered cubic truss structure, and custom unit cell structure; wherein, The structural function of the simple cubic truss structure is expressed as: Among them, sc(q1,e1) represents the structure function of the simple cubic truss structure, q1 represents a point in the unit cell domain of the simple cubic truss structure, e1 represents the thickness parameter of the simple cubic truss structure, q 1x Indicates the x-axis coordinate value of point q1, q 1y Indicates the y-axis coordinate value of point q1, q 1z Indicates the z-axis coordinate value of point q1, o x Indicates q 1x The square value of o y Indicates q 1y The square value of o z Indicates q 1z The square value of The structural function of the body-centered cubic truss structure is expressed as: m1=|q2|=(|q 2x |,|q 2y |,|q 2z |); m 1x =|q 2x |,m 1y =|q 2y |,m 1z =|q 2z |; Among them, bcc(q2,e2) represents the structure function of the body-centered cubic truss structure, q2 represents a point in the unit cell of the body-centered cubic truss structure, e2 represents the thickness parameter of the body-centered cubic truss structure, q 2x Indicates the x-axis coordinate value of point q2, q 2y Indicates the y-axis coordinate value of point q2, q 2z represents the z-axis coordinate value of point q2, m1 represents the absolute value of the coordinate of point q2, and m 1x Indicates q 2x The absolute value of m 1y Indicates q 2y The absolute value of m 1z Indicates q 2z The absolute value of The structural function of the face-centered cubic truss structure is expressed as: fcc(q3,e3)=min(min(|m xy -(n x +n y ),m 2z |,|m xz -(n x +n z ), m 2y |), |m yz -(n y +n z ),m 2x |)-e3; m xy =|q 3x |·|q 3y |; m xz =|q 3x |·|q 3z |; m yz =|q 3y |·|q 3z |; m 2x =|q 3x |,m 2y =|q 3y |,m 2z =|q 3z |; Among them, fcc(q3,e3) represents the structure function of the face-centered cubic truss structure, q3 represents a point in the unit cell of the face-centered cubic truss structure, e3 represents the thickness parameter of the face-centered cubic truss structure, q 3x Indicates the x-axis coordinate value of point q3, q 3y Indicates the y-axis coordinate value of point q3, q 3z Indicates the z-axis coordinate value of point q3, m 2x Indicates q 3x The absolute value of m 2y Indicates q 3y The absolute value of m 2z Indicates q 3z The absolute value of n x Indicates m 2x One half of n y Indicates m 2y One half of n z Indicates m 2z One half of m xy Indicates m 2x With m 2y The product of m xz Indicates m 2x With m 2z The product of m yz Indicates m 2y With m 2z The product of The structure function of the custom unit cell structure is determined by Boolean operations based on a constructive solid geometry (CSG) method.
7. The method according to claim 1, characterized in that The second voxel information includes: a third signed distance field; The merging of the first discrete point cloud model and the second discrete point cloud model to generate a target three-dimensional model includes: Matching the sampling points in the first discrete point cloud model with the sampling points in the second discrete point cloud model to obtain a matched point cloud model; The maximum value of the first signed distance field and the second signed distance field corresponding to the sampling point in the matching point cloud model is determined as the third signed distance field.
8. The method according to claim 7, characterized in that The second voxel information further includes: the unit cell type, preset lattice geometric parameters, and preset texture information.
9. The method according to claim 1, characterized in that The target three-dimensional model is in XML format.
10. A three-dimensional modeling system based on a lattice structure, characterized in that: include: Extraction module, module conversion module, lattice unit cell definition module, filling module, voxelization module and model generation module; among them, The extraction module is used to extract bounding box information and facet information of a first model, where the first model is a mesh model composed of a plurality of polygonal faces, and the facet information is used to characterize the structure and properties of the polygonal faces; The module conversion module is configured to convert the first model into a first discrete point cloud model based on the bounding box information, the patch information, and a first preset point cloud resolution, wherein the first discrete point cloud model includes a first signed distance field, and the first signed distance field is configured to represent a distance and positional relationship between a sampling point in the first discrete point cloud model and a surface of the first model; The lattice unit cell definition module is used to determine the unit cell type of the target lattice unit cell and the structure function corresponding to the unit cell type; The filling module is configured to fill the target lattice unit cell in the target bounding box corresponding to the bounding box information by a model filling algorithm based on the bounding box information and the structure function, and determine the target lattice structure function field; The voxelization module is configured to perform voxelization processing based on the target lattice structure function field and the second preset point cloud resolution to generate a second discrete point cloud model, wherein the second discrete point cloud model includes the first voxel information; The model generation module is used to merge the first discrete point cloud model and the second discrete point cloud model to generate a target three-dimensional model, where the target three-dimensional model includes second voxel information.
Citation Information
Patent Citations
Computational analysis of biological data using manifold and a hyperplane
CN107076746A
Partitioned quadrilateral mesh reconstruction method for three-dimensional point cloud model
CN117726772A
Reconstruction and performance characterization method and equipment for irregular special-shaped microstructure discrete model
CN117934758A
Space dot matrix modeling method and system based on region boundary grid model clipping
CN118504349A
Three-dimensional model generation method and device, storage medium and electronic equipment
CN119850873A