Multi-layer mesh generation method based on arbitrary polygon node matching based on mean value interpolation
The multi-layer grid of the earth-rock dam is generated by the Mean Value interpolation method, which solves the problem of random generation in the grid segmentation of the three-dimensional model of the earth-rock dam, realizes the accurate projection of the interior and boundary points of the polygon and the generation of multi-layer grids, and improves the accuracy of numerical simulation calculations.
Patent Information
- Application Number
- CN202411792500.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-07
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-07
AI Technical Summary
In the existing technology of meshing the three-dimensional model of earth-rock dams, the randomly generated spatial grid cannot meet the requirements of layered stacking building features, and cannot effectively solve the coordinate relationship between each point inside the reference grid and a point on the boundary, nor can it generate multi-layer grids.
An arbitrary polygon node matching method based on Mean Value interpolation is adopted. By obtaining the information of polygon boundary points and internal points, the coordinates of the projection points of the nodes on the target line are calculated using the Mean Value interpolation method to form a multi-layer unequal-distance grid.
It is possible to generate a regular grid with strict layer-by-layer projection according to the actual layering situation of the earth-rock dam, thereby improving the accuracy of numerical simulation calculations and the efficiency of fine model establishment.
Smart Images

Figure CN119720656B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of grid generation, and in particular relates to a multi-layer grid 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 meshing project, the original technical method was to directly mesh the model in Rhino software through the Griddle plug-in, which was relatively random in mesh shape and space generation.
[0004] However, in actual engineering, due to the layered nature of earth-rock dams, later calculations must be performed based on elevation. Therefore, the random generation of spatial grids is insufficient, requiring a regular grid generation method that projects each layer strictly according to the layering. Specifically, this method addresses the problem of projecting points within the reference grid. Specifically, for a point within a polygon or on its boundary, how to determine the relationship between the coordinates of that point and the coordinates of each vertex, as well as the problem of interpolating between polygonal meshes and polylines to generate multi-layered grids. 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, it can realize the projection of the point into the new polyline; at the same time, it can realize the formation of multi-layer unequal-spacing grids in polygons and polylines through elevation lists.
[0006] In order to achieve the above object, the present invention adopts 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, and information of all planes forming the surface mesh, and construct a corresponding boundary point list and internal point list; this surface mesh is recorded as the reference mesh;
[0009] Step S2: Select a known polyline, obtain information about all nodes on the polyline, record these nodes as control points, all control points form a control point list, and record the polyline 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 broken line, 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 order of all nodes along the baseline in the simplified boundary point list is consistent with the numbering order of all nodes along the target line in the control point list; 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, using the Mean Value interpolation 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; the volume mesh is then 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 use the software's built-in functions to obtain information about all boundary points, internal points, and all planes that form the surface mesh.
[0022] Step S1.2: Set a surface mesh consisting of four points, that is, set the surface mesh to 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 form 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, record them as starting point A1 and end point B1, connect these two nodes to form a straight line L1, and store the sequence numbers of these two nodes in sequence list List2;
[0031] Step S3.2.2: Traverse the boundary point list List1, find the node P1 that is 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;
[0032] Step S3.2.3: Determine whether the farthest distance L1 is 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 sequence list is equal to the set number of control points N:
[0036] If so, stop dissecting;
[0037] If not, perform the second iterative subdivision;
[0038] S3: Second iterative segmentation:
[0039] Step S3.3.1: Divide the boundary point list List1 in step S1 into two parts through node P1, including
[0040] The sublist List composed of the nodes on the left 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;
[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 sequence list List2 is equal to the set number of control points N:
[0044] If so, stop dissecting;
[0045] If not, perform the third iteration of the subdivision;
[0046] …
[0047] Step S3.4: Iterate in sequence until the corresponding maximum distance after the last iteration is less than or equal to the set smoothing threshold ε, or the number of elements in the sequence list List2 is equal to the set number of control points N, and the segmentation is completed.
[0048] Further optimization and the iterative subdivision process for the i-th time are as follows:
[0049] The node P corresponding to the larger distance generated during the i-1th iterative segmentation process i-1,j, the sublist is divided into two parts, including the node P i-1,j The sublist List composed of the nodes on the left i1 and by node P i-1,j The sublist List composed of the nodes on the right 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 twice, store the larger distance obtained from the second comparison in List4, and add the node number corresponding to the larger distance obtained from the second comparison to the sequence list List2; store the smaller distance obtained from the second comparison in List3, and remove the original largest distance value in List3 and the distance value moved to List4 in this comparison, where i is a positive integer greater than or equal to 2.
[0050] Further optimization is performed in step S4 to determine whether the numbering order of all nodes in the simplified boundary point list along the baseline is consistent with the numbering order of all nodes in the control point list along the target line. If not, the order is adjusted to be consistent, which specifically includes the following steps:
[0051] Step S4.1: Select a point on the baseline and target lines as the matching point. Then, use the KDTree algorithm to find the nodes closest to these two points in the simplified boundary point list and the control point list, respectively. These two nodes are used 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, select the node before and after the first starting point in the order in which the nodes are arranged. The first starting point and the node before and after it form two vectors. Take the cross product of these two vectors to obtain the normal direction of the baseline.
[0053] Similarly, in the control point list, select the node before and after the second starting point in the order in which the nodes are arranged. The second starting point and the node before and after it form two vectors. The cross product of the two vectors is used 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 then 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 the 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 interior 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 nodes inside and on the boundary of the polygonal mesh, connect and further form multi-layer mesh units. In the actual earth-rock dam mesh partitioning problem, it can be partitioned according to the actual situation of the earth-rock dam stacking, solve the problem of random generation of meshes when using the Griddle plug-in for three-dimensional model mesh partitioning, improve the accuracy of subsequent fine model establishment and numerical simulation calculations, and provide 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 This 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 marking;
[0068] Figure 6 This 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 This is a grid diagram of the earth-rock dam in Example 2;
[0070] Figure 8 is a schematic diagram of the earth-rock dam reference grid and target line in Example 2;
[0071] Figure 9 is a schematic diagram of the reference grid boundary nodes and all nodes on the target line in Example 2;
[0072] Figure 10 is a schematic diagram of connecting each pair of matching nodes in the baseline and target lines in Example 2;
[0073] Figure 11 This is a schematic diagram of the elevation marking points of each layer of the actual earth-rock dam in Example 2;
[0074] Figure 12This 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] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0076] Example 1:
[0077] In this embodiment, the numerical simulation of earth-rock dam project is taken as an example. Figure 1 As shown in FIG, 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 a partially meshed earth-rockfill dam, select a polygonal surface mesh from a layer and obtain information about all vertices and planes that form the surface mesh. Traverse each node on each face of the surface mesh. Generally, surface meshes are quadrilaterals. For nodes with duplicate faces, merge overlapping points to form a triangular mesh. Use built-in functions to obtain information about the boundary nodes and internal point lists of the mesh, constructing corresponding boundary and internal point lists, including point numbers and coordinates. This surface mesh is referred to as the reference mesh.
[0079] Specifically, in this embodiment, a convex quadrilateral grid is selected as the reference grid.
[0080] Step S2: Select a known polyline. In actual engineering, the polyline is generally the contour line of the engineering entity. Obtain information about 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 Schematic diagram of the convex quadrilateral reference grid and 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 broken line, which is recorded as the baseline.
[0084] If the number of surface mesh boundary points is equal to the number of target line control points, 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 in the figure, the number of surface mesh boundary points is 11, and the number of target line control points is 4. The target line is smoothed by the Douglas method with a specified number of control points, and the number of mesh boundary points and the number of target line control points are unified, 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 a curve by the number of control points, application number: 2024113725262, so it will not be repeated here.
[0089] Step S4: Determine whether the numbering order of all nodes along the baseline in the simplified boundary point list is consistent with the numbering order of all nodes along the target line in the control point list. If not, adjust them to be consistent. Specifically, the steps include:
[0090] Step S4.1: Select a point on the baseline and target lines as the matching point. Then, use the KDTree algorithm to find the nodes closest to these two points in the simplified boundary point list and the control point list, respectively. These two nodes are used 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, select the node before and after the first starting point in the order in which the nodes are arranged. The first starting point and the node before and after it form two vectors. Take the cross product of these two vectors to obtain the normal direction of the baseline.
[0092] Similarly, in the control point list, select the node before and after the second starting point in the order in which the nodes are arranged. The second starting point and the node before and after it form two vectors. The cross product of the two vectors is used 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 them, 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 the 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 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 directions. Figure 4 Schematic diagram of connecting pairs 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, using the Mean Value interpolation 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, and 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. 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 on the baseline through Mean Value interpolation;
[0100] Specifically, 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:
[0101]
[0102] Among them, r k is the distance from an inner point in the surface mesh to the kth node on the baseline, d kis a vector pointing from an interior 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, as shown in the following formula:
[0104]
[0105] Where p is the internal point of the surface mesh, v k is the kth node on the baseline. This formula describes the shape function weight of an internal point P on a surface mesh for a boundary node, which is equal to the area of the triangle formed by the node and the nodes before and after it, divided by the area of the two triangles formed by the node, the internal point, and the two points before and after 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, which will cause 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 back 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 P of the internal point 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 target lines is traversed. 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. The coordinates of all nodes in each layer of the target mesh are calculated and stored in an empty dictionary to form a multi-layer volume mesh that meets the requirements.
[0110] In this embodiment, if Figure 6Figure 2 shows a schematic diagram of generating two layers of equidistant meshes between a convex quadrilateral reference mesh and a target line. The projected 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), and v4 (4.82, 23.31, 7.20). The projected coordinates of a point P inside the reference mesh onto the second layer are: p2 (8.89, 13.58, 7.20).
[0111] Step S7: Loop through the mesh layers, traverse the face list of the initial face mesh, generate triangular prism or quadrangular prism elements based on the triangle or quadrilateral faces, and store the node numbers of the constituent elements in the newly established element dictionary; name the mesh object, display the mesh and return the mesh information.
[0112] Example 2:
[0113] The grid generation method for multi-layer earth-rock dam based on arbitrary polygon point matching using 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 with repeated surfaces, merge the overlapping points to form a triangular mesh according to the actual situation; obtain the boundary point list and internal point list 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 this line as the target line. Specifically, select the line connecting the bottom contour nodes 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. The blue surface grid above is the reference grid, and the boundary points of the reference grid are extracted and simplified to form the reference line; the quadrilateral below 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 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 no further simplification is required. The surface grid boundary outline is the desired reference line. Figure 9 This is a simplified schematic diagram of the number of reference grid boundary nodes in this embodiment.
[0119] Step S4: Select a node on each of the surface mesh and target line selected in S1 as a matching point, and use KDTree to find the two nearest points of these two points in their own point lists and establish vectors; for these two pairs of vectors, calculate the cross product to obtain the normal directions of the baseline and target lines; if the directions of the two normal vectors are different, reverse the point list sequence of the target line, otherwise, return to 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 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 clockwise and counterclockwise directions, and connect them; traverse each pair of matching points in the baseline and target lines and connect them. Figure 10 Schematic diagram of connecting lines of each pair of matching points in the baseline and target lines in this embodiment.
[0120] Step S5: Use Mean Value interpolation to obtain the shape function weights of each point on the baseline for each segment of the baseline, and the shape function weights of each inlier point of the grid for each node on the baseline. The inlier list is traversed, and the coordinates of each point in the matched target line are further traversed. The corresponding coordinates are multiplied by the weights to obtain the coordinates of each inlier point within the target line. The specific calculation method is the same as in the previous 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 layers in the actual application engineering scenario and add them to an empty list, returning the elevations of the earth-rock dam layers as the basis for the grid layer heights in the grid and the target line. Figure 11 This is a schematic diagram of the elevations of each layer of the actual earth-rock dam in this embodiment. Traversing each matching point on the baseline and target lines, using the actual elevation of each layer of the earth-rock dam as the layer boundary, and using 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, the coordinates of all nodes in each target grid layer are calculated and stored in an empty dictionary.
[0123] Step S7: Loop through the mesh layers, traverse the face list of the initial mesh, generate triangular prism or quadrangular prism units based on the triangle or quadrilateral faces, and 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. Figure 12Schematic diagram of multi-layer unequally spaced grids generated between the earth-rock dam reference grid and the target line in this embodiment.
[0124] With the above-described preferred embodiments of the present invention as a guide, and with reference to the above description, relevant personnel are fully capable of making various changes and modifications without departing from the technical scope of this invention. The technical scope of this invention is not limited to the contents of the specification and 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, and information of all planes forming the surface mesh, and construct a corresponding boundary point list and internal point list; this surface mesh is recorded as a reference mesh; the polygonal surface mesh is the mesh of the three-dimensional model of the earth-rockfill dam; Step S2: Select a known polyline, obtain information about all nodes on the polyline, record these nodes as control points, all control points form a control point list, and record the polyline 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 broken line, 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 order of all nodes along the baseline in the simplified boundary point list is consistent with the numbering order of all nodes along the target line in the control point list; 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 sequence, 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, using the Mean Value interpolation 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; the volume mesh is then 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 use the software's built-in functions to obtain information about all boundary points, internal points, and all planes that form the surface mesh. Step S1.2: Set a surface mesh consisting of four points, that is, set the surface mesh to 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 form 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 starting point A1 and end point B1, and connect these two nodes to form a straight line L 1, and store the sequence numbers of these two nodes in the sequence number list List2; Step S3.2.2: Traverse the boundary point list List1 and find the distance line L 1 The farthest node P1, store the sequence number of node P1 in the sequence list List2, and store the farthest distance L 1 is stored in List4; Step S3.2.3: Determine the maximum distance L Is 1 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 sequence list is equal to the set number of control points N: If so, stop dissecting; If not, perform the second iterative subdivision; S3: Second iterative 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 the 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 sequence list List2 is equal to the set number of control points N: If so, stop dissecting; If not, perform the third iteration of the subdivision; …… Step S3.4: Iterate in sequence until the corresponding maximum distance after the last iteration is less than or equal to the set smoothing threshold ε, or the number of elements in the sequence 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 iterative segmentation for the i-th time is as follows: The node P corresponding to the larger distance generated during the i-1th iterative segmentation process i-1,j , the sublist is divided into two parts, including the node P i-1,j The sublist List composed of the nodes on the left i1 and by node P i-1,j The sublist List composed of the nodes on the right 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 twice, store the larger distance obtained from the second comparison in List4, and add the node number corresponding to the larger distance obtained from the second comparison to the sequence list List2; store the smaller distance obtained from the second comparison in List3, and remove the original largest distance value in List3 and the distance value moved to List4 in this comparison, where 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 step S4, it is determined whether the numbering order of all nodes along the baseline in the simplified boundary point list is consistent with the numbering order of all nodes along the target line in the control point list. If they are inconsistent, the order is adjusted to be consistent. Specifically, the steps include: Step S4.1: Select a point on the baseline and target lines as the matching point. Then, use the KDTree algorithm to find the nodes closest to these two points in the simplified boundary point list and the control point list, respectively. These two nodes are used 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, select the node before and after the first starting point in the order in which the nodes are arranged. The first starting point and the node before and after it form two vectors. Take the cross product of these two vectors to obtain the normal direction of the baseline. Similarly, in the control point list, select the node before and after the second starting point in the order in which the nodes are arranged. The second starting point and the node before and after it form two vectors. The cross product of the two vectors is used 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 then 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 the 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 inner 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 From an inner point in the surface mesh to the first point on the reference line k The distance between nodes, d k Points to the first point on the reference line from an inner point in the face mesh k The vector of nodes, k A positive integer is 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 target lines 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. The coordinates of all nodes in the target grid of each layer are calculated and stored in an 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