Generation method of three-period minimal curved surface and computer terminal

By processing the contour coordinate data of the solid STL model in Matlab, using the extremely small surface formula and isosurface extraction algorithm, a three-period extremely small surface model is generated, which solves the problems of low generation accuracy and inaccurate changes in porosity gradients in the existing technology, and achieves higher-precision surface model generation.

CN119672248APending Publication Date: 2025-03-21CHENGDE MEDICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411713519.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

When the prior art generates irregular three-period extremely small surface structures with different porosities, the surface model generation accuracy is low, and the gradient changes in porosity cannot be accurately adjusted.

Method used

By creating a solid STL model, importing Matlab and extracting contour coordinate data, determining the spatial range and dividing the grid, distinguishing feature points, using the extremely small surface formula and isosurface extraction algorithm, calculating the objective function value, adjusting the bias parameter C to adjust the porosity, and finally the three-period extremely small surface model is repaired and generated in the zbrush software.

Benefits of technology

The generation accuracy of the three-period extremely small surface structure model is improved, and the gradient change in porosity is achieved, which is more accurate than the Boolean operation generation scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672248A_ABST
    Figure CN119672248A_ABST
Patent Text Reader

Abstract

The invention provides a three-period minimal curved surface generation method and a computer terminal. The generation method comprises the following steps: S1, manufacturing a solid STL model with a required shape; s2, extracting contour coordinate data of the solid STL model; s3, determining a spatial range of the solid STL model; s4, performing grid division on the spatial range, and obtaining coordinate data of each node in a grid; s5, storing each node in the solid STL model as a feature point; s6, calculating an objective function value corresponding to each feature point; and S7, an isosurface is extracted through an isosurface function, and a curved surface is drawn and repaired. According to the method for generating the three-period minimal curved surface, voxel division can be carried out on the solid STL model with the needed shape, gradient change of porosity is achieved through the contour surface extraction algorithm, and the generation precision of the three-period minimal curved surface structure model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer-aided design, and in particular to a method for generating a three-periodic minimal surface. The present invention also relates to a computer terminal for implementing the method for generating the three-periodic minimal surface. Background Art

[0002] Triple Periodic Minimal Surface (TPMS) is a type of three-dimensional surface structure with periodic repeating units. Such structures are widely found in nature, such as bones and honeycombs. Due to their unique properties, triply periodic minimal surface structures are widely used in engineering fields such as materials science, biomedical engineering, and energy storage.

[0003] In the method for generating a three-periodic minimal surface structure, the prior art mostly uses Boolean operations to generate the three-periodic minimal surface structure, which requires generating a TPMS isosurface three-dimensional model, and performing Boolean operations on it and the pre-filled model contour surface, and then repairing the generated model. However, when this production method generates an irregular three-periodic minimal surface structure with different porosities, the accuracy of the surface model generation is low, and the gradient change of the porosity cannot be accurately adjusted. Summary of the invention

[0004] In view of this, the present invention aims to propose a three-periodic minimal surface generation method, which can improve the generation accuracy of the three-periodic minimal surface structure model.

[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0006] A method for generating a three-periodic minimal surface comprises the following steps:

[0007] S1, making a solid STL model of the required shape;

[0008] S2, importing the solid STL model into Matlab, and extracting the contour coordinate data of the solid STL model;

[0009] S3, determining the spatial range of the solid STL model according to the contour coordinate data;

[0010] S4, dividing the space range into grids and obtaining coordinate data of each node in the grid;

[0011] S5, distinguishing each of the nodes located inside and outside the solid STL model, and storing each of the nodes located inside the solid STL model as a feature point;

[0012] S6, bringing the coordinate data of each of the feature points stored in S5 into the minimal surface formula, and calculating the objective function value corresponding to each of the feature points;

[0013] The minimal surface formula: φ(r)=φ(x, y, z)=C, where (x, y, z) is the coordinate of the feature point and C is the bias parameter;

[0014] By changing the C value, the porosity of the three-periodic minimal surface within the spatial range is adjusted;

[0015] S7, according to the objective function value in S6, extracting isosurfaces by isosurface function, drawing a curved surface, and saving the drawn curved surface as a second STL model;

[0016] The second STL model is imported into the Zbrush software, and the second STL model is repaired to generate a model of a three-periodic minimal surface.

[0017] Furthermore, in step S3:

[0018] Calculate and find the maximum and minimum values ​​of the three components of the coordinates of each point in the contour coordinate data on their respective coordinate axes, which are x min 、x max ,y min ,y max 、z min 、z max , the spatial range is a rectangular area consisting of six values ​​as vertices.

[0019] Furthermore, the step S5 includes the following sub-steps:

[0020] S501, projecting the solid STL model onto an XY plane, a YZ plane and an XZ plane respectively according to the outline coordinate data to obtain three polygonal outlines;

[0021] S502, using the cubic inpolygon function for each of the nodes, determining whether each of the nodes is inside the three polygonal contours corresponding to the XY plane, the YZ plane, and the XZ plane, and generating an overall mask, and selecting and storing the corresponding node as the feature point according to the identifier of the overall mask;

[0022] S503, calculating the shortest distance between each of the feature points and the contour boundary of the solid STL model according to the contour coordinate data, and storing the distance in a distance matrix;

[0023] S504, converting the distance matrix D to a matrix with the same size as the original grid.

[0024] Furthermore, in step S503:

[0025] Establishing a KD tree, taking each of the feature points as a target point, and using the established KD tree to perform a nearest neighbor search to find the nearest boundary point corresponding to each of the feature points;

[0026] According to the contour coordinate data, the coordinates (x b ,y b , z b ), calculate the distance between the boundary point and the corresponding feature point, and each element D(i, j, k) of the distance matrix corresponds to a feature point (x i ,y j , z k ) to the nearest distance of the contour boundary, expressed as:

[0027] The distance matrix D is expressed as:

[0028]

[0029] Furthermore, in step S504:

[0030] Create a three-dimensional zero matrix distance grid of the same size as the grid;

[0031] Using the logic matrix inpoly, the feature points are marked as true, and the nodes located outside the solid STL model are marked as false;

[0032] Use the logical matrix inpoly to assign each element D(i, j, k) in the distance matrix D to the corresponding feature point. The assignment process is:

[0033]

[0034] Furthermore, when the three-periodic minimal surface is adopted as the Tubular-G structure, the formula is: φ(r)=10[cos(X)sin(Y)+cos(Y)sin(Z)+cos(Z)sin(X)]-0.5[cos(2X)sin(2Y)+cos(2Y)sin(2Z)+cos(2Z)sin(2X)]=C, where X=ρπx, Y=ρπy, Z=ρπz, x∈R, y∈R, z∈R, and ρ=2.

[0035] Compared with the prior art, the present invention has the following advantages:

[0036] The method for generating three-periodic minimal surfaces of the present invention can divide the solid STL model of the desired shape into voxels through the above steps, and distinguish each node located within the model contour as a feature point, and use the isosurface extraction algorithm to calculate the objective function value of each round of feature points to generate a three-periodic minimal surface model completely located within the solid STL model contour, so as to generate three-periodic minimal surface structures of different shapes, and can achieve a gradient change in porosity by adjusting the C value, which improves the generation accuracy of the three-periodic minimal surface structure model compared to the generation scheme using Boolean operations in the prior art. Another object of the present invention is to provide a computer terminal, which can implement the method for generating three-periodic minimal surfaces as described above when instructions, programs or software stored on the computer terminal are executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0038] Figure 1 This is a flow chart of the method for generating a three-periodic minimal surface according to the first embodiment of the present invention;

[0039] Figure 2 This is a schematic diagram of a solid STL model according to Embodiment 1 of the present invention;

[0040] Figure 3 A schematic diagram of contour points of a solid STL model according to the first embodiment of the present invention;

[0041] Figure 4 A schematic diagram of the spatial range described in Embodiment 1 of the present invention;

[0042] Figure 5 This is a schematic diagram of extracting isosurfaces and drawing curved surfaces in step S7 described in the first embodiment of the present invention;

[0043] Figure 6 Schematic diagram of the second STL model in step S7 described in the first embodiment of the present invention; DETAILED DESCRIPTION

[0044] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0045] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0046] In the description of the present invention, it should be noted that if there are terms indicating orientation or positional relationship such as "upper", "lower", "inner", "outer", etc., they are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, if there are terms such as "first", "second", etc., they are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0047] In addition, in the description of the present invention, unless otherwise clearly defined, the terms "installed", "connected", "connection" and "connector" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood in combination with specific circumstances.

[0048] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0049] Embodiment 1

[0050] This embodiment relates to a method for generating a three-periodic minimal surface, which is used to generate a three-periodic minimal surface structure, which can be used for 3D printing to manufacture medical implants such as defective bone models. Figure 1 As shown, this embodiment includes the following steps:

[0051] S1, make a solid STL model of the required shape, such as Figure 2 shown.

[0052] S2, import the solid STL model into Matlab, and extract the contour coordinate data of the solid STL model, such as Figure 2 shown.

[0053] S3, according to the contour coordinate data, determine the spatial range of the solid STL model, such as Figure 3 shown.

[0054] S4, dividing the space range into grids and obtaining the coordinate data of each node in the grid.

[0055] S5, distinguishing each node located inside and outside the solid STL model, and storing each node located inside the solid STL model as a feature point.

[0056] S6, bringing the coordinate data of each feature point stored in S5 into the minimal surface formula, and calculating the objective function value corresponding to each feature point.

[0057] Minimal surface formula: φ(r)=φ(x, y, z)=C, where (x, y, z) are the coordinates of the feature point and C is the bias parameter.

[0058] By changing the C value, the porosity of the three-periodic minimal surface in the spatial range is adjusted.

[0059] S7, according to the objective function value in S6, extract the isosurface through the isosurface function, draw the surface, and save the drawn surface as the second STL model. And import the second STL model into the zbrush software, repair the second STL model, and generate a model of the three-periodic minimal surface, such as Figure 5 , Figure 6 shown.

[0060] It can be understood that the contour coordinate data of the required shape are obtained in steps S1 and S2, and meshing is performed in step S4 to divide the solid STL model into a series of voxels, each of which has a fixed number of 8 nodes.

[0061] In step S5, the nodes located inside and outside the solid STL model are stored as feature points to ensure that the three-periodic minimal surface generated based on the feature points is completely located inside the solid STL model contour.

[0062] In step S7, by calculating the objective function value corresponding to each feature point, the isosurface function is used to compare the function value of each feature point with the C value. If the objective function value of the feature point is equal to the C value, it is considered that the voxel of the feature point intersects with the isosurface, and then for the voxel intersecting with the isosurface, the intersection position of the isosurface and the voxel edge is calculated using the linear interpolation method. According to the position of the intersection and the topological connection relationship, a triangular facet approximating the isosurface is generated, and then a surface is drawn, which is a three-periodic minimal surface structure with the desired shape.

[0063] As described above, through the above steps, the solid STL model of the required shape can be divided into voxels, and each node located within the model contour can be distinguished as a feature point. By using the isosurface extraction algorithm, the objective function value of each round of feature points is calculated to generate a three-periodic minimal surface model completely within the solid STL model contour, so as to generate three-periodic minimal surface structures of different shapes, and the gradient change of porosity can be achieved by adjusting the C value. Compared with the generation scheme using Boolean operations in the prior art, the generation accuracy of the three-periodic minimal surface structure model is improved.

[0064] Based on the above overall introduction, specifically, in step S7, when using the isosurface function to compare the function value of each feature point with the C value, considering the accuracy of numerical calculation, it is necessary to set a smaller tolerance range. If the objective function value of the feature point is equal to the C value, or the difference between the objective function value of the feature point and the C value is within the tolerance range, then the voxel of the feature point is considered to intersect with the isosurface.

[0065] In addition, in step S4, the meshgrid function in MATLAB is used to perform grid division in the spatial range. The density of each node in the grid can be determined by defining the resolution in the X, Y, and Z directions. The higher the density, the more feature points are obtained in the subsequent steps, and the finer the final surface model is.

[0066] As a specific implementation form, in step S3 of this embodiment: the maximum and minimum values ​​of the three components of the coordinates of each point in the contour coordinate data on their respective coordinate axes are calculated, which are x min 、x max ,y min ,y max 、z min 、z max , the spatial range is a rectangular area composed of six values ​​as vertices. This ensures that the coordinates of each point of the solid STL model outline are within the spatial range, and at the same time helps to reduce the volume of the spatial range. In the subsequent process of dividing the grid and extracting feature points, the number of nodes outside the solid STL model can be reduced to a certain extent, thereby improving the calculation efficiency.

[0067] In this embodiment, step S5 includes the following sub-steps:

[0068] S501 , projecting the solid STL model onto the XY plane, the YZ plane and the XZ plane respectively according to the contour coordinate data to obtain three polygonal contours.

[0069] S502, using the inpolygon function three times for each node, determining whether each node is inside the three polygonal contours corresponding to the XY plane, the YZ plane, and the XZ plane, and generating an overall mask, and selecting and storing the corresponding node as a feature point according to the identifier of the overall mask;

[0070] S503, calculating the shortest distance between each feature point and the contour boundary of the solid STL model according to the contour coordinate data, and storing the distance in a distance matrix;

[0071] S504, converting the distance matrix D to a matrix with the same size as the original grid.

[0072] Among them, the three polygonal contours represent the two-dimensional projections of the model under three different perspectives, and these polygonal contours are the basis for subsequent judgment of the node position. The inpolygon function is used to determine whether a point is inside a polygon, and each node is judged three times. An overall mask is generated based on the judgment result, and each position in the mask identifies whether the corresponding node meets all three conditions, that is, each node is located inside all three plane contours. According to the mask identification, the nodes located inside the model are screened out as feature points. In addition, steps S503 and S504 can ensure that the generated three-period minimal surface is consistent with the solid STL model in terms of mesh size, which is conducive to avoiding geometric errors or inconsistencies caused by mesh size mismatch.

[0073] Specifically, in step S503 of this embodiment: a KD tree is established, each feature point is used as a target point, and the constructed KD tree is used to perform a nearest neighbor search to find the nearest boundary point corresponding to each feature point, and the coordinates (x b ,y b , z b ).

[0074] Calculate the distance between the boundary point and the corresponding feature point, and each element D(i, j, k) of the distance matrix corresponds to a feature point (x i ,y j , z k ) to the nearest distance of the contour boundary, expressed as:

[0075] The distance matrix D is expressed as:

[0076]

[0077] By performing nearest neighbor search through the KD tree, the nearest neighbor boundary point of each feature point can be accurately found, thereby calculating the accurate distance, improving the calculation efficiency, and the distance matrix provides geometric information about the relative position between the feature point and the contour boundary, which is generally used in the subsequent operation of converting the distance matrix D to a matrix of the same size as the original grid.

[0078] In step S504, the distance matrix D is converted to a matrix having the same size as the original grid, including the following steps: creating a three-dimensional zero matrix distance grid having the same size as the grid.

[0079] Use the logic matrix inpoly to mark the feature points as true, and mark the nodes outside the solid STL model as false; use the logic matrix inpoly to assign each element D(i, j, k) in the distance matrix D to the corresponding feature point. The assignment process is: To transform the distance matrix D to a matrix of the same size as the original grid.

[0080] As a preferred implementation form, when a three-periodic minimal surface is used as a Tubular-G structure, the formula is:

[0081] φ(r)=10[cos(X)sin(Y)+cos(Y)sin(Z)+cos(Z)sin(X)]-0.5[cos(2X)sin(2Y)+cos(2Y)sin(2Z)+cos(2Z)sin(2X)]=C,

[0082] Among them, X=ρπx, Y=ρπy, Z=ρπz, x∈R, y∈R, z∈R, and ρ=2.

[0083] In addition, the selection of isosurfaces is based on the condition of φ(r)=C. When the C value increases, the range of the surface in space will decrease, so that the solid part occupies a larger proportion, thereby increasing the volume rate; on the contrary, reducing the C value will increase the pore area and reduce the volume rate. In order to adjust the model porosity of the generated three-periodic minimal surface, the C value of this embodiment can be converted into a function that changes with space as required by the user to achieve the construction of multi-level pores, and different functions can be adjusted according to user needs. The C value given in this embodiment is, where d is the distance between each feature point and the YZ plane. Of course, the three-periodic minimal surface of this embodiment can also adopt other structural forms according to actual needs.

[0084] In summary, the method for generating three-periodic minimal surfaces in this embodiment can, through the above steps, divide the solid STL model of the required shape into voxels, and distinguish each node located within the model contour as a feature point, and use the isosurface extraction algorithm to calculate the objective function value of each round of feature points to generate a three-periodic minimal surface model completely within the solid STL model contour, so as to generate three-periodic minimal surface structures of different shapes, and by adjusting the C value, the gradient change of porosity can be achieved. Compared with the generation scheme using Boolean operations in the prior art, the generation accuracy of the three-periodic minimal surface structure model is improved.

[0085] Embodiment 2

[0086] The present embodiment relates to a computer terminal, which stores instructions, programs or software, and when executed by a processor, can read and store the above-mentioned STL model file, and can run Matlab software and Zbrush software, thereby realizing the method for generating a three-periodic minimal surface as described above.

[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for generating a three-periodic minimal surface, characterized in that: The following steps are involved: S1, making a solid STL model of the desired shape; S2, importing the solid STL model into Matlab, and extracting the contour coordinate data of the solid STL model; S3, determining the spatial range of the solid STL model according to the contour coordinate data; S4, dividing the space range into grids and obtaining coordinate data of each node in the grid; S5, distinguishing each of the nodes located inside and outside the solid STL model, and storing each of the nodes located inside the solid STL model as a feature point; S6, bringing the coordinate data of each of the feature points stored in S5 into the minimal surface formula, and calculating the objective function value corresponding to each of the feature points; The minimal surface formula: φ(r)=φ(x, y, z)=C, where (x, y, z) is the coordinate of the feature point and C is the bias parameter; By changing the C value, the porosity of the three-periodic minimal surface within the spatial range is adjusted; S7, according to the objective function value in S6, extracting isosurfaces by isosurface function, drawing a curved surface, and saving the drawn curved surface as a second STL model; The second STL model is imported into the Zbrush software, and the second STL model is repaired to generate a model of a three-periodic minimal surface.

2. The method for generating a three-periodic minimal surface according to claim 1, characterized in that: In step S3: Calculate and find the maximum and minimum values ​​of the three components of the coordinates of each point in the contour coordinate data on their respective coordinate axes, which are x min 、x max ,y min ,y max 、z min 、z max , the spatial range is a rectangular area consisting of six values ​​as vertices.

3. The method according to claim 1, characterized in that: The step S5 includes the following sub-steps: S501, projecting the solid STL model onto an XY plane, a YZ plane and an XZ plane respectively according to the outline coordinate data to obtain three polygonal outlines; S502, using the cubic inpolygon function for each of the nodes, determining whether each of the nodes is inside the three polygonal contours corresponding to the XY plane, the YZ plane, and the XZ plane, and generating an overall mask, and selecting and storing the corresponding node as the feature point according to the identifier of the overall mask; S503, calculating the shortest distance between each of the feature points and the contour boundary of the solid STL model according to the contour coordinate data, and storing the distance in a distance matrix; S504, converting the distance matrix D to a matrix with the same size as the original grid.

4. The method for generating three-periodic minimal surfaces according to claim 3, characterized in that: In step S503: Establishing a KD tree, taking each of the feature points as a target point, and using the established KD tree to perform a nearest neighbor search to find the nearest boundary point corresponding to each of the feature points; According to the contour coordinate data, the coordinates (x b ,y b , z b ), calculate the distance between the boundary point and the corresponding feature point, and each element D(i, j, k) of the distance matrix corresponds to a feature point (x i ,y j , z k ) to the nearest distance of the contour boundary, expressed as: The distance matrix D is expressed as:

5. The method for generating three-periodic minimal surfaces according to claim 4, characterized in that: In step S504: Create a three-dimensional zero matrix distance grid of the same size as the grid; Using the logic matrix inpoly, the feature points are marked as true, and the nodes located outside the solid STL model are marked as false; Use the logical matrix inpoly to assign each element D(i, j, k) in the distance matrix D to the corresponding feature point. The assignment process is:

6. The method for generating a three-periodic minimal surface according to any one of claims 1 to 5, characterized in that: When the three-periodic minimal surface is used as the Tubular-G structure, the formula is: φ(r)=10[cos(X)sin(Y)+cos(Y)sin(Z)+cos(Z)sin(X)]-0.5[cos(2X)sin(2Y)+cos(2Y)sin(2Z)+cos(2Z)sin(2X)]=C, where X=ρπx, Y=y, Z=ρπz, x∈R, y∈R, z∈R, and ρ=2.

7. A computer terminal, characterized in that: When the instructions, programs or software stored on the computer terminal are executed by the processor, the three-periodic minimal surface generation method described in any one of claims 1 to 6 can be implemented.