A variable thickness 3D printing model generation method based on feature-preserving offset calculation

Through the method based on feature offset-proof calculation, the self-intersection and distortion problems of 3D printed thin shell structures are solved, and the moderate grid density and calculation efficiency are improved, which is suitable for the variable requirements of thin shell thickness in various complex models.

CN116811251BActive Publication Date: 2025-08-26HANGZHOU DIANZI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211734075.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-22
Publication Date
2025-08-26
Estimated Expiration
2042-12-22

AI Technical Summary

Technical Problem

When generating thin shell structures, existing 3D printing technology is difficult to meet the needs of maintaining characteristics, suitable for various models, moderate inner grid density, different local offset distances, variable thickness of thin shells, and high computing efficiency, and is prone to self-intersection, excessive distortion and wrinkles.

Method used

Using a method based on feature-preserving offset calculation, the AABB tree is constructed by reading the triangular grid and patch offset, using quadratic planning to solve the offset position, dynamically establish the grid, perform patch screening and cutting, and generate the inner surface to ensure the maintenance and calculation efficiency of sharp features.

Benefits of technology

It is realized that the thin shell-like model with moderate grid density is generated while maintaining sharp features, reducing self-intersecting and distortion, and improving computing efficiency. It is suitable for various complex models, and the thin shell thickness is variable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116811251B_ABST
    Figure CN116811251B_ABST
Patent Text Reader

Abstract

The present invention discloses a variable thickness 3D printing model generation method based on feature-preserving offset calculation. The present invention first reads the triangular mesh represented by the OBJ mesh format and the offset of each facet, and calculates the ideal offset position of the facet through quadratic programming. Secondly, the coverage area of ​​each facet offset is calculated, the BFS method dynamically establishes a grid, and performs the first screening of generated faces, deleting faces that are definitely not required to be generated last. Then the remaining faces outside the grid are cut off, and the second screening of generated faces is performed to determine whether they are faces that need to be generated. Finally, the third screening of generated faces is performed to determine whether the midpoint of the facet is outside the initial grid, a list of faces that need to be generated is constructed, and a topological structure is established and re-meshed. The present invention has good parallelism, short running time, the generated mesh has no self-intersection, the mesh density is moderate, and sharp features are well maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of triangular mesh surface offset calculation, and in particular relates to a variable thickness 3D printing model generation method based on feature-preserving offset calculation. Background Art

[0002] 3D printing is a technology that builds three-dimensional objects from CAD models or digital 3D models. It can deposit, connect or solidify materials under computer control.

[0003] While in the 1980s, 3D printing technology was considered suitable only for the production of functional or aesthetic prototypes, by 2019, the accuracy, repeatability, and material range of 3D printing had increased to the point where some 3D printing processes were considered an industrial production technology. One of the main advantages of 3D printing is the ability to produce very complex geometries that would be difficult to construct manually. Hollow parts or parts with internal truss structures are particularly popular.

[0004] In recent years, 3D printing technology has been widely used in various fields, including handicrafts, construction materials, medical implants, and aircraft components. For example, Airbus established a 3D printing R&D team in 2007 and successfully used electron beam melting (EBM) technology to produce titanium structural components on a satellite in 2011. In September 2017, Airbus announced the installation of 3D-printed titanium parts on the first mass-produced A350 XWB aircraft. Over 1,000 parts in the A350 XWB fuselage are 3D-printed. Despite the increasing popularity of 3D printing machines, the price of printing materials remains significantly higher than that of materials used in traditional manufacturing methods. Furthermore, the weight of a fully solid printed structure is very high, making it difficult to meet the requirements of applications such as medical and aircraft parts, where weight requirements are very strict.

[0005] Therefore, how to effectively reduce the actual printing volume of the model, thereby reducing weight and saving printing costs is an important challenge facing 3D printing technology. In response to the problem of material-saving printing, researchers at home and abroad have proposed many solutions. Among them, the use of a thin shell structure is a better solution that can meet weight requirements, cost constraints, and structural rigidity. When 3D printing, a thin shell model can be described by an inner surface and an outer surface. The part between the inner surface and the outer surface is the entity that needs to be printed. The more commonly used solution is to give an outer surface and the relevant thickness information, and use a program to automatically calculate and generate the inner surface strategy.

[0006] There are currently four mainstream approaches to generating thin shell-like structures. The first is the direct offset method. For complex CAD models with defects, this method makes it difficult to determine which facets need to be generated and which do not when self-intersection occurs after offset. Consequently, this algorithm generates a broken mesh and is prone to localized excessive distortion and wrinkling. The second is a method based on distance fields and resampling. However, because the grid width must be smaller than the offset distance, it is difficult to generate thinner parts. A high sampling rate is required to restore details, resulting in long runtimes. Furthermore, because it relies on implicit sampling of the distance field, it cannot restore sharp features. The third approach is based on the Minkowski sum method, which performs a Minkowski sum calculation on a spherical structure of a specific radius fitted to the mesh and polygons. This method cannot achieve variable thickness. The fourth is a method based on rays and voxels. However, due to its voxel-like structure, it is difficult to accurately represent the shape within a limited grid density. Summary of the Invention

[0007] In response to the defects of the above-mentioned method, the present invention proposes a variable thickness 3D printing model generation method based on feature-preserving offset calculation. This method has the characteristics of good efficiency and sharp feature preservation. The user only needs to input a mesh and the ideal offset distance value of each corresponding triangular facet. The present invention can automatically generate the mesh result after offset. The inner surface formed after offset and the input outer surface constitute a solid body, realizing the conversion of a triangular mesh into a thin shell-like solid model that can be 3D printed.

[0008] The present invention comprises the following specific steps:

[0009] S1. Read the triangular mesh represented by the OBJ mesh format and the offset of each face: read the OBJ file of the mesh and the information marking the ideal offset of each face into the data structure used to store the mesh to obtain the initial mesh.

[0010] And construct an AABB tree of the initial mesh faces for all the faces of the initial mesh.

[0011] S2. Quadratic programming to find the ideal offset position of the face: The ideal offset position of each mesh vertex is calculated by solving the quadratic programming method. The offset position satisfies the property of preserving features, thus achieving the printing requirement of the model with variable thickness.

[0012] S3. Calculate the coverage area F of each patch offset i :For each patch offset, six tetrahedrons are generated and the coverage area F of each patch is calculated by bidirectional ray intersection operation i , the coverage area is an octahedron, and in rare cases it degenerates into a hexahedron. The enclosing face of the coverage area is named P ij(The coverage area F of the i-th patch i According to the coverage area F i All the patches P ij , construct an AABB tree, called the coverage area F i The AABB tree is used to accelerate the determination of whether a given point is within the coverage area in subsequent steps.

[0013] Of the two facets in this octahedron, one is the face before offset and the other is the face after offset. The face before offset is definitely not a face of the final inner surface, while the face after offset is likely to be a component of the final inner surface. The remaining six faces may also be components of the final inner surface facets if they are distorted.

[0014] In the special degenerate case of the hexahedron, the approach remains unchanged.

[0015] S4, bfs method dynamically establishes grid: search by bfs method to quickly determine the coverage area F formed by each patch offset i Which grids are involved? If the grids involved are found, the area F will be covered. i Add to the list of this grid. If the grid does not exist, build it here and cover the area F. i Add to the list of the grid. The grid here is used to divide the space into several small subspaces, which is a cube in the space, and its six planes are parallel to the xy plane, yz plane, and xz plane of the spatial coordinate axis. The three coordinate values ​​of the vertex with the smallest coordinate of the grid with the smallest coordinate in the space are respectively taken as the minimum x, y, and z positions of the coordinates of all vertices of the initial grid, and the side length of the grid is twice the average side length of all triangles of the initial grid. Then, starting from this grid with the smallest coordinate, new grids are arranged in the direction of increasing coordinates. These grids will cover the entire space, but not all grids in the space are established in the program. Traverse each F i By calculating the coordinates, the grid in the space is quickly determined. If the grid is not established in the program, it is established. Then the grid is expanded to the grid near it. If the grid is not established in the expanded area, it is established. Each of the grids in S5 to S8 is executed separately using a thread.

[0016] S5, the first generation of facet screening: In each grid, there are many coverage areas F obtained in step S4 i , is recorded in the list of the grid in S4. i Every P ij, to determine whether its state is completely in another coverage area. If its state is completely in another coverage area, such as the coverage area F formed by the facets of the u-th initial grid u (u is not equal to i), then the patch must not be the patch that needs to be generated last, delete the patch, otherwise keep the patch. This step can delete a large number of patches that do not need to be generated last, speeding up the calculation. This step uses the AABB tree composed of all the covered areas in the grid to accelerate the calculation. This AABB tree consists of all the F i All the patches P ij constitute.

[0017] S6, cutting: In each grid, there are many facets that cannot be excluded in S5. These facets have a very high probability of becoming part of the inner surface. For some facets in a certain grid, part of these facets may exist in another grid, so the part of the facet that exceeds this grid needs to be cut off. After the facets are cut, they may not be triangles, but polygons, so they need to be triangulated into many small triangles first, and in S7, the facets need not to intersect with other facets (except for edge intersections), so it is also necessary to combine the intersection lines of the facets and other facets to perform BSP subdivision to ensure that the subdivided facets do not intersect.

[0018] The process is as follows: the retained patches in S5 (effective P ij ) The part outside the grid is cut off. Project it into two-dimensional space and perform Delaunay triangulation into several triangular patches. A triangular patch is denoted as S ijk (F i The kth facet after Delaunay triangulation of the jth component facet of S), several triangular faces constitute S ijk Set. All valid P ij The intersection operation is performed on two pairs of faces. This process is accelerated by using the AABB tree composed of all the patches in the grid. The obtained intersection projection is compared with the corresponding 2D Delaunay triangulated S ijk The collected patches are subdivided using the BSP method.

[0019] The triangular facets obtained after subdivision are calculated back to the three-dimensional space and recorded as B ijk , which represents the subdivided F i The kth face after the subdivision of the jth component face.

[0020] S7, the second generation of face screening: for each grid, determine each B ijk Is it a patch that needs to be generated? ijk Geometric center point, traverse each F of the grid iThe AABB tree of the corresponding coverage area obtained in S3 is used to determine whether it is in any F i If yes, the patch is considered interior; if no, the patch is considered boundary and is added to the candidate generation list. While the above determination method is slow, it can be accelerated by combining the raycast method with an AABB tree constructed from all the patches covering the grid area, and triple determination.

[0021] S8. Screening of the third generated facets: When the initial mesh is a manifold mesh, for the facets in the alternative generation list, the bidirectional ray detection intersection of the AABB tree of the initial mesh facets in S1 is performed to determine whether the geometric center point of the facet is outside the initial mesh. If not, the facet is added to the list of facets that need to be generated for the grid.

[0022] The above method is used when the initial mesh is a manifold mesh. If the initial mesh is a non-manifold mesh (not closed or self-intersecting, etc.), this part uses the winding number, which is an alternative solution when the initial mesh is non-manifold. When 50% of the directions of the rays emitted from a point in all directions are covered by the mesh, the point is judged to be inside the mesh, otherwise it is outside.

[0023] S9, Topology Construction: For each grid cell, the remaining facets after S7 and S8 are filtered, a local mesh is generated using the vertex merging and edge splitting strategy. For adjacent faces of adjacent grid cells, the same vertex merging and edge splitting strategy is used to generate meshes.

[0024] S10. Remeshing: Remesh the final mesh to improve the quality.

[0025] The present invention has the following beneficial effects: Existing algorithms cannot simultaneously meet all of the following properties: feature preservation, applicability to various models, moderate inner mesh density, varying local offset distances, the ability to handle both thin and thick shells, and high computational efficiency. However, the present invention offers excellent parallelism, short runtime, generates meshes with no self-intersections, moderate mesh density, and good preservation of sharp features. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a schematic diagram of traditional distance field migration in two-dimensional space;

[0027] Figure 2 This is a schematic diagram of the downward migration in two-dimensional space for this study;

[0028] Figure 3 Schematic diagram of the coverage area formed by 6 tetrahedrons;

[0029] Figure 4A patch representation of the coverage area diagram;

[0030] Figure 5 is a wireframe representation of a schematic diagram of the coverage area;

[0031] Figure 6 Dynamically create a grid diagram for bfs;

[0032] Figure 7 The patch consisting of all covered areas in the grid;

[0033] Figure 8 The remaining dough after steps S5-S8;

[0034] Figure 9 is the result without remeshing;

[0035] Figure 10 is the result of remeshing;

[0036] Figure 11 is the outer surface diagram;

[0037] Figure 12 Specific implementation of the inner surface diagram calculated by the calculation results of the present invention;

[0038] Figure 13 A schematic diagram of the entire process. DETAILED DESCRIPTION

[0039] To make the present invention more intuitive, the following is further explained with reference to an example: A method for generating a variable thickness 3D printing model based on feature-preserving offset calculation includes the following steps:

[0040] S1. Read the triangular mesh represented by the OBJ mesh format and the offset of each face:

[0041] The mesh's OBJ file and the information marking the ideal offset of each face are read into the mesh data structure to obtain the initial mesh. This data structure can be any common triangle mesh data structure that only needs to store the mesh's point, line, and surface information and the corresponding adjacency relationships. An AABB tree of all the faces of the initial mesh is then created.

[0042] The OBJ format describes a mesh, including the exact location of each vertex and the vertices that make up each face. The ideal offset for each face is an additional column of floating-point numbers that correspond to the desired offset for each face in the OBJ file.

[0043] AABB tree: A binary tree composed of AABB nodes. Each node in the tree is a bounding box, and the bounding box of a node encloses the bounding boxes of all its child nodes. Face information is stored in these bounding boxes. That is, after an AABB tree is created for a group of faces, these faces are stored in different AABB tree nodes, allowing for fast ray intersection calculations with the group of faces. This is a very classic data structure for fast ray intersection calculations.

[0044] S2, quadratic programming to find the ideal offset position:

[0045] Since it is necessary to maintain sharp features, starting from each local, define the vertex V of the initial mesh and its 1-neighborhood patch R i Constitute a local. Assume that there are k facets in this local area, and each R i The ideal offset distance is L i .

[0046] Figure 1 For the traditional distance-based measurement method, Figure 2 Schematic diagram of position offset of the present invention, Figure 1 and Figure 2 This is a schematic diagram of the 2D case. ABC is offset. The traditional method is based on distance, which will result in Figure 1 The arc-shaped part appears in the present invention. Figure 2 The sharp features are restored. Figure 2 As shown, when the offsets of lines f and g are not equal, the present invention can solve the equation to find that the offset of g is smaller and the offset of f is larger, and the local area still maintains the same offset position as the original grid feature, realizing the printing requirement of the model with variable thickness.

[0047] All the faces R in the 1-neighborhood of the vertex V in this local i The plane formed is denoted as A i The experiment shows that the feature preservation after the local offset needs to meet the point V' to A obtained after the V offset. i The distance is equal to L i However, since the offset distance of each patch is not equal and the local 1-neighborhood may be over-distorted, it is impossible to satisfy V' to plane A i The distance is L i A relatively optimal solution for this part is needed, which relaxes the offset distance condition to 0.9L. i ~1.2L iIf there is still no solution, the constraints can be relaxed again, thus forming the constraints. The optimization goal is to make the distance between V' and V as close as possible. The point-to-point distance is a quadratic expression, and the point-to-face distance is a linear constraint. Therefore, a quadratic programming form is satisfied. The quadratic programming equation is established and solved, and the idea is as follows.

[0048] The distance between points is D: The coordinates of the offset point V' can be written as a vector (x, y, z) T , abbreviated as The coordinates of point V before offset are x p ,y p , z p ,but:

[0049] D=(xx p ) 2 +(yy p ) 2 +(zz p ) 2

[0050] Expand to get:

[0051]

[0052] Where e1 and e2 are the coefficients of the above equation after it is expanded into a quadratic form:

[0053] e1=x p +y p +z p

[0054] e2=x p *x p +y p *y p +z p *z p

[0055] D is the optimization target. When the distance constraint to the plane is satisfied, the point closest to V is the ideal V', and this distance is D.

[0056] The distance D between points can be calculated based on the distance from point to plane A. i Distance L i Create constraints:

[0057]

[0058] Among them, n i is the normal vector of the i-th face in the 1-neighborhood, k is the number of faces in the 1-neighborhood, and the constraint is derived as follows:

[0059] 0.9L i|n i |≤|(xx i yy i zz i ) T ×n i |≤1.2L i |n i |,i∈[1,k]

[0060] 0.9L i |n i |≤|(xyz) T ×n i |-|(x i y i z i ) T ×n i |≤1.2L i |n i |,i∈[1,k]

[0061] 0.9L i |n i |+|(x i y i z i ) T ×n i |≤|(xyz) T ×n i |

[0062] ≤1.2L i |n i |+|(x i y i z i ) T ×n i |,i∈[1,k]

[0063] Pick

[0064] exist In the influence of the change on the optimization target D, e2 has no effect, so e2 is discarded and the final planning target is:

[0065]

[0066] c i is the -2e1 corresponding to the i-th patch, and E is the unit matrix.

[0067] The constraints of the planning objectives are:

[0068]

[0069] This model is a standard quadratic programming problem model, which can be solved very quickly using a quadratic programming solver.

[0070] S3, calculate the effective area F of each patch offset i :

[0071] Assuming the three vertices of a triangle are V1, V2, and V3, the three vertices of the triangle after offsetting through quadratic programming are V1', V2', and V3'. Using these six points, six tetrahedrons are constructed, namely V1V2V3V1', V1V2V3V2', V1V2V3V3', V1V1'V2'V3', V2V1'V2'V3', and V3V1'V2'V3'.

[0072] Figure 3 As shown, triangle DKL is the initial facet, and the ideal offset positions calculated for the three points are NMO. Then six tetrahedrons are constructed, namely DKLN, DKLO, DKLM, MBOD, MNOK, and MNOL. Then these six tetrahedrons will form a convex hull structure in space (the structure is an octahedron, and in some cases it degenerates into a hexahedron, that is, F i ).

[0073] Figure 4 and Figure 5 The two pictures describe the specific shape of the octahedron. The first one is the shape with facets, and the second one is the pure wireframe shape.

[0074] The enclosing area of ​​the space formed by six tetrahedrons can be represented by 6 to 8 triangular facets, usually 8, and it will become 6 in special cases. The method to find the enclosing area is that there are 24 facets in total for the six tetrahedrons. The center point of the triangle of each facet emits two rays in the positive and negative normal directions of the triangle respectively. If these two rays pass through other facets, then the facet is not the outer skin facet of the convex hull, otherwise it is the outer skin facet of the convex hull. When the local area is a triangular prism, there will be overlapping of the outer skin facets. By selecting an outer skin facet that has no overlapping parts with other selected facets each time, overlap can be avoided. The essence of this operation is to find the outer skin facets of a coverage area and use these facets to represent the coverage area. The coverage area formed by the facets of the i-th initial mesh is recorded as F i , and then construct an AABB tree consisting of the patches in the coverage area, called the coverage area F i The AABB tree of the following S5-S8 is to find the inner surface patches of the final printed model from these patches.

[0075] S4, bfs method dynamically builds the grid:

[0076] The BFS method is a breadth-first search algorithm that expands outward layer by layer from an initial position. Using a BFS-based approach to grid construction significantly reduces the number of grid cells. Ineffective grids are not created for these areas, saving both time and space. Furthermore, once the grid is established, it is divided into multiple parts that do not affect each other and can be executed in parallel, with each grid executed using a separate thread, resulting in better efficiency.

[0077] The grid here is used to divide the space into several small subspaces, which is a cube in the space, and its six planes are parallel to the xy plane, yz plane, and xz plane of the spatial coordinate axis. The three coordinate values ​​of the vertex with the smallest coordinate of the grid with the smallest coordinate in the space are respectively taken as the minimum x, y, and z positions of the coordinates of all vertices of the initial grid, and the side length of the grid is twice the average side length of all triangles of the initial grid. Then, starting from this grid with the smallest coordinate, new grids are arranged in the direction of larger coordinates. These grids will cover the entire space, but not all grids in the space are created in the program. Traverse each F i By calculating the coordinates, it is quickly determined which grid in the space it is in at this moment. If the grid is not established in the program, it will be established, and the grids near the grid will be expanded. If there is no grid established in the expanded area, it will be established.

[0078] As attached Figure 6 As shown, the grid divides the space into several small subspaces, each of which is divided by some F i Covering: For each grid, the surface patch at the junction of the covered space and the uncovered space is the surface patch that needs to be screened and generated in the following steps S5 to S8.

[0079] For each coverage area F formed according to S3 i , which is a polyhedron obtained by offsetting the three vertices of the triangle. The offset distance of each vertex is L1', L2' and L3'. Take the geometric center point (V1+V2+V3) / 3 of the triangle V1V2V3, subtract the minimum grid vertex coordinates, and divide it by the grid side length L g , find the grid to which it belongs, and start traversing with the BFS algorithm with the grid as the center. When the distance from the traversed grid to the triangle V1V2V3 exceeds max(L1',L2',L3')+L g When , bfs is terminated and continues to search outward from the grid. Only when at least one covered area F i Only the searched grids need to be built. And the list of each grid records many Fs that may pass through the grid. i .

[0080] S5, the first generation of facet screening:

[0081] In each grid, there are many coverage areas F obtained in step S4 i ,like Figure 7 As shown. In S4, it is recorded on the list of the grid. i Each P in ij , if its complete in a certain F u (u is not equal to i), then the patch cannot be the patch that needs to be generated last. i Do not intersect, then as long as there is a point on the surface in F i Inside, the entire patch is inside, that is, this patch must not be a component of the inner surface that needs to be generated at the end, and the patch is covered by other covering areas.

[0082] Therefore, to determine whether its state is completely in another coverage area, we can find P ij With which other coverage areas F u Intersect, for the remaining non-intersecting coverage areas, through P ij Whether the geometric center of the face is inside it determines whether the face may need to be generated.

[0083] To find P ij With which other coverage areas F u The intersection process can be accelerated by using the "AABB tree composed of all the patches in the grid", which stores the information of all the patches in the grid, and can calculate P in a faster time. ij With every other F u The non-co-edge intersection lines that make up the face (the intersection lines do not intersect with P ij Any edge of the face is collinear). There will be F with non-colinear intersection lines. u Marked as intersection state means non-edge intersection. For all remaining F that are not marked as intersection state u , judge P ij Is the geometric center point of the patch in the F u Internal. If so, then the P ij The patch is marked as not to be generated.

[0084] S6, cutting:

[0085] The reason is that there are many faces in this grid that cannot be excluded in S5. These faces have a very high probability of becoming part of the inner surface, and these faces may exist in two grids at the same time, so the part in this grid needs to be cut out.

[0086] The remaining patches (effective P ij ) The part outside the grid is cut off. Use Delaunay triangulation to project into two-dimensional space to form several triangular patches, one of which is denoted as S ijk (F i The kth facet after Delaunay triangulation of the jth component facet of S), several triangular faces constitute S ijk Set. All valid P ij The intersection operation is performed on each pair, and the projection of the obtained intersection line is compared with the corresponding two-dimensional Delaunay triangulated S ijk The collected patches are subdivided using the BSP method.

[0087] Recalculate the result back to three-dimensional space and record it as B ijk (F after subdivision i The kth patch after the jth component patch is subdivided).

[0088] Each triangle is essentially a structure in two-dimensional space. If projected onto the plane where the triangle lies, it becomes a two-dimensional geometric figure. When this triangle intersects with other triangles, the intersection line always lies on this triangle. Therefore, it can also be projected onto this plane, thus forming a local 2D space. Within this space, the result of Delaunay triangulation is subdivided using BSP technology. After the subdivision is complete, no small triangles are cut by the intersection line. In other words, the intersection line always exists at the edge of the subdivided small triangles.

[0089] The projection method to two dimensions is as follows:

[0090] S ijk The plane is recorded as T. Take any two mutually perpendicular and equal-length vectors on plane T as the two reference vectors of the patch. Triangle S ijk The geometric center is denoted as C. Then the intersection point X formed by the intersection of the triangle and the grid is projected into the 2D space as follows:

[0091] Take vector The vector and Do the dot product and record the results as x and y. (x, y) is the coordinate in two-dimensional space.

[0092] The method of projecting a point R in the two-dimensional space with coordinates (rx, ry) back to the three-dimensional R' is:

[0093]

[0094] BSP subdivision involves adding intersection lines to the original triangular facets, which have been converted to 2D coordinates, and then performing intersection calculations. Some original triangles may be divided into multiple polygons by the intersection lines. For non-triangles in these polygons, a point is inserted at their geometric center and then connected to all vertices in sequence to form multiple triangles.

[0095] S7, the second generation of facet screening:

[0096] Figure 7 The result of S5 is cut by S6 and then generated by S7 and S8. Figure 8 The situation shown.

[0097] The present invention first proposes a simple method for each face B that needs to be judged whether it is generated after cutting. ijk , using the face B ijk The geometric center point of the local area is used to query all the coverage areas F i AABB tree, where the value range of i is recorded in the list obtained in S3 for this grid. Since a face may be just in the coverage area F i and coverage area F j At the intersection of the areas formed (i is not equal to j), the patch queries the two coverage areas F i AABB and coverage area F j The AABB tree will be returned in the boundary, but its i and F j The interior of the region is formed by the two-sided exploration method. ijk The geometric center point of the face is offset by a minimum value in the positive and negative normal directions respectively, and then the two offset points are used to query the AABB trees of all covered areas. If they are all inside, the state of the face is judged to be inside, otherwise it is the boundary.

[0098] The present invention then proposes an improved method of the above method, and finally adopts an improved approach: each face B ijk , by shooting a ray from the geometric center point in the normal direction. And perform accelerated intersection between the ray and the AABB tree composed of all the patches covering the area in the grid. Then perform three judgments:

[0099] (1) If the ray passes through the F corresponding to itself i Other F u If (u is not equal to i) 1 time (excluding special cases 1 and 2), the patch does not need to be generated.

[0100] Special case 1, the intersection point of the rays is F u The points that are common to the two constituent patches in .

[0101] Special case 2, the intersection of the rays is at B ijk superior.

[0102] (2) When the ray passes through all F u All execute (1) and cannot be judged as not needing to be generated, and the part F in the judgment of (1) u There is a special case 1. For F with special case 1 u , coverage area F is required u The AABB tree determines whether the geometric center point is in F u If it is inside, the patch does not need to be generated.

[0103] (3) When all rays pass through F u All execute (1) and cannot be judged as not needing to be generated, and the part F in the judgment of (1) u There is a special case 2. For F with special case 2 u , then it is necessary to emit a reverse ray, and then if the reverse ray also intersects with the AABB tree composed of all the patches in the grid, and intersects with a certain coverage area F v If special case 2 also exists after the intersection of (u is not equal to v), then the patch does not need to be generated. If the above (1), (2) and (3) cannot determine that it does not need to be generated, then the patch is a patch that may need to be generated and is added to the alternative generation list, and a final judgment is required in S8.

[0104] S8, the third generation of facet screening

[0105] For the facets in the candidate list, the bidirectional ray detection intersection of the AABB tree of the initial mesh facet is used to determine whether the geometric center point of the facet is outside the initial mesh (that is, the outer surface mesh, that is, the input mesh). If not, the facet is added to the list of faces that need to be generated for the grid.

[0106] The above method is used when the initial mesh is a manifold mesh. If the initial mesh is a non-manifold mesh (not closed or self-intersecting, etc.), this part uses the winding number, which is an alternative solution when the initial mesh is non-manifold: when 50% of the rays emitted from a point in all directions are covered by the mesh, the point is judged to be inside the mesh, otherwise it is outside.

[0107] The reason for this step is that there are some B ijk The patch is outside the initial mesh and is not affected by any F u Covered.

[0108] If a part of a face is formed after self-intersection, it will be in another F uThe other part is outside the initial mesh. This patch cannot be excluded in S5 and will be divided into several parts through S6. u The inner part of is excluded in S7, and S8 excludes the part outside the initial mesh.

[0109] S9, topology establishment:

[0110] S9 Part 1: The processing of S5 to S8 obtains many Bs left in each grid ijk Patches are included in the list of patches to be generated. These patches are topologically merged in this step. If the distance between two vertices is less than a minimum value, the two points are merged and the topological connection of the area is rebuilt. If the distance between a point and an edge is less than a minimum value, the edge is broken, the point is inserted, and the triangles on the edge are split in two. The above process is performed within a single grid.

[0111] The first part of the above steps S5 to S9 are all executed in one grid, and therefore are all parallel multi-threaded operations.

[0112] The second part of S9, for topological restoration between grids, is to first traverse all adjacent grids, and then perform the same operation as the first part on all points and edges in the grid whose distance to the intersection surface is less than the minimum value. The original result grid of the model is obtained, such as Figure 9 shown.

[0113] The minimum value is the minimum value that tends to 0. Due to the range of floating point numbers, it is 10. -6 If the model as a whole is relatively small, a smaller value can be appropriately taken.

[0114] S10, finally execute the re-meshing algorithm of the triangular mesh. The reason is that the original result mesh quality obtained in S9 is poor. Re-meshing is needed. The mesh quality can be improved through step 10, such as Figure 10 shown.

[0115] The complete process is as follows Figure 13 As shown, the final Figure 11 is a schematic diagram of the input grid, Figure 12 This is a diagram of the final result. Figure 11 and Figure 12 They become the inner and outer surfaces during 3D printing, respectively, thereby meeting the printing requirements of the thin shell structure.

Claims

1. A method for generating a variable thickness 3D printing model based on feature-preserving offset calculation, characterized in that: The specific steps include: S1. Read the triangular mesh represented by the OBJ mesh format and the offset of each face: read the OBJ file of the mesh and the information marking the ideal offset of each face into the data structure used to store the mesh, obtain the initial mesh, and construct the AABB tree of the initial mesh face with all the faces of the initial mesh; S2. Quadratic Programming to Calculate the Ideal Offset Position of the Face: Calculate the ideal offset position of each initial mesh vertex by solving the quadratic programming. S3. Calculate the coverage area F of each patch offset i , for each patch offset, six tetrahedrons are generated, and the coverage area F of each patch is calculated by bidirectional ray intersection operation i , the enclosing patch of the coverage area is P ij , and according to the coverage area F i Construct AABB tree of all faces; S4, bfs method dynamically establishes grid: search by bfs method to quickly determine the coverage area F formed by each patch offset i Which grids are involved? If the search involves the existence of the grid, it will cover the area F i Add to the list of this grid. If the grid does not exist, build it here and cover the area F. i Add to the list of this grid; S5, the first generation of patch screening: there are multiple coverage areas F in S4 i is recorded in the list of each grid, for each P in the coverage area ij , determine whether its state is completely in another coverage area, if it is, delete the patch, otherwise keep the patch; S6, cutting, cutting off the part of the face outside the grid that is retained in S5: after the face is intersected with the grid, the vertex of the polygon formed is recorded as V, and V is projected into two-dimensional space and two-dimensional Delaunay triangulation is performed to form several triangular facets recorded as S ijk Set, calculate the intersection line of all the faces retained by S5, and compare the projection of the obtained intersection line with the corresponding two-dimensional Delaunay triangulated S ijk The face of the collection is subdivided by the BSP method; the several triangular facets obtained after subdivision are calculated back to the three-dimensional space and recorded as B ijk ; S7, the second generation of face screening: for all B ijk The geometric center point traverses the AABB tree obtained in S3 corresponding to each coverage area of ​​the grid to determine whether it is in any coverage area. If so, the state of the face is internal; If not, the patch state is boundary, and the patch is added to the candidate generation list; S8, screening of the third generated patches: When the initial mesh is a manifold mesh, for the patches in the candidate generation list, bidirectional ray detection and intersection of the AABB tree of the patches in the initial mesh in S1 are performed to determine whether the geometric center point of the patch is outside the initial mesh. If not, the patch is added to the list of patches to be generated for the grid. S9, topology establishment: For each grid, the remaining faces after S8 screening are generated using the vertex merging and edge splitting strategy to generate a local mesh; For the adjacent faces of adjacent grids, the same vertex merging and edge splitting strategy is used to generate the mesh; The vertex merging is to merge two points whose distance is less than a minimum value approaching 0; The edge splitting is as follows: when the distance between a point and an edge is less than a minimum value that tends to 0, the edge is split at the position of the point, and the point formed after the split is merged with the point, and then the topological relationship is adjusted; S10, Remeshing: Remesh the generated mesh of S9 to improve the quality.

2. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: In S2, the specific process of solving the quadratic programming is as follows: The distance between points is D: The coordinates of the offset point V' are written in vector form (x, y, z) T , recorded as The coordinates of point V before offset are x p ,y p , z p ,but: D=(x-x p ) 2 +(y-y p ) 2 +(z-z p ) 2 Expand to get: Where e1 and e2 are the coefficients of the above equation after it is expanded into a quadratic form: e1=x p +y p +z p e2=x p *x p +y p *y p +z p *z p D is the optimization target. When the distance constraint to the plane is satisfied, the point closest to V is the ideal V', and this distance is D. For the distance D between points, according to the distance from point to plane A i Distance L i Create constraints: Among them, n i is the normal vector of the i-th face in the 1-neighborhood, k is the number of faces in the 1-neighborhood, and the constraint is derived as follows: 0.9L i |n i |≤|(x-x i y-y i z-z i ) T ×n i |≤1.2L i |n i |,i∈[1,k] 0.9L i |n i |≤|(x y z) T ×n i |-|(x i y i z i ) T ×n i |≤1.2L i |n i |,i∈[1,k] 0.9L i |n i |+|(x i y i z i ) T ×n i |≤|(x y z) T ×n i |≤1.2L i |n i |+|(x i y i z i ) T ×n i |,i∈[1,k] Pick exist In the influence of the change on the optimization target D, e2 has no effect, so e2 is discarded and the final planning target is: Among them, c i is the -2e1 corresponding to the i-th patch, E is the unit matrix, and the constraints of the planning objective are: This model is a standard quadratic programming problem model, which uses a quadratic programming solver to solve it quickly.

3. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: In S3, the coverage area F i For an octahedron.

4. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: In S3, the coverage area F i It also degenerates into a hexahedron; In the case of hexahedral degeneration, the treatment method is the same as S3.

5. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 3, characterized in that: Two facets in the octahedron, one is a face before offset and the other is a face after offset; The face before offset cannot become the face of the final inner surface, the face after offset is a component of the face of the inner surface, and the other six faces are components of the final inner surface patch when distortion occurs.

6. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: In S4, the bfs method is used to search and quickly determine the coverage area F formed by each patch offset. i The specific process of which grids are involved is as follows: For each coverage area F formed according to S3 i , is a polyhedron obtained by offsetting the three vertices of the triangular face, and the offset distance of each vertex is L1', L2' and L3'; Take the geometric center point of the triangle V1V2V3, find the grid to which it belongs by subtracting the minimum grid vertex coordinate and dividing it by the grid side length, and start traversing the grid with the BFS algorithm as the center. When the distance from the traversed grid to the triangle V1V2V3 exceeds max(L1',L2',L3')+L g When , terminate bfs and continue searching outward from this grid, where L g is the side length of the grid.

7. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 6, characterized in that: The grid is used to divide the space into several small subspaces, which is a cube in the space, and its six planes are respectively parallel to the xy plane, yz plane, and xz plane of the spatial coordinate axis; The three coordinate values ​​of the vertex with the smallest coordinate of the grid with the smallest coordinate are respectively the positions with the smallest x, y, and z coordinates among all the vertices of the initial grid. The side length of the grid is twice the average side length of all the triangles of the initial grid. Starting from this grid with the smallest coordinate, new grids are arranged in the direction of increasing coordinates. These grids will fill the entire space, but not all grids in the space are created in the program. Each of the grids in S5 to S8 is executed using a separate thread.

8. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: In S5, it is determined whether the state is completely within another coverage area: Find out which other coverage areas the patch intersects with. For the remaining non-intersecting coverage areas, check whether the geometric center of the patch is inside them. If so, mark the patch as not generated. The process of figuring out which covered areas a patch intersects with is accelerated by using an AABB tree of all covered areas in the grid.

9. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: The judgment process in S7 also includes: for each face B ijk , by emitting rays from the geometric center point in the normal direction, and accelerating the intersection of the ray with the AABB tree composed of all the patches covering the area in the grid, and then performing triple judgment to achieve further acceleration; The specific process of the triple judgment is as follows: a. If the ray passes through the area F except the area it corresponds to i Other coverage areas outside F u 1 time, the patch is not generated; Special case 1, the intersection point of the rays is F u The points that are common to the two patches in ; Special case 2, the intersection of the rays is at B ijk superior; b. When the ray passes through all F u All execute a and cannot be judged as not generated, and part F in the judgment of a u There is a special case 1. For F with special case 1 u , using coverage area F u The AABB tree determines whether the geometric center point is in F u If it is inside, the patch will not be generated; c. When all rays pass through F u All execute a and cannot be judged as not generated, and part F in the judgment of a u There is a special case 2. For F with special case 2 u , then the reverse ray is emitted. If the reverse ray also intersects with the AABB tree composed of all the patches in the grid, and intersects with a certain coverage area F v If special case 2 also exists after the intersection, the patch will not be generated; If the above a, b and c are all unable to determine that the face is not to be generated, the face is added to the candidate generation list and judged again in S8.

10. The method for generating a variable thickness 3D printing model based on feature-preserving offset calculation according to claim 1, characterized in that: In S8, when the initial mesh is a non-manifold mesh, this part uses: when 50% of the directions of the rays emitted from a point in all directions are covered by the patch, the point is judged to be inside the mesh, otherwise it is outside.

Citation Information

Patent Citations

  • Method for building accurate molded surface of automobile covering part drawing mold

    CN103617302A

  • STL file-oriented three-dimensional model preprocessing method and system

    CN112581623A