Multi-layer grid generation method for arbitrary polygon node matching based on Mean Value interpolation
Through the polygon node matching method based on Mean Value interpolation, a multi-layer grid with strict layer-level projection is generated, which solves the problem of randomly generating grids in the mesh segmentation of earth and rock dams, and improves the accuracy of the model and the efficiency of numerical simulation.
Patent Information
- Application Number
- CN202411792500.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-07
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-07
AI Technical Summary
The prior art is difficult to generate a regular grid with strict layer-by-layer projection in the meshing segmentation of the three-dimensional model of earth and rock dams, especially in the projection problem of points inside the reference grid.
The multi-layer mesh generation method based on Mean Value interpolation is adopted to match any polygon node. The relationship between the coordinates and vertex coordinates of the interior and points on the boundary of the polygon is obtained through the Mean Value difference method, and the projection of the polyline is realized to form a multi-layer non-equal grid.
Accurate coordinate matching and projection between any polygon inside and at the boundary point is achieved, which solves the problem of random generation in mesh segmentation and improves the accuracy of subsequent fine model establishment and numerical simulation calculation.
Smart Images

Figure CN119720656A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of mesh generation, and in particular relates to a multi-layer mesh generation method based on arbitrary polygon node matching based on Mean Value interpolation. Background Art
[0002] Meshing is the first step in numerical simulation calculations. Its purpose is to divide the three-dimensional model into sections so that the control equations can be solved using the finite difference method or the finite element method.
[0003] In the earth-rock dam three-dimensional model mesh generation project, the original technical method was to select the model in the Rhino software through the Griddle plug-in for direct meshing, which was relatively random in mesh shape and space generation.
[0004] However, in actual engineering, due to the architectural characteristics of earth-rock dams being layered, the later stage needs to be calculated according to the elevation layer. Therefore, the method of randomly generating spatial grids cannot meet the requirements, and a regular grid generation method with strict layer-by-layer projection is required. Specifically, this method needs to solve the problem of projecting each point inside the reference grid, that is, for a point inside a polygon and on the boundary, how to obtain the relationship between the coordinates of the point and the coordinates of each vertex, as well as the problem of inserting and generating multi-layer grids between polygonal grids and polylines. Summary of the invention
[0005] The purpose of the present invention is to provide a multi-layer grid generation method for arbitrary polygon node matching based on Mean Value interpolation, which can obtain the mathematical expression relationship between the coordinates of a point inside and on the boundary of an arbitrary polygon and the coordinates of the polygon vertex, and for other polylines, the projection of the point in the new polyline can be realized; at the same time, through the elevation list, multi-layer unequal-spacing grids can be formed in polygons and polylines.
[0006] In order to achieve the above object, the present invention is implemented by the following method:
[0007] The multi-layer mesh generation method based on arbitrary polygon node matching based on Mean Value interpolation includes the following steps:
[0008] Step S1: Select any polygonal surface mesh that has been divided, obtain all boundary points, internal points of the surface mesh, and information of all planes forming the surface mesh, and form a corresponding boundary point list and internal point list; the surface mesh is recorded as a reference mesh;
[0009] Step S2: Select a known polyline, obtain information of all nodes on the polyline, these nodes are recorded as control points, all control points constitute a control point list, and the polyline is recorded as the target line;
[0010] Step S3: Determine whether the number of surface mesh boundary points is greater than the number of target line control points:
[0011] If the number of boundary points of the surface mesh is greater than the number of control points of the target line, the boundary nodes of the mesh are simplified, and the deleted boundary points are connected into a polyline, which is recorded as the baseline;
[0012] If the number of boundary points of the surface mesh is equal to the number of control points of the target line, the boundary line of the mesh is recorded as the baseline;
[0013] If the number of surface mesh boundary points is less than the number of target line control points, the entire multi-layer volume mesh generation process ends;
[0014] All nodes on the baseline constitute a simplified list of boundary points;
[0015] Step S4: determining whether the numbering sequence of all nodes in the simplified boundary point list along the baseline is consistent with the numbering sequence of all nodes in the control point list along the target line; if not, adjusting them to be consistent;
[0016] Then, the nodes in the simplified boundary point list are matched with the nodes in the control point list, so that each node in the simplified boundary point list is paired with a node in the control point list in order, and the two paired nodes are connected;
[0017] Step S5: Obtain the shape function weights of each node in the simplified boundary point list on each line segment of the baseline, and the shape function weights of each internal point of the surface mesh for each node of the baseline by using the Mean Value difference method;
[0018] Based on the coordinates of each node in the control point list and the shape function weights of each internal point of the surface mesh for each node of the baseline, the coordinates of the projection points corresponding to each internal point of the surface mesh in the layer where the target line is located are obtained, and then each internal point of the surface mesh is connected to the corresponding projection point;
[0019] Step S6: After processing in steps S4 and S5, the surface mesh is matched with the target line to form a volume mesh; then the volume mesh is layered according to the set number of layers and the height of each layer to form a multi-layer volume mesh that meets the requirements.
[0020] Further optimization, the step S1 specifically includes the following steps:
[0021] Step S1.1: Select a polygonal surface mesh, and obtain all boundary points, internal points, and information of all planes forming the surface mesh through the built-in function of the software;
[0022] Step S1.2: Set a surface mesh composed of four points, that is, set the surface mesh to be a quadrilateral mesh; traverse all nodes on each plane in the surface mesh, and if the obtained nodes overlap, remove the overlapping nodes, so that the surface mesh is a triangular mesh that conforms to the actual situation;
[0023] Step S1.3: All boundary point information constitutes a boundary point list, and the internal point information constitutes an internal point list, which includes the coordinates and corresponding serial number of each node.
[0024] Further optimization, in step S3, when the number of surface mesh boundary points is greater than the number of target line control points, the mesh boundary nodes are simplified by the Douglas-Peucker method with a specified number of control points, specifically including the following steps:
[0025] Step S3.1: All boundary points of the surface mesh constitute a boundary point list List1, including the sequence number and coordinate value of each node;
[0026] Set the number of control points on the target line to N, and set the smoothing threshold ε;
[0027] Create an empty list to store the control point serial numbers, recorded as serial number list List2;
[0028] Create a list for storing distances, recorded as distance list List3; create a list for storing the farthest distances, recorded as list List4;
[0029] Step S3.2: First iteration of segmentation:
[0030] Step S3.2.1: Take the first and last two nodes in the boundary point list and record them as starting point A 1 and end point B 1 , connect these two nodes to form a straight line L 1 , and store the serial numbers of these two nodes in the serial number list List2;
[0031] Step S3.2.2: Traverse the boundary point list List1 and find the distance line L 1 The farthest node P 1 , the node P 1 The serial number is stored in the serial number list List2, and the longest distance L 1 Save to list List4;
[0032] Step S3.2.3: Determine the maximum distance L 1 Is it greater than the set smoothing threshold ε?
[0033] If it is less than or equal to, stop splitting;
[0034] If it is greater, proceed to step S2.4;
[0035] Step S3.2.4: Determine whether the number of elements in the serial number list is equal to the set number of control points N:
[0036] If yes, stop the segmentation;
[0037] If not, perform the second iteration of segmentation;
[0038] S3: Second iteration of segmentation:
[0039] Step S3.3.1: Through node P 1 The boundary point list List1 in step S1 is divided into two parts, including the node P 1
[0040] The sublist List consisting of the nodes on the left 11 and by node P 1 The nodes on the right are the sublist List 12 ; Connect nodes P respectively 1 and starting point A 1 and end point B 1 , forming a straight line P 1 A 1 and P 1 B 1 , find the sublist List 11 Middle distance straight line P 1 A 1 The farthest node P 2,1 , the distance is recorded as L 21 ; Find the sublist List 12 Middle distance straight line P 1 B 1 The farthest node P 2,2 , the distance is recorded as L 22 ; Compare distance L 21 , L 22 , store the larger distance in List4, the smaller distance in List3, and store the node number P corresponding to the larger distance 2,j Add to the serial number list List2, j = 1 or 2;
[0041] Step S3.3.2: Determine whether the larger distance is greater than the set smoothing threshold ε:
[0042] If it is less than or equal to, stop splitting;
[0043] If it is greater, then determine whether the number of elements in the serial number list List2 is equal to the set number of control points N:
[0044] If yes, stop the segmentation;
[0045] If not, perform the third iteration of segmentation;
[0046] …
[0047] Step S3.4: Iterate in sequence until the corresponding larger distance after the last iteration is less than or equal to the set smoothing threshold ε, or the number of elements in the serial number list List2 is equal to the set number of control points N, and the segmentation is completed.
[0048] Further optimization, the i-th iterative subdivision process is as follows:
[0049] The node P corresponding to the larger distance generated during the i-1th iterative partitioning process i-1,j , the sublist it is in is divided into two parts, including the node P i-1,j The sublist List consisting of the nodes on the left i1 and by node P i-1,j The nodes on the right are the sublist List i2 ; Connect nodes P respectively i-1,j and starting point A i-1 and end point B i-1 , forming a straight line P i-1,j A i-1 and P i-1,j B i-1 , find the list List i1 Middle distance straight line P i-1,j A i-1 The farthest node P i,1 , the distance is recorded as L i1 ; Find the list List i2 Middle distance straight line P i-1,j B i-1 The farthest node P i,2 , the distance is recorded as L i2 ; Compare distance L i1 , L i2 , compare the larger one with all the distance values in List3 for a second time, store the larger distance obtained by the second comparison in List4, add the node number corresponding to the larger distance obtained by the second comparison to the number list List2; store the smaller distance obtained by the second comparison in List3, and remove the original largest distance value in List3 and moved to List4 in this comparison, i is a positive integer greater than or equal to 2.
[0050] Further optimization, in step S4, it is determined whether the numbering sequence of all nodes in the simplified boundary point list along the baseline is consistent with the numbering sequence of all nodes in the control point list along the target line. If they are inconsistent, they are adjusted to be consistent, which specifically includes the following steps:
[0051] Step S4.1: Select any point on the baseline and target line as the matching point; then use the KDTree algorithm to find the nodes closest to the two points in the simplified boundary point list and the control point list, and use the two nodes as the corresponding starting points, the one on the baseline is recorded as the first starting point, and the one on the target line is recorded as the second starting point;
[0052] Step S4.2: In the simplified boundary point list, according to the node arrangement order, take the node before and after the first starting point respectively; then the first starting point and the node before and after it form two vectors, and the cross product of the two vectors is calculated to obtain the normal direction of the baseline;
[0053] Similarly, in the control point list, according to the order of node arrangement, take the node before and after the second starting point respectively; then the second starting point and the node before and after it form two vectors, and the cross product of the two vectors is calculated to obtain the normal direction of the baseline;
[0054] Step S4.3: Determine whether the normal direction of the baseline is the same as the normal direction of the baseline:
[0055] If they are the same, pair the first starting point and the second starting point, and pair each node in the simplified boundary point list with a corresponding node in the control point list in order;
[0056] If they are not the same, reverse the sequence numbers of all nodes in the control point list, that is, re-sort all nodes in the control point list in reverse; then pair the first starting point and the second starting point, and pair each node in the simplified boundary point list with a corresponding node in the control point list in sequence.
[0057] Further optimization, in step S5, the following formula is used to calculate the shape function weight of each internal point of the surface mesh for each node of the baseline of any shape:
[0058]
[0059] Among them, r k is the distance from an inner point in the surface mesh to the kth node on the baseline, d k is a vector pointing from an inner point in the face mesh to the kth node on the baseline, where k is a positive integer greater than or equal to 3.
[0060] Further optimization, in step S6, according to the set number of layers and the height of each layer, each pair of matching nodes on the baseline and the target line is traversed, and the vector direction from the node on the baseline to the corresponding node on the target line is taken as the positive direction of increasing the number of layers, and the coordinates of all nodes in each layer of the target grid are calculated and stored in the empty dictionary.
[0061] Compared with the prior art, the present invention has the following beneficial effects:
[0062] The method described in the present invention can efficiently obtain the coordinate information of any node inside and on the boundary of any polygonal surface mesh and the mathematical expression of the polygon vertex coordinates, so as to realize the calculation of the projection coordinates of the node in the target line, and then match all the nodes inside and on the boundary of the polygonal mesh, connect and further form a multi-layer body mesh unit. In the actual earth-rock dam mesh partitioning problem, it can be partitioned according to the actual situation of the earth-rock dam stacking, solves the problem of random generation of meshes when the three-dimensional model mesh is partitioned using the Griddle plug-in, improves the accuracy of subsequent fine model establishment and numerical simulation calculations, and provides a valuable reference for future numerical modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a flow chart of the multi-layer grid generation method of arbitrary polygon node matching based on Mean Value interpolation according to the present invention;
[0064] Figure 2 is a schematic diagram of the convex quadrilateral reference grid and target line in Example 1;
[0065] Figure 3 is a schematic diagram of a simplified number of reference grid boundary nodes in Example 1;
[0066] Figure 4 is a schematic diagram of connecting each pair of matching nodes in the baseline and target lines in Example 1;
[0067] Figure 5 This is a schematic diagram of the nodes on the baseline and target lines in Example 1 after being marked;
[0068] Figure 6 is a schematic diagram of generating a two-layer equidistant network between the convex quadrilateral reference grid and the target line in Example 1;
[0069] Figure 7 is a grid diagram of an earth-rock dam in Example 2;
[0070] Figure 8 is a schematic diagram of a reference grid and a target line of an earth-rock dam in Example 2;
[0071] Fig. 9 is a schematic diagram of the reference grid boundary nodes and all nodes on the target line in Example 2;
[0072] Fig.10 is a schematic diagram of connecting each pair of matching nodes in the baseline and target lines in Example 2;
[0073] Fig.11It is a schematic diagram of the elevation marking points of each layer of the actual earth-rock dam stacking layer in Example 2;
[0074] Fig.12 It is a schematic diagram of the multi-layer unequally spaced grids generated between the earth-rock dam reference grid and the target line in Example 2. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] Embodiment 1:
[0077] In this embodiment, the numerical simulation of earth-rock dam project is taken as an example. Figure 1 As shown in FIG. 1 , a multi-layer earth-rock dam mesh generation method based on arbitrary polygon node matching based on Mean Value interpolation includes the following steps:
[0078] Step S1: For the earth-rock dam engineering entity that has been partially meshed, select the face mesh of any polygon in a certain layer, and obtain the information of all vertices of the face mesh and all planes that form the face mesh. Traverse each node of each face of the face mesh. Generally, the face mesh is a quadrilateral. For the faces that have repeated nodes, merge the overlapping points according to the actual situation to form a triangular mesh; obtain the boundary node and internal point list information of the mesh through the built-in function, and form the corresponding boundary point list and internal point list including the serial number and coordinates of the point. The face mesh is recorded as the reference mesh.
[0079] Specifically, in this embodiment, a convex quadrilateral mesh is selected as the reference mesh.
[0080] Step S2: Select a known polyline. In actual engineering, the polyline is generally the contour line of the engineering entity. Obtain information of all nodes on the polyline. These nodes are recorded as control points. All control points constitute a control point list. The polyline is recorded as the target line.
[0081] Specifically, a closed convex quadrilateral is selected and recorded as the target line. Figure 2 is a schematic diagram of the convex quadrilateral reference grid and the target line in this embodiment, wherein the upper quadrilateral is the target line and the dark blue convex quadrilateral below is the reference grid.
[0082] Step S3: Determine whether the number of surface mesh boundary points is greater than the number of target line control points:
[0083] If the number of boundary points of the surface mesh is greater than the number of control points of the target line, the boundary nodes of the mesh are simplified, and the deleted boundary points are connected into a polyline, which is recorded as the baseline.
[0084] If the number of boundary points of the surface mesh is equal to the number of control points of the target line, the boundary line of the mesh is recorded as the baseline.
[0085] If the number of surface mesh boundary points is less than the number of target line control points, the entire multi-layer volume mesh generation process ends.
[0086] All nodes on the baseline form a simplified list of boundary points.
[0087] In this embodiment, Figure 2 As shown, the number of surface mesh boundary points is 11, the number of target line control points is 4, and the target line is smoothed by the Douglas method with a specified number of control points, so that the number of mesh boundary points is unified with the number of target line control points, that is, 4. Figure 3 It is a simplified schematic diagram of the number of reference grid boundary nodes in this embodiment.
[0088] Regarding the Douglas method by specifying the number of control points, the applicant has applied for a Chinese patent, titled: Method for optimizing Douglas decomposition of curves by the number of control points, application number: 2024113725262, so it will not be repeated here.
[0089] Step S4: determining whether the numbering sequence of all nodes in the simplified boundary point list along the baseline is consistent with the numbering sequence of all nodes in the control point list along the target line; if not, adjusting them to be consistent; specifically comprising the following steps:
[0090] Step S4.1: Select any point on the baseline and target line as the matching point; then use the KDTree algorithm to find the nodes closest to the two points in the simplified boundary point list and the control point list, and use the two nodes as the corresponding starting points, the one on the baseline is recorded as the first starting point, and the one on the target line is recorded as the second starting point;
[0091] Step S4.2: In the simplified boundary point list, according to the node arrangement order, take the node before and after the first starting point respectively; then the first starting point and the node before and after it form two vectors, and the cross product of the two vectors is calculated to obtain the normal direction of the baseline;
[0092] Similarly, in the control point list, according to the order of node arrangement, take the node before and after the second starting point respectively; then the second starting point and the node before and after it form two vectors, and the cross product of the two vectors is calculated to obtain the normal direction of the baseline;
[0093] Step S4.3: Determine whether the normal direction of the baseline is the same as the normal direction of the baseline:
[0094] If they are the same, the first starting point and the second starting point are paired by connecting the line, and each node in the simplified boundary point list is paired with a corresponding node in the control point list in sequence, and the two paired nodes are connected.
[0095] If they are not the same, reverse the sequence numbers of all nodes in the control point list, that is, re-sort all nodes in the control point list in reverse; then pair the first starting point and the second starting point by connecting them, and pair each node in the simplified boundary point list with a corresponding node in the control point list in sequence, and connect the two paired nodes.
[0096] Specifically, in a closed figure, the point before the starting point is considered to be the last point, and the point after the starting point is considered to be the second point; for these two pairs of vectors, the cross product is calculated to obtain the normal directions of the baseline and target lines; if the directions of the two normal vectors are different, the point sequence number of the target line is reversed, otherwise, the original target line point sequence number is returned; the baseline point sequence and the target line point sequence after point-to-point matching are returned, so that the baseline and target lines can be matched with these two points as base points, ensuring that the point-to-point matching relationship between the baseline and target lines is consistent with the closed curve node numbering in the clockwise and counterclockwise directions. Figure 4 Schematic diagram of connecting each pair of matching nodes in the baseline and target lines in this embodiment.
[0097] Step S5: Obtain the shape function weights of each node in the simplified boundary point list on each line segment of the baseline, and the shape function weights of each internal point of the surface mesh for each node of the baseline by using the Mean Value difference method;
[0098] Traverse the list of internal points, further traverse the coordinates of each point in the target line that has been matched, multiply the coordinates of the corresponding control points by the weights, obtain the coordinates of the projection points corresponding to each internal point of the surface mesh in the layer where the target line is located, and then connect each internal point of the surface mesh with the corresponding projection point.
[0099] Step S5: Obtain the shape function weights of each point on the baseline on each segment of the baseline and the shape function weights of each internal point of the surface mesh for each node of the baseline through the Mean Value difference;
[0100] Specifically, the following formula is used to calculate the shape function weights of each internal point of the surface mesh for each node of the baseline of any shape:
[0101]
[0102] Among them, r kis the distance from an inner point in the surface mesh to the kth node on the baseline, d k is a vector pointing from an inner point in the face mesh to the kth node on the baseline, where k is a positive integer greater than or equal to 3.
[0103] In this embodiment, the reference line is a convex quadrilateral, and the weights can also be solved by using the triangle area ratio method, the formula is as follows:
[0104]
[0105] Where p is the internal point of the surface mesh, v k is the kth node on the baseline. This formula refers to the shape function weight of a certain internal point P of the surface mesh to a certain boundary node, which is equal to the area of the triangle enclosed by the node and the front and rear nodes divided by the area of the two triangles enclosed by the node, the internal point and the front and rear points of the node respectively.
[0106] Two points need to be noted. First, the triangle area ratio method is only applicable to convex polygons, because concave polygons may produce negative areas when calculating the triangle area, resulting in errors in calculating the shape function weight. Second, for the shape function weight of a node on a line segment on the baseline, since the area of the triangle enclosed by the front and rear nodes is zero, but the divisor cannot be zero, the first and last points of the line segment are taken to calculate the weight using the shape function on the straight line.
[0107] In this embodiment, if Figure 5 As shown, the coordinates of the nodes on the baseline are: V1 (-8.11, -7.74, 0), V2 (22.24, -5.24, 0), V3 (26.71, 27.19, 0), V4 (7.51, 26.14, 0); the coordinates of the internal points of the benchmark grid are: P (11.44, 14.29, 0).
[0108] After matching, the coordinates of each node on the corresponding target line are L: v1 (-6.04, -0.04, 14.39), v2 (19.01, 0.49, 14.39), v3 (14.39, 18.88, 14.39), v4 (2.13, 20.48, 14.39); the coordinates of the projection point of the internal point P of the reference grid on the layer where the target line is located are: (6.33, 12.87, 14.39).
[0109] Step S6: After processing in steps S4 and S5, the surface mesh is matched with the target line to form a volume mesh; then, according to the set number of layers and the height of each layer, each pair of matching nodes on the baseline and the target line is traversed, and the vector direction from the node on the baseline to the corresponding node on the target line is taken as the positive direction of increasing the number of layers, and the coordinates of all nodes in each layer of the target mesh are calculated and stored in the empty dictionary to form a multi-layer volume mesh that meets the requirements.
[0110] In this embodiment, if Figure 6 As shown in the figure, it is a schematic diagram of generating two layers of equidistant grids between the convex quadrilateral reference grid and the target line. The projection coordinates of each point in the second layer are: v1 (-7.08, -4.89, 7.20), v2 (20.63, -2.38, 7.20), v3 (20.55, 23.03, 7.20), v4 (4.82, 23.31, 7.20); the projection point coordinates of the internal point P of the reference grid projected to the second layer grid are: p2 (8.89, 13.58, 7.20).
[0111] Step S7: loop through the number of mesh layers, traverse the face list of the initial face mesh in this loop, generate triangular prism or quadrangular prism units based on the triangle or quadrilateral faces, store the node numbers of the constituent units in the newly established unit dictionary; name the mesh object, display the mesh and return the mesh information.
[0112] Embodiment 2:
[0113] The method for generating a multi-layer earth-rock dam grid based on arbitrary polygon point matching based on Mean Value interpolation includes the following steps:
[0114] Step S1: Based on the selected arbitrary polygonal surface mesh, obtain all vertices of the surface mesh and all planes that form the surface mesh; traverse each node of each surface of the mesh. Generally, each mesh is a quadrilateral. For nodes that have repeated surfaces, merge the overlapping points to form a triangular mesh according to actual conditions; obtain the boundary point column and internal point column of the mesh through the built-in function.
[0115] Specifically, in this embodiment, a grid at a certain level of the earth-rock dam is selected as the reference grid. Figure 7 It is a grid diagram of the earth-rock dam in this embodiment.
[0116] Step S2: Select a polyline and obtain its control point list, and record the line as the target line. Specifically, select the contour node connection line of the bottom of the earth-rock dam to form the target line. Figure 8 Schematic diagram of the earth-rock dam reference grid and target line in this embodiment, wherein the upper blue surface grid is the reference grid, and the boundary points of the reference grid are extracted and simplified to become the reference line; the lower quadrilateral is the closed target line.
[0117] Step S3: Determine whether the number of surface mesh boundary points is greater than the number of target line control points: if the number of surface mesh boundary points is greater than the number of target line control points, simplify the boundary nodes of the mesh, connect the deleted boundary points into a broken line, and record the broken line as the baseline; if the number of surface mesh boundary points is equal to the number of target line control points, record the boundary line of the mesh as the baseline; if the number of surface mesh boundary points is less than the number of target line control points, end the entire multi-layer volume mesh generation process; all nodes on the baseline constitute a simplified boundary point list.
[0118] Specifically, in this embodiment, the number of grid boundary points is 18, and the number of target line control points is 18. The two are equal and do not need to be further simplified. The surface grid boundary contour is the desired reference line. Fig. 9 It is a simplified schematic diagram of the number of reference grid boundary nodes in this embodiment.
[0119] Step S4: Select a node on the surface grid and target line selected in S1 as the matching point respectively, and use KDTree to find the two nearest points of these two points in their own point list and establish vectors; for these two pairs of vectors, calculate the cross product to obtain the normal direction of the baseline and target line respectively; if the directions of the normal vectors of the two are different, reverse the point list sequence of the target line, otherwise, return the original target line point list sequence; return the baseline point list and target line point list after point-to-point matching, so that the baseline and target lines can be matched with these two points as the base points, ensuring that the point-to-point matching relationship between the baseline and target lines is consistent with the closed curve node numbering in the clockwise and counterclockwise direction, and connect the lines; traverse each pair of matching points in the baseline and target lines and connect the lines. Fig.10 Schematic diagram of connecting lines of pairs of matching points in the baseline and target lines in this embodiment.
[0120] Step S5: Obtain the shape function weights of each point on the baseline on each segment of the baseline and the shape function weights of each internal point of the grid for each node of the baseline through the Mean Value difference; traverse the internal point list, further traverse the coordinates of each point in the target line that has been matched, multiply the corresponding coordinates by the weights, and obtain the coordinates of each internal point in the target line. The specific calculation method is the same as that in the embodiment.
[0121] Specifically, in this embodiment, there are no nodes inside the reference grid, so it is only necessary to match each point on the reference line with each point on the target line.
[0122] Step S6: Read the elevations of the earth-rock dam stacking layers in the actual application engineering scenario and add them to the empty list, and return the elevations of each layer of the earth-rock dam as the basis for the grid layer height in the grid and the target line. Fig.11It is a schematic diagram of the elevation of each layer of the actual earth-rock dam in this embodiment. Traverse the matching points on the baseline and the target line, use the actual elevation of each layer of the earth-rock dam as the layer boundary, and use the vector direction from the reference point on the baseline to the reference point on the target line as the positive direction of the layer number increase, calculate the coordinates of all nodes in each layer of the target grid and store them in an empty dictionary;
[0123] Step S7: loop through the number of mesh layers, traverse the face list of the initial mesh in this loop, generate triangular prism or quadrangular prism units based on the triangle or quadrilateral faces, store the node numbers of the constituent units in the newly established unit dictionary; name the mesh object, display the mesh and return the mesh information. Fig.12 It is a schematic diagram of the multi-layer unequally spaced grids generated between the earth-rock dam reference grid and the target line in this embodiment.
[0124] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A multi-layer mesh generation method based on arbitrary polygon node matching based on Mean Value interpolation, characterized in that: The following steps are included: Step S1: Select any polygonal surface mesh that has been divided, obtain all boundary points, internal points of the surface mesh, and information of all planes forming the surface mesh, and form a corresponding boundary point list and internal point list; the surface mesh is recorded as a reference mesh; Step S2: Select a known polyline, obtain information of all nodes on the polyline, these nodes are recorded as control points, all control points constitute a control point list, and the polyline is recorded as the target line; Step S3: Determine whether the number of surface mesh boundary points is greater than the number of target line control points: If the number of boundary points of the surface mesh is greater than the number of control points of the target line, the boundary nodes of the mesh are simplified, and the deleted boundary points are connected into a polyline, which is recorded as the baseline; If the number of boundary points of the surface mesh is equal to the number of control points of the target line, the boundary line of the mesh is recorded as the baseline; If the number of surface mesh boundary points is less than the number of target line control points, the entire multi-layer volume mesh generation process ends; All nodes on the baseline constitute a simplified list of boundary points; Step S4: determining whether the numbering sequence of all nodes in the simplified boundary point list along the baseline is consistent with the numbering sequence of all nodes in the control point list along the target line; if not, adjusting them to be consistent; Then, the nodes in the simplified boundary point list are matched with the nodes in the control point list, so that each node in the simplified boundary point list is paired with a node in the control point list in order, and the two paired nodes are connected; Step S5: Obtain the shape function weights of each node in the simplified boundary point list on each line segment of the baseline, and the shape function weights of each internal point of the surface mesh for each node of the baseline by using the Mean Value difference method; Based on the coordinates of each node in the control point list and the shape function weights of each internal point of the surface mesh for each node of the baseline, the coordinates of the projection points corresponding to each internal point of the surface mesh in the layer where the target line is located are obtained, and then each internal point of the surface mesh is connected to the corresponding projection point; Step S6: After processing in steps S4 and S5, the surface mesh is matched with the target line to form a volume mesh; then the volume mesh is layered according to the set number of layers and the height of each layer to form a multi-layer volume mesh that meets the requirements.
2. The multi-layer grid generation method based on arbitrary polygon node matching based on Mean Value interpolation according to claim 1 is characterized in that: The step S1 specifically includes the following steps: Step S1.1: Select a polygonal surface mesh, and obtain all boundary points, internal points, and information of all planes forming the surface mesh through the built-in function of the software; Step S1.2: Set a surface mesh composed of four points, that is, set the surface mesh to be a quadrilateral mesh; traverse all nodes on each plane in the surface mesh, and if the obtained nodes overlap, remove the overlapping nodes, so that the surface mesh is a triangular mesh that conforms to the actual situation; Step S1.3: All boundary point information constitutes a boundary point list, and the internal point information constitutes an internal point list, which includes the coordinates and corresponding serial number of each node.
3. The multi-layer grid generation method based on arbitrary polygon node matching based on Mean Value interpolation according to claim 2 is characterized in that: In step S3, when the number of surface mesh boundary points is greater than the number of target line control points, the mesh boundary nodes are simplified by using the Douglas-Peucker method with a specified number of control points, which specifically includes the following steps: Step S3.1: All boundary points of the surface mesh constitute a boundary point list List1, including the sequence number and coordinate value of each node; Set the number of control points on the target line to N, and set the smoothing threshold ε; Create an empty list to store the control point serial numbers, recorded as serial number list List2; Create a list for storing distances, recorded as distance list List3; create a list for storing the farthest distances, recorded as list List4; Step S3.2: First iteration of segmentation: Step S3.2.1: Take the first and last two nodes in the boundary point list, record them as the starting point A1 and the end point B1, connect the two nodes to form a straight line L1, and store the sequence numbers of the two nodes in the sequence number list List2; Step S3.2.2: traverse the boundary point list List1, find the node P1 farthest from the line L1, store the sequence number of the node P1 in the sequence number list List2, and store the farthest distance L1 in the list List4; Step S3.2.3: Determine whether the farthest distance L1 is greater than the set smoothing threshold ε: If it is less than or equal to, stop splitting; If it is greater, proceed to step S2.4; Step S3.2.4: Determine whether the number of elements in the serial number list is equal to the set number of control points N: If yes, stop the segmentation; If not, perform the second iteration of segmentation; S3: Second iteration of segmentation: Step S3.3.1: Divide the boundary point list List1 in step S1 into two parts through node P1, including a sublist List consisting of nodes to the left of node P1 11 and a sublist List consisting of the nodes to the right of node P1 12 ; Connect node P1 with starting point A1 and end point B1 respectively to form straight lines P1A1 and P1B1, and find the sublist List 11 The node P that is farthest from the line P1A1 2,1 , the distance is recorded as L 21 ; Find the sublist List 12 The node P that is farthest from the line P1B1 2,2 , the distance is recorded as L 22 ; Compare distance L 21 , L 22 , store the larger distance in List4, the smaller distance in List3, and store the node number P corresponding to the larger distance 2,j Add to the serial number list List2, j = 1 or 2; Step S3.3.2: Determine whether the larger distance is greater than the set smoothing threshold ε: If it is less than or equal to, stop splitting; If it is greater, then determine whether the number of elements in the serial number list List2 is equal to the set number of control points N: If yes, stop the segmentation; If not, perform the third iteration of segmentation; …… Step S3.4: Iterate in sequence until the corresponding larger distance after the last iteration is less than or equal to the set smoothing threshold ε, or the number of elements in the serial number list List2 is equal to the set number of control points N, and the segmentation is completed.
4. The multi-layer grid generation method based on arbitrary polygon node matching based on Mean Value interpolation according to claim 3 is characterized in that: The process of the i-th iteration is as follows: The node P corresponding to the larger distance generated during the i-1th iterative partitioning process i-1,j , the sublist it is in is divided into two parts, including the one composed of node P i-1,j The sublist List consisting of the nodes on the left i1 and by node P i-1,j The nodes on the right make up the sublist List i2 ; Connect nodes P respectively i-1,j and starting point A i-1 and end point B i-1 , forming a straight line P i-1,j A i-1 and P i-1,j B i-1 , find the list List i1 Middle distance straight line P i-1,j A i-1 The farthest node P i,1 , the distance is recorded as L i1 ; Find the list List i2 Middle distance straight line P i-1,j B i-1 The farthest node P i,2 , the distance is recorded as L i2 ; Compare distance L i1 , L i2 , compare the larger one with all the distance values in List3 for a second time, store the larger distance obtained by the second comparison in List4, add the node number corresponding to the larger distance obtained by the second comparison to the number list List2; store the smaller distance obtained by the second comparison in List3, and remove the original largest distance value in List3 and moved to List4 in this comparison, i is a positive integer greater than or equal to 2.
5. The multi-layer grid generation method based on arbitrary polygon node matching based on Mean Value interpolation according to claim 4 is characterized in that: In the step S4, it is determined whether the numbering sequence of all nodes in the simplified boundary point list along the baseline is consistent with the numbering sequence of all nodes in the control point list along the target line. If they are inconsistent, they are adjusted to be consistent, which specifically includes the following steps: Step S4.1: Select any point on the baseline and target line as the matching point; then use the KDTree algorithm to find the nodes closest to the two points in the simplified boundary point list and the control point list, and use the two nodes as the corresponding starting points, the one on the baseline is recorded as the first starting point, and the one on the target line is recorded as the second starting point; Step S4.2: In the simplified boundary point list, according to the node arrangement order, take the node before and after the first starting point respectively; then the first starting point and the node before and after it form two vectors, and the cross product of the two vectors is calculated to obtain the normal direction of the baseline; Similarly, in the control point list, according to the order of node arrangement, take the node before and after the second starting point respectively; then the second starting point and the node before and after it form two vectors, and the cross product of the two vectors is calculated to obtain the normal direction of the baseline; Step S4.3: Determine whether the normal direction of the baseline is the same as the normal direction of the baseline: If they are the same, pair the first starting point and the second starting point, and pair each node in the simplified boundary point list with a corresponding node in the control point list in order; If they are not the same, reverse the sequence numbers of all nodes in the control point list, that is, re-sort all nodes in the control point list in reverse; then pair the first starting point and the second starting point, and pair each node in the simplified boundary point list with a corresponding node in the control point list in sequence.
6. The multi-layer grid generation method based on arbitrary polygon node matching based on Mean Value interpolation according to claim 5 is characterized in that: In step S5, the shape function weights of each internal point of the surface mesh for each node of the reference line of any shape are calculated using the following formula: Among them, r k is the distance from an inner point in the surface mesh to the kth node on the baseline, d k is a vector pointing from an inner point in the face mesh to the kth node on the baseline, where k is a positive integer greater than or equal to 3.
7. The multi-layer grid generation method based on arbitrary polygon node matching based on Mean Value interpolation according to claim 6 is characterized in that: In step S6, according to the set number of layers and the height of each layer, each pair of matching nodes on the baseline and the target line is traversed, and the vector direction from the node on the baseline to the corresponding node on the target line is taken as the positive direction of increasing the number of layers, and the coordinates of all nodes in each layer of the target grid are calculated and stored in the empty dictionary.
Citation Information
Patent Citations
Method for re-establishing three-dimensional model gridding
CN101110126A
Three-dimensional entity model surface finite element mesh automatic generation method
CN102306396A
Method for interpolating structured grid non-matching interface
CN104408773A
Mesh division and heat conduction calculation method for multilayer heterogeneous thin-wall solid heat conduction calculation
CN115544818A
Method and an apparatus for generating bounding polygon of plane model and method for recognizing furniture outline
WO2023050675A1