An assembly method, device, equipment and medium for unstructured surface meshes
By importing the CAD model in the generation of non-structural surface mesh, establishing a watertight grid data structure, extracting data on the virtual surface ring, dividing closed areas and performing mapping calculations, and generating a three-dimensional non-structural mesh, it solves the problems of cumbersome repair and low efficiency caused by relying on geometric entities in the existing technology, and achieves efficient and high-quality grid generation.
Patent Information
- Application Number
- CN202510581468.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The existing unstructured mesh generation methods rely heavily on geometric entities and require tedious repair and simplification of the model, especially the difficulty in repairing holes, resulting in low generation efficiency and poor quality.
By importing and repairing the initial CAD model, a watertight mesh data structure is established, the virtual edge data on the ring on the virtual surface is extracted, the closed area is divided, and the initial three-dimensional mesh is generated using ring point mapping and two-dimensional calculations. Finally, the three-dimensional non-structural mesh is obtained through the surface parameterization algorithm inverse mapping.
The grid can be generated without a complete geometric entity, which reduces dependence on geometric data, improves generation efficiency and grid quality, and solves the cumbersome repair problems caused by relying on geometric entities in the existing technology.
Smart Images

Figure CN120087159B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer-aided design, and in particular to an assembly method, device, equipment and medium for a non-structured surface grid. Background Art
[0002] There are three main methods for generating unstructured meshes: frontier advancing method, grid method and Delaunay method. However, all existing unstructured mesh generation algorithms need to rely on geometric entities, which need to provide parameter domain space for mesh generation. Secondly, since unstructured mesh generation algorithms have high requirements for geometric models, it is necessary to repair and simplify the models according to the needs of calculation. Model repair is responsible for converting "dirty" geometry with "errors" into "clean" geometry that meets the requirements of mesh generation; feature simplification is performed after model repair, which is responsible for eliminating unnecessary design details to obtain a more cost-effective mesh model. The types of model errors and their causes are diverse and difficult to list. Therefore, in the traditional unstructured mesh generation process, the geometry often needs to be cleaned before mesh generation. Users need to identify all geometric errors and repair them one by one. This repair process often requires a lot of manual interaction, with the help of complex graphical interfaces, professional geometry processing software, and is very dependent on the experience of the operator. For complex models composed of a large number of components, the cost of manual repair is unbearable. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide an assembly method, device, equipment and medium for unstructured surface meshes, which can directly generate unstructured surface meshes without relying on complete geometric entities. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a method for assembling an unstructured surface grid, comprising:
[0005] Import and repair the initial CAD model, and build a watertight mesh data structure to obtain virtual surfaces;
[0006] Extracting the virtual edge data on the virtual surface, and dividing the target area of the repaired CAD model into a plurality of closed areas according to the connection relationship of the virtual edge data on the virtual surface; wherein the target area is a model surface area used to generate an unstructured grid;
[0007] Projecting each of the three-dimensional ring points of the closed area onto a target plane, and performing two-dimensional calculations on each of the projection points in the target plane to obtain two-dimensional ring points corresponding to each of the projection points; wherein the target plane is a plane corresponding to the maximum area of the closed area formed by projecting the three-dimensional ring points onto different three-dimensional planes;
[0008] Generate an initial boundary grid based on the two-dimensional region information composed of the two-dimensional ring points, and perform an inverse mapping process on the initial boundary grid by using the mapping relationship between the two-dimensional ring points, the corresponding projection points, and the three-dimensional ring points to obtain an initial three-dimensional grid;
[0009] Perform a two-dimensional mapping process on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inverse map the optimized two-dimensional grid back to the three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid.
[0010] Optionally, the importing and repairing the initial CAD model and establishing a watertight grid data structure to obtain a virtual surface includes:
[0011] Perform a model surface gap process on the initial CAD model to obtain a repaired CAD model without surface gaps, and then perform a mesh division and generation process on the repaired CAD model to obtain a virtual surface.
[0012] Optionally, the extracting the virtual edge data on the virtual surface and dividing the target region of the repaired CAD model into multiple closed regions according to the connection relationship of the virtual edge data on the ring includes:
[0013] Determine and extract the virtual edge data on the virtual surface based on the topological relationship representing each component of the repaired CAD model in the virtual surface;
[0014] Perform a region division on the target region of the repaired CAD model according to the virtual edge connection relationship of the virtual edge data on the ring to obtain multiple closed regions.
[0015] Optionally, the method for assembling the unstructured surface grid further includes:
[0016] Perform a region division on the target region of the repaired CAD model by using manually drawn grid lines to obtain multiple closed regions.
[0017] Optionally, the projecting the three-dimensional ring points of each closed region onto a target plane and performing two-dimensional calculations on the projection points in the target plane to obtain two-dimensional ring points corresponding to the projection points includes:
[0018] Determine the plane equation of the target plane; wherein, the plane equation is used to describe the position and direction of the target plane in the three-dimensional space;
[0019] Based on the plane equation and through a preset projection calculation method, determine the three-dimensional projection position of the three-dimensional ring points of the closed region projected onto the target plane to obtain each projection point located on the target plane;
[0020] Use the normal vector of the target plane as the normal vector of the two-dimensional plane to determine the target plane as the two-dimensional plane, and use the mapping points of the three-dimensional projection positions of the projection points on the two-dimensional plane as two-dimensional loop points.
[0021] Optionally, generating an initial boundary mesh based on the two-dimensional region information composed of the two-dimensional loop points, and performing an inverse mapping process on the initial boundary mesh by using the mapping relationship between the two-dimensional loop points, the corresponding projection points, and the three-dimensional loop points to obtain an initial three-dimensional mesh, including:
[0022] Generate an initial boundary triangle by using a preset unstructured mesh generation algorithm and based on the two-dimensional region information composed of the two-dimensional loop points;
[0023] Construct corresponding three-dimensional arrays based on the two-dimensional loop points, the corresponding projection points, and the three-dimensional loop points;
[0024] Perform an inverse mapping process on the initial boundary triangle by using each of the three-dimensional arrays to obtain an initial three-dimensional mesh.
[0025] Optionally, after obtaining the initial three-dimensional mesh, it further includes:
[0026] Calculate the loop average size of the closed region, and perform a mesh optimization operation on each of the initial three-dimensional meshes by using the loop average size to obtain an optimized initial three-dimensional mesh;
[0027] Correspondingly, performing a two-dimensional mapping process on the optimized initial three-dimensional mesh to obtain an optimized two-dimensional mesh, including:
[0028] Map the optimized initial three-dimensional mesh to a two-dimensional parameter plane constructed by a surface parameterization algorithm to obtain a two-dimensional mesh during the optimization process;
[0029] Optimize the boundary network structure of the two-dimensional mesh during the optimization process in the two-dimensional parameter plane by using a front propagation algorithm to obtain an optimized two-dimensional mesh.
[0030] In a second aspect, the present application discloses an assembly device for an unstructured surface mesh, including:
[0031] A structure establishment module, configured to import and repair an initial CAD model, establish a watertight mesh data structure to obtain a virtual surface;
[0032] A region segmentation module, configured to extract the virtual edge data on the loop of the virtual surface, and divide the target region of the repaired CAD model into multiple closed regions according to the connection relationship of the virtual edge data on the loop; wherein, the target region is the model surface region for generating the unstructured mesh;
[0033] The first projection module is configured to project the three-dimensional loop points of each of the closed regions onto a target plane, and perform two-dimensional calculations on the projected points in the target plane to obtain two-dimensional loop points corresponding to the projected points; wherein, the target plane is the plane corresponding to the maximum area of the closed region formed by projecting the three-dimensional loop points onto different three-dimensional planes;
[0034] The second projection module is configured to generate an initial boundary grid based on the two-dimensional region information formed by the two-dimensional loop points, and perform inverse mapping processing on the initial boundary grid by using the mapping relationship between the two-dimensional loop points, the corresponding projected points, and the three-dimensional loop points to obtain an initial three-dimensional grid;
[0035] The grid assembly module is configured to perform two-dimensional mapping processing on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inverse map the optimized two-dimensional grid back to the three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid.
[0036] In a third aspect, the present application discloses an electronic device, including:
[0037] A memory for storing a computer program;
[0038] A processor for executing the computer program to implement the steps of the foregoing disclosed method for assembling an unstructured surface grid.
[0039] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the foregoing disclosed method for assembling an unstructured surface grid are implemented.
[0040] It can be seen that the present application discloses an assembly method for unstructured surface meshes, including: importing and repairing an initial CAD model, establishing a watertight mesh data structure to obtain a virtual surface; extracting the virtual edge data on the virtual surface, and dividing the target area of the repaired CAD model into multiple closed areas according to the connection relationship of the virtual edge data on the loop; wherein, the target area is the model surface area for generating unstructured meshes; projecting the three-dimensional loop points of each closed area onto a target plane, and performing two-dimensional calculations on the projected points in the target plane to obtain two-dimensional loop points corresponding to the projected points; wherein, the target plane is the plane corresponding to the maximum area of the closed area formed by projecting the three-dimensional loop points onto different three-dimensional planes; generating an initial boundary mesh based on the two-dimensional area information composed of the two-dimensional loop points, and performing inverse mapping processing on the initial boundary mesh by using the mapping relationship between the two-dimensional loop points, the corresponding projected points, and the three-dimensional loop points to obtain an initial three-dimensional mesh; performing two-dimensional mapping processing on the optimized initial three-dimensional mesh to obtain an optimized two-dimensional mesh, and inversely mapping the optimized two-dimensional mesh back to three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured mesh. Thus, by using the virtual edge information on the virtual surface loop of the model to divide the closed area, and then further generating a three-dimensional mesh by using loop point mapping, two-dimensional point conversion, and a conventional mesh generation algorithm, the entire process does not require a complete geometric entity, and a mesh can be generated even without an accurate geometric model, avoiding the dependence on geometric data and solving the problems of the prior art relying on geometric entities and cumbersome model repair. At the same time, the mesh quality is effectively improved, the mesh generation time is reduced, and the generation efficiency is increased through the processing process of spatial mapping and inverse mapping, overcoming the problems of low generation efficiency and poor quality of the existing unstructured meshes. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0042] Figure 1 It is a flowchart of an assembly method for unstructured surface meshes disclosed in the present application;
[0043] Figure 2 It is a schematic diagram of the extraction result of virtual edge data on a loop disclosed in the present application;
[0044] Figure 3 It is a schematic diagram of the result of projecting loop points onto a target plane disclosed in the present application;
[0045] Figure 4Schematic diagram showing the result of projecting multiple rings on a closed region onto a target plane, disclosed in this application;
[0046] Figure 5 Schematic diagram of two-dimensional ring points after two-dimensional projection of projection points on a target plane, disclosed in this application;
[0047] Figure 6 Schematic diagram of an initial boundary grid, disclosed in this application;
[0048] Figure 7 Schematic diagram of an initial three-dimensional grid, disclosed in this application;
[0049] Figure 8(a) is a schematic diagram of a preliminary optimization of an edge collapse operation, disclosed in this application;
[0050] Figure 8(b) is a schematic diagram of a preliminary optimization of an edge splitting operation, disclosed in this application;
[0051] Figure 8(c) is a schematic diagram of a preliminary optimization of an edge swapping operation, disclosed in this application;
[0052] Figure 8(d) is a schematic diagram of a preliminary optimization of a moving point operation, disclosed in this application;
[0053] Figure 9 Schematic diagram of the structure of an assembly device for an unstructured surface mesh, disclosed in this application;
[0054] Figure 10 Schematic diagram of the structure of an electronic device, disclosed in this application. Detailed implementation manners
[0055] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0056] Existing unstructured grid generation methods rely heavily on geometric entities and have high requirements for geometric models. Therefore, the model needs to be repaired according to the calculation requirements before grid generation. Model repair is responsible for converting the "dirty" geometry with "errors" into "clean" geometry that meets the requirements of grid generation. The model hole problem is one of the most common types of model errors. In the model repair problem, since there is no geometric information at the hole of the model to be repaired, it is a quite challenging topic to construct a reasonable geometric structure to fill the hole area and obtain a convincing repair result. Existing hole repair methods are mainly divided into two categories: volume-based algorithms and surface-based methods. Volume-based algorithms cannot restore the details of the hole area and even damage the significant features in the original model. Therefore, such hole repair algorithms are not as widely used as surface-oriented algorithms nowadays. However, the problem with current surface-based methods is that almost all surface-based repair algorithms use the information of the mesh around the hole for repair, and if there is only a boundary, the repair operation cannot be performed.
[0057] For this reason, the present invention provides an assembly scheme for unstructured surface meshes, which can directly generate unstructured surface meshes without relying on complete geometric entities.
[0058] Refer to Figure 1 As shown, an embodiment of the present application discloses an assembly method for unstructured surface meshes, including:
[0059] Step S11: Import and repair the initial CAD model, and establish a watertight grid data structure to obtain a virtual surface.
[0060] In this embodiment, the initial CAD (Computer-Aided Design) model is processed for the gaps on the model surface to obtain a repaired CAD model without surface gaps, and then the repaired CAD model is subjected to mesh division and generation processing to obtain a virtual surface. It can be understood that there are gaps in the initial CAD model generated according to the non-structured surface mesh assembly requirements. In order to obtain accurate surface cutting results, it is necessary to repair the gaps on the surface of the initial CAD model with gaps to obtain a repaired CAD model without surface gaps. It should be noted that generating the initial CAD model based on the actual parameter information of the parts in the non-structured surface mesh assembly requirements is a conventional generation method, such as the reverse engineering method based on measurement data, the forward design method based on design parameters, and the hybrid design method combining the two, which is not specifically limited herein. The non-structured surface mesh assembly requirements can specifically be the non-structured surface mesh assembly requirements of parts, where the parts can be mechanical parts in different fields, such as parts with complex surfaces like automotive body components and aircraft hulls, which is not specifically limited herein. For example: when the non-structured surface mesh assembly requirements are specifically the non-structured surface mesh assembly requirements of an aircraft hull, the initial CAD models of components such as the aircraft wing and fuselage are imported. Specifically, the connection relationships between the components on the aircraft surface are established through a topology repair algorithm to obtain the initial CAD model. The geometric errors (such as holes and gaps) in the initial CAD model are repaired using surface gaps to ensure the watertightness of the geometric model, and a repaired CAD model is obtained.
[0061] Furthermore, the repaired CAD model is subjected to mesh division and generation processing to obtain a virtual surface containing discrete surfaces and continuous surfaces. It can be understood that after the initial CAD model is repaired by the gap patching method, the repaired CAD model is obtained. Further, the watertight mesh data structure of the repaired CAD model is generated by the watertight mesh generation method. Among them, the watertight mesh generation framework is a tool or method for constructing the data structure of the repaired CAD model. In the processing of the repaired CAD model, the mesh is a discrete representation of the model surface. The watertight mesh means that the connection between the meshes is tight and gapless, just like being sealed. This characteristic is crucial for subsequent accurate calculations and analyses. Using this framework to establish the data structure can organize each part of the repaired CAD model in an orderly and standardized manner, facilitating various subsequent operations on the model. Specifically, after the data structure of the repaired CAD model is established through the watertight mesh generation framework, each obtained virtual surface contains two parts: discrete surfaces and continuous surfaces. The discrete surface is obtained by discretizing the continuous surface and is composed of a series of discrete point, line, and surface elements. In subsequent processing, it is easier to perform operations on the discrete surface, such as dividing the closed area using the virtual edges on the loop, converting from three-dimensional points to two-dimensional points, and generating the initial boundary mesh in the two-dimensional area. The continuous surface is the part of the surface that maintains the original continuous characteristics and reflects the overall shape and geometric features of the surface, that is, the solid geometric data. For example, the repaired CAD model is subjected to mesh division and generation processing, and a virtual surface is obtained by using [tool name]. Among them, the virtual surface corresponds to the virtual surface that is not actually manufactured but is used for auxiliary modeling in the aircraft hull design. In the current scenario, the virtual surface is specifically the virtual surface of the leading edge of the wing, the virtual surface of the tail wing, etc.
[0062] Step S12: Extract the virtual edge data on the loop of the virtual surface, and divide the target area of the repaired CAD model into multiple closed areas according to the connection relationship of the virtual edge data on the loop; wherein, the target area is the model surface area for generating the unstructured mesh.
[0063] In this embodiment, the virtual edge data on the ring on the virtual surface is determined and extracted based on the topological relationship of each component of the repaired CAD model in the virtual surface; the target area of the repaired CAD model is segmented according to the virtual edge connection relationship of the virtual edge data on the ring, so as to obtain multiple closed areas. It can be understood that the virtual edge data on the ring on the virtual surface is extracted from the topological relationship of the repaired CAD model in the virtual surface. The virtual edge data on the ring is the virtual edge data existing on the ring of the virtual surface. These virtual edge data on the ring are connected to each other to form a closed area. By directly extracting these virtual edge data on the ring, the closed area surrounded by them can be obtained. It should be noted that the specific number of edges contained in each closed area is not limited, and can be composed of one or more grid lines. In a complex mechanical component model, the virtual surface corresponds to special structures such as gaps between components or internal cavities, and the virtual edges on the virtual surface ring form closed boundaries around these special structures, thereby forming a closed area. Specifically, the virtual edge data on the ring is used to divide the specific areas on the model surface related to the virtual surface. There are various virtual surfaces in the model, and the areas enclosed by the virtual edges on the ring are essentially the definition of the parts of the model surface associated with these virtual surfaces. In a mechanical part model containing an internal cavity, when the virtual surface represents the inner wall surface of the cavity, the closed area formed by the virtual edges on the ring of the virtual surface divides the model surface portion corresponding to the cavity for subsequent unstructured mesh generation. In order to meet the requirements for mesh equipment of the non-structural surface of the aircraft shell, the virtual edge data on the ring of the virtual surface in the aircraft design (such as the virtual surface of the leading edge of the wing and the virtual surface of the tail) is used to automatically divide the closed area, such as the wing surface and flap area.
[0064] In this embodiment, the target area of the repaired CAD model is segmented by manually drawing grid lines to obtain multiple closed areas. It is understandable that the area of the surface unstructured grid to be generated is segmented by manually drawing grid lines on the surface of the repaired CAD model. The manually drawn grid lines can be flexibly set according to actual needs to divide the large area to be segmented into several small areas. When these grid lines are connected to each other to form a closed loop, closed areas are generated. Moreover, the number of edges contained in each closed area is not limited, and it can be composed of one grid line (for example, a closed circular grid line is drawn to form a closed area with a single side), or it can be composed of a plurality of grid lines (for example, a rectangular grid wireframe is drawn, and a closed area is composed of four grid lines). Specifically, on the surface of an aircraft model with a complex shape, when the grid lines are manually drawn, the surface areas of different parts such as wings and fuselage will be divided into closed areas by grid lines according to the aerodynamic characteristics analysis requirements of different parts of the aircraft, so as to generate suitable unstructured grids according to the characteristics of different areas, thereby improving the pertinence and effectiveness of grid generation.
[0065] In this way, the complex model area is decomposed into multiple relatively simple closed areas, which facilitates subsequent mesh generation respectively, that is, reduces the complexity of mesh generation and improves the generation efficiency.
[0066] Step S13: Project the three-dimensional loop points of each of the closed areas onto a target plane, and perform two-dimensional calculations on the projected points in the target plane to obtain two-dimensional loop points corresponding to the projected points; wherein, the target plane is the plane corresponding to the maximum area of the closed area formed by projecting the three-dimensional loop points onto different three-dimensional planes.
[0067] In this embodiment, for each closed area, a circle of loop points forming the closed area is obtained, and these loop points are mapped onto a certain plane, and the plane needs to satisfy that the area of the closed area formed by the loop points after mapping on the plane is the largest. Specifically, Figure 2 the closed area Loop1 in is composed of a circle of loop points, and the set of these loop points is denoted as wherein, is a three-dimensional loop point forming Loop1, represents the total number of three-dimensional loop points forming Loop1.
[0068] Furthermore, determine the plane equation of the target plane; wherein, the plane equation is used to describe the position and direction of the target plane in three-dimensional space; based on the plane equation and through a preset projection calculation method, determine the three-dimensional projection positions of the three-dimensional loop points of the closed area on the target plane to obtain the projected points located on the target plane; it can be understood that calculate the plane equation of the target plane Plane so that the area of the closed area formed by mapping these loop points onto this plane is maximized. After calculating the plane equation of its target plane, through the three-dimensional coordinate information of the three-dimensional loop points and the plane equation, and through the projection calculation method, calculate the position information of the projected points of each three-dimensional loop point mapped on the target plane, and then complete the mapping process. It should be noted that the current projected points are also three-dimensional projected points. As shown in Figure 3 Loop2 in, Loop2 is the projected points after mapping of Loop1. Each three-dimensional loop point r of Loop1 has a unique corresponding projected point q on this target plane. The closed area Loop1 is composed of multiple three-dimensional loop points. By calculating the plane equation of the plane Plane with the maximum projected area, these three-dimensional loop points are mapped onto this plane to form Loop2, and the loop points on Loop2 are the corresponding projected points q, realizing the conversion of three-dimensional points to points on the plane with the largest area. As shown in Figure 4 shown, Figure 4It shows a situation where the enclosed area consists of multiple loops. The enclosed area is composed of Loop1 and Loop2. After mapping, Loop1 is mapped to Loop3, and Loop2 is mapped to Loop4. In this way, by obtaining the optimal distribution of loop points on the target plane, information loss and distortion are reduced, the rationality of the point distribution on the two-dimensional plane is improved, so that the subsequent generated two-dimensional grid can better reflect the characteristics of the three-dimensional model. At the same time, information loss during the projection process is reduced, which helps to improve the quality of the finally generated three-dimensional grid.
[0069] In this embodiment, the normal vector of the target plane is used as the normal vector of the two-dimensional plane to determine the target plane as the two-dimensional plane, and the mapped points of the three-dimensional projection positions of the projection points on the two-dimensional plane are used as two-dimensional loop points. It can be understood that converting the projection points of the target plane into two-dimensional loop points, specifically, by calculating the normal vector of the target plane Plane as the normal vector of the two-dimensional plane. Therefore, projecting each projection point from the target plane to the two-dimensional plane only needs to be projected along the vertical direction of the target plane, so that the projected two-dimensional loop points can accurately reflect the relative position relationship of the three-dimensional points on the two-dimensional plane. For each point q on the target plane, the corresponding two-dimensional loop point p is calculated according to the corresponding algorithm. This step is to further convert the points located on the target plane to the two-dimensional plane to prepare for generating a grid in the two-dimensional region.
[0070] The axis direction vectors for constructing the two-dimensional plane are determined by the following algorithm:
[0071] ;
[0072] where is the normal vector of the target plane Plane, represents the unit vector in the x-axis direction of the two-dimensional plane, represents the unit vector in the y-axis direction of the two-dimensional plane.
[0073] Based on this, for each projection point q, the calculation method of its two-dimensional loop point ([[]] , ) is as follows:
[0074] ;
[0075] As Figure 5 shows, where Loop1 is the loop on the plane with the largest area, and Loop2 is the new loop composed of two-dimensional loop points mapped to the two-dimensional plane. In this way, the normal vector of the two-dimensional space is calculated by a specific algorithm, and each projection point is converted into the corresponding two-dimensional loop point. The correspondence between the projection points and the two-dimensional loop points is established, providing two-dimensional coordinate data for generating a boundary grid on the two-dimensional plane. The conversion from three-dimensional space to two-dimensional space is realized.
[0076] Step S14: Generate an initial boundary mesh based on the two-dimensional region information composed of the two-dimensional loop points, and perform an inverse mapping process on the initial boundary mesh by using the mapping relationship between the two-dimensional loop points, the corresponding projection points, and the three-dimensional loop points, so as to obtain an initial three-dimensional mesh.
[0077] In this embodiment, an initial boundary triangle is generated by using a preset unstructured mesh generation algorithm and based on the two-dimensional region information composed of the two-dimensional loop points; a corresponding three-dimensional array is constructed based on the two-dimensional loop points, the corresponding projection points, and the three-dimensional loop points; and the initial boundary triangle is subjected to an inverse mapping process by using each of the three-dimensional arrays, so as to obtain an initial three-dimensional mesh. It can be understood that an initial boundary mesh is generated within the two-dimensional region composed of the two-dimensional loop points by using a conventional unstructured mesh generation algorithm, and the conventional unstructured mesh generation algorithm can be the Delaunay algorithm or the advancing front method, and no specific limitation is made thereto.
[0078] Specifically, a series of initial boundary triangles are obtained through a two-dimensional unstructured mesh generation algorithm, denoted as , represents an index number, which is used to point to the specific two-dimensional loop point coordinates in the point list ( , ). For example: when = 1, the two-dimensional loop point coordinates of the two-dimensional loop point are , = 2, the two-dimensional loop point coordinates of the two-dimensional loop point are , = 3, the two-dimensional loop point coordinates of the two-dimensional loop point are . Among them, the value range of the index number of is [1, , and , , are not equal to each other. Therefore, the generated initial boundary triangles are as shown in Figure 6 . In this way, a grid structure is initially constructed on the two-dimensional plane to prepare for subsequent conversion back to the three-dimensional space, and the generation of the initial boundary triangle ensures the quality of the grid and the rationality of the topological structure. At the same time, the generation of the initial boundary triangle is relatively simple, which can reduce the computational amount and time cost. Further, the initial three-dimensional mesh of the original three-dimensional closed region is obtained through the correspondence between the three-dimensional loop points and the two-dimensional loop points. Specifically, each three-dimensional loop point r corresponds to a projection point q mapped to the target plane, and the projection point q corresponds to a two-dimensional loop point p. In this way, each three-dimensional loop point, projection point, and two-dimensional loop point can form a three-dimensional array Therefore, a three-dimensional triangular grid constructed for every three three-dimensional loop points corresponds to a two-dimensional triangle , where represents the index number, and its value range is [1, , and , , are not equal to each other. The corresponding initial three-dimensional grid is as follows Figure 7 shown.
[0079] In this embodiment, after obtaining the initial three-dimensional grid, it further includes: calculating the average loop size of the closed area, and using the average inner size of the loop to perform grid optimization operations on each of the initial three-dimensional grids to obtain an optimized initial three-dimensional grid; it can be understood that the generated initial three-dimensional grid is preliminarily refined. Specifically, calculate the average size of the loops that make up the closed area, and the calculation method is:
[0080] ;
[0081] where represents the number of loops that make up the closed area, represents the number of points of the th loop. After obtaining the average size, perform edge collapse, edge splitting, edge swapping, and point moving operations on the initial three-dimensional grid to achieve preliminary optimization of the initial grid.
[0082] Specifically, as shown in Figure 8(a), the edge collapse operation simplifies an edge of the initial three-dimensional grid and its two endpoints into a single point. The two triangles originally connected by this edge will merge into one area, reducing the number of edges and vertices in the grid. This helps to eliminate overly small or low-quality triangles, simplifies the grid structure, and at the same time changes the topological form of the grid to a certain extent.
[0083] As shown in Figure 8(b), the edge splitting operation divides an edge into two edges and adds a new vertex. It can be seen in the figure that the original two triangles are split into four triangles, which can refine the grid, make the grid better adapt to the detailed features of the model, and increase the grid density in the local area.
[0084] As shown in Figure 8(c), the edge swapping operation changes the connection method of the common edge of two adjacent triangles. The two originally adjacent triangles in the figure recombine into two new triangles by swapping the common edge. This operation can optimize the shape of the triangles, for example, adjust an obtuse triangle to a more regular shape, thereby improving the grid quality.
[0085] As shown in Fig. 8(d), the operation of moving points refers to moving the vertices in the grid to new positions. The figure shows that the position of a certain vertex has changed, and the surrounding triangles have also changed their shapes accordingly. By reasonably moving the positions of the points, the side lengths and angles of the triangles can be adjusted to make the entire grid more uniform and improve the overall quality of the grid.
[0086] Step S15: Perform two-dimensional mapping processing on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inversely map the optimized two-dimensional grid back to the three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid.
[0087] In this embodiment, the optimized initial three-dimensional grid is mapped to a two-dimensional parameter plane constructed by a surface parameterization algorithm to obtain a two-dimensional grid during the optimization process; in the two-dimensional parameter plane, the boundary network structure of the two-dimensional grid during the optimization process is optimized by using a front propagation algorithm to obtain an optimized two-dimensional grid. It can be understood that the initially optimized initial three-dimensional grid is mapped to a two-dimensional parameter plane through a surface parameterization algorithm to obtain a two-dimensional grid during the optimization process. Further, a secondary optimization is performed using a front propagation algorithm in the two-dimensional parameter plane to obtain an optimized two-dimensional grid. Among them, the surface parameterization algorithm can be a harmonic mapping algorithm, an LSCM (Least Squares Conformal Mapping) algorithm, a discrete Ricci flow algorithm, etc. In this way, through the secondary optimization, the quality of the grid is further improved, and the fitting accuracy of the grid to complex surfaces is improved. At the same time, using the two-dimensional parameter plane for optimization can reduce the computational complexity and improve the optimization efficiency.
[0088] Further, the optimized two-dimensional grid is inversely mapped back to the three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid. Among them, if all the boundary edge data used comes from the loop of a certain virtual surface in the current model, the obtained three-dimensional unstructured grid is projected onto the digital model surface information stored on the current virtual surface for accuracy correction. The digital model surface information refers to the data information (data information on a continuous surface) associated with this virtual surface for describing the actual geometric shape, and these information include the equation of the surface, control points, boundary conditions, etc. If the entity geometric feature is a position situation, then when the optimized two-dimensional grid is inversely mapped back to the three-dimensional space to obtain a three-dimensional unstructured grid, it is the end. On the contrary, if the exact entity geometric feature situation is known, the unstructured grid can be projected onto the digital model surface, which can make the grid better fit the shape of the actual model.
[0089] Due to certain errors that may exist in the grid generation process, by projecting onto the actual shape represented by the digital model surface information and replacing the grid points before projection with the projected grid points, the position of the grid can be corrected, making the generated grid more conformal, that is, more accurately reflecting the geometric shape of the actual model.
[0090] It can be seen that the present application discloses a method for assembling unstructured surface grids, including: importing and repairing an initial CAD model, establishing a watertight grid data structure to obtain a virtual surface; extracting the virtual edge data on the loop of the virtual surface, and dividing the target area of the repaired CAD model into multiple closed areas according to the connection relationship of the virtual edge data on the loop; wherein, the target area is the model surface area for generating unstructured grids; projecting the three-dimensional loop points of each closed area onto a target plane, and performing two-dimensional calculations on the projected points in the target plane to obtain two-dimensional loop points corresponding to the projected points; wherein, the target plane is the plane corresponding to the largest area of the closed area formed by projecting the three-dimensional loop points onto different three-dimensional planes; generating an initial boundary grid based on the two-dimensional area information composed of the two-dimensional loop points, and performing inverse mapping processing on the initial boundary grid by using the mapping relationship between the two-dimensional loop points, the corresponding projected points, and the three-dimensional loop points to obtain an initial three-dimensional grid; performing two-dimensional mapping processing on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inversely mapping the optimized two-dimensional grid back to three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid. Thus, by using the virtual edge information on the loop of the model virtual surface to divide the closed area, and then further generating a three-dimensional grid by using loop point mapping, two-dimensional point conversion, and conventional grid generation algorithms, the entire process does not require a complete geometric entity, and a grid can be generated even without an accurate geometric model, avoiding the dependence on geometric data and solving the problems of the prior art relying on geometric entities and cumbersome model repair. At the same time, through the processing process of space mapping and inverse mapping, the grid quality is effectively improved, the grid generation time is reduced, and the generation efficiency is increased, overcoming the problems of low generation efficiency and poor quality of the existing unstructured grids.
[0091] Refer to Figure 9 As shown, the embodiment of the present invention also discloses an apparatus for assembling unstructured surface grids, including:
[0092] A structure establishment module 11, configured to import and repair an initial CAD model, and establish a watertight grid data structure to obtain a virtual surface;
[0093] A region segmentation module 12, configured to extract the virtual edge data on the loop of the virtual surface, and divide the target area of the repaired CAD model into multiple closed areas according to the connection relationship of the virtual edge data on the loop; wherein, the target area is the model surface area for generating unstructured grids;
[0094] The first projection module 13 is configured to project the three-dimensional loop points of each of the closed regions onto a target plane, and perform two-dimensional calculations on the projected points in the target plane to obtain two-dimensional loop points corresponding to the projected points; wherein, the target plane is the plane corresponding to the maximum area of the closed regions formed by projecting the three-dimensional loop points onto different three-dimensional planes;
[0095] The second projection module 14 is configured to generate an initial boundary grid based on the two-dimensional region information formed by the two-dimensional loop points, and perform an inverse mapping process on the initial boundary grid by using the mapping relationship between the two-dimensional loop points, the corresponding projected points, and the three-dimensional loop points to obtain an initial three-dimensional grid;
[0096] The grid assembly module 15 is configured to perform a two-dimensional mapping process on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inverse map the optimized two-dimensional grid back to the three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid.
[0097] It can be seen that this application discloses importing and repairing an initial CAD model, establishing a watertight grid data structure to obtain a virtual surface; extracting the virtual edge data on the virtual surface, and dividing the target region of the repaired CAD model into multiple closed regions according to the connection relationship of the virtual edge data on the loop; wherein, the target region is the model surface region for generating an unstructured grid; projecting the three-dimensional loop points of each of the closed regions onto a target plane, and performing two-dimensional calculations on the projected points in the target plane to obtain two-dimensional loop points corresponding to the projected points; wherein, the target plane is the plane corresponding to the maximum area of the closed regions formed by projecting the three-dimensional loop points onto different three-dimensional planes; generating an initial boundary grid based on the two-dimensional region information formed by the two-dimensional loop points, and performing an inverse mapping process on the initial boundary grid by using the mapping relationship between the two-dimensional loop points, the corresponding projected points, and the three-dimensional loop points to obtain an initial three-dimensional grid; performing a two-dimensional mapping process on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inverse map the optimized two-dimensional grid back to the three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid. Thus, by using the virtual edge information on the virtual surface of the model to divide the closed regions, and then further generating a three-dimensional grid by using loop point mapping, two-dimensional point conversion, and a conventional grid generation algorithm, the entire process does not require a complete geometric entity, and a grid can be generated even without an accurate geometric model, avoiding the dependence on geometric data, and solving the problems of the prior art that rely on geometric entities and have cumbersome model repair. At the same time, the quality of the grid is effectively improved through the process of spatial mapping and inverse mapping, the grid generation time is reduced, and the generation efficiency is improved, overcoming the problems of low generation efficiency and poor quality of the existing unstructured grid.
[0098] Furthermore, the embodiment of this application also discloses an electronic device, Figure 10It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure should not be regarded as any limitation on the scope of use of this application.
[0099] Figure 10 This is a schematic structural diagram of an electronic device 20 provided by an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the method for assembling a non-structured surface mesh disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0100] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to specific application needs, and no specific limitations are made here.
[0101] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
[0102] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc. The storage method can be transient storage or permanent storage.
[0103] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the non-structured surface mesh assembly method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks. The data 223 can include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.
[0104] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the non-structured surface mesh assembly method disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0105] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0106] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered as exceeding the scope of this application. The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disk, removable disk, CD-ROM (Compact Disc - Read Only Memory), or any other form of storage medium known in the technical field.
[0107] Finally, it should also be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the said element.
[0108] The above has introduced the solution provided by the present invention in detail. Specific examples have been used in this text to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. An assembly method for unstructured surface meshes, characterized in that, Comprising: Import and repair the initial CAD model, establish a watertight mesh data structure to obtain a virtual surface; Extract the virtual edge data on the virtual surface, and divide the target area of the repaired CAD model into multiple closed areas according to the connection relationship of the virtual edge data on the loop; wherein, the target area is the model surface area for generating unstructured meshes; Project the three-dimensional loop points of each closed area onto the target plane, and perform two-dimensional calculations on the projection points in the target plane to obtain two-dimensional loop points corresponding to the projection points; wherein, the target plane is the plane corresponding to the maximum area of the closed area formed by projecting the three-dimensional loop points onto different three-dimensional planes; Generate an initial boundary mesh based on the two-dimensional area information composed of the two-dimensional loop points, and perform inverse mapping processing on the initial boundary mesh by using the mapping relationship between the two-dimensional loop points, the corresponding projection points, and the three-dimensional loop points to obtain an initial three-dimensional mesh; Perform two-dimensional mapping processing on the optimized initial three-dimensional mesh to obtain an optimized two-dimensional mesh, and inverse map the optimized two-dimensional mesh back to three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured mesh; The importing and repairing the initial CAD model, establishing a watertight mesh data structure to obtain a virtual surface, includes: Perform model surface gap processing on the initial CAD model to obtain a repaired CAD model without surface gaps, and then perform mesh division and generation processing on the repaired CAD model to obtain a virtual surface; The extracting the virtual edge data on the virtual surface, and dividing the target area of the repaired CAD model into multiple closed areas according to the connection relationship of the virtual edge data on the loop, includes: Determine and extract the virtual edge data on the loop on the virtual surface based on the topological relationship representing each component of the repaired CAD model in the virtual surface; divide the target area of the repaired CAD model into multiple closed areas according to the loop virtual edge connection relationship of the virtual edge data on the loop; Or, use manually drawn grid lines to divide the target area of the repaired CAD model into multiple closed areas; After obtaining the initial three-dimensional mesh, it further includes: Calculate the loop average size of the closed area, and perform mesh optimization operations on each initial three-dimensional mesh by using the loop average size to obtain an optimized initial three-dimensional mesh; Correspondingly, the performing two-dimensional mapping processing on the optimized initial three-dimensional mesh to obtain an optimized two-dimensional mesh includes: Map the optimized initial three-dimensional mesh to a two-dimensional parameter plane constructed by a surface parameterization algorithm to obtain a two-dimensional mesh during optimization; optimize the boundary network structure of the two-dimensional mesh during optimization in the two-dimensional parameter plane to obtain an optimized two-dimensional mesh.
2. The assembly method of the unstructured surface mesh according to claim 1, characterized in that, The projecting the three-dimensional loop points of each closed area onto the target plane, and performing two-dimensional calculations on the projection points in the target plane to obtain two-dimensional loop points corresponding to the projection points, includes: Determine the plane equation of the target plane; wherein, the plane equation is used to describe the position and orientation of the target plane in three-dimensional space; Based on the plane equation and through a preset projection calculation method, determine the three-dimensional projection positions of the three-dimensional ring points of the closed region on the target plane to obtain the projected points located on the target plane; Use the normal vector of the target plane as the normal vector of the two-dimensional plane to determine the target plane as a two-dimensional plane, and use the mapping points of the three-dimensional projection positions of the projected points in the two-dimensional plane as two-dimensional ring points.
3. The assembly method of the unstructured surface mesh according to claim 1, wherein Generate an initial boundary grid based on the two-dimensional region information composed of the two-dimensional ring points, and use the mapping relationship between the two-dimensional ring points, the corresponding projected points, and the three-dimensional ring points to perform inverse mapping processing on the initial boundary grid to obtain an initial three-dimensional grid, including: Use a preset unstructured grid generation algorithm and generate an initial boundary triangle based on the two-dimensional region information composed of the two-dimensional ring points; Construct corresponding three-dimensional arrays based on the two-dimensional ring points, the corresponding projected points, and the three-dimensional ring points; Use each of the three-dimensional arrays to perform inverse mapping processing on the initial boundary triangle to obtain an initial three-dimensional grid.
4. An assembly device for unstructured surface meshes, characterized in that, Including: A structure establishment module, configured to import and repair an initial CAD model, establish a watertight grid data structure to obtain a virtual surface; A region segmentation module, configured to extract the virtual edge data on the virtual surface and segment the target region of the repaired CAD model into multiple closed regions according to the connection relationship of the virtual edge data on the ring; wherein, the target region is the model surface region for generating an unstructured grid; A first projection module, configured to project the three-dimensional ring points of each closed region onto a target plane, and perform two-dimensional calculations on the projected points in the target plane to obtain two-dimensional ring points corresponding to the projected points; wherein, the target plane is the plane corresponding to the maximum area of the closed region formed by projecting the three-dimensional ring points onto different three-dimensional planes; A second projection module, configured to generate an initial boundary grid based on the two-dimensional region information composed of the two-dimensional ring points, and use the mapping relationship between the two-dimensional ring points, the corresponding projected points, and the three-dimensional ring points to perform inverse mapping processing on the initial boundary grid to obtain an initial three-dimensional grid; A grid assembly module, configured to perform two-dimensional mapping processing on the optimized initial three-dimensional grid to obtain an optimized two-dimensional grid, and inverse map the optimized two-dimensional grid back to three-dimensional space through a surface parameterization algorithm to obtain a three-dimensional unstructured grid; The structure establishment module is specifically configured to perform model surface gap processing on the initial CAD model to obtain a repaired CAD model without surface gaps, and then perform grid division and generation processing on the repaired CAD model to obtain a virtual surface; The area segmentation module is specifically configured to determine and extract the virtual edge data on the virtual surface based on the topological relationships of the various components of the repaired CAD model represented in the virtual surface; segment the target area of the repaired CAD model according to the virtual edge connection relationships of the virtual edge data on the virtual surface to obtain a plurality of closed areas; or segment the target area of the repaired CAD model by manually drawing grid lines to obtain a plurality of closed areas. The unstructured surface mesh assembly device is further configured to calculate the average loop size of the closed areas and perform a mesh optimization operation on each of the initial three-dimensional meshes using the average loop size to obtain optimized initial three-dimensional meshes. The mesh assembly module is specifically configured to map the optimized initial three-dimensional meshes to a two-dimensional parameter plane constructed by a surface parameterization algorithm to obtain two-dimensional meshes during the optimization process; optimize the boundary network structure of the two-dimensional meshes during the optimization process in the two-dimensional parameter plane using a front advancing algorithm to obtain optimized two-dimensional meshes.
5. An electronic device, characterized in that, Comprising: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the unstructured surface mesh assembly method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by a processor, the steps of the unstructured surface mesh assembly method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Surface structure grid automatic generation method based on global mapping transformation
CN112560365A
Curved surface grid generation method and system based on recursive decomposition, and computer equipment
CN115774968A