Method for optimizing a curve douglas subdivision by controlling the number of points
The Douglas subdivision method with optimized number of control points solves the problem of the inability to specify the number of control points in the numerical simulation of earth-rock dams, achieves precise limitation of the number of control points and deletion of redundant control points, and improves computational efficiency and matching convenience.
Patent Information
- Application Number
- CN202411372526.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In the existing technology, in the process of generating three-dimensional grids for numerical simulation of earth-rock dams, the number of control points of closed polylines cannot be specified, resulting in redundant control points, which cannot be successfully matched with the grid and affects the calculation efficiency.
The Douglas method for optimizing the number of control points is used to specify the number of control points N. In each iterative subdivision, the farthest point is added as the control node, gradually approaching the set value N, and redundant control points are deleted to ensure that the number of control points matches the grid boundary.
It achieves precise limitation on the number of control points, maintains curve characteristics, simplifies the matching of curve control points and grid boundaries, improves the efficiency of numerical simulation, and facilitates subsequent grid generation.
Smart Images

Figure CN119337663B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of mesh partitioning, and particularly relates to a method for optimizing curve Douglas partitioning by controlling the number of control points. BACKGROUND
[0002] Mesh partitioning is the first step of numerical simulation calculation, and the purpose is to partition a three-dimensional model so as to solve control equations by using a finite difference method or a finite element method.
[0003] In the process of three-dimensional mesh generation of numerical simulation of earth and rockfill dams, an actual engineering contour closed polyline and a basic mesh surface are matched as a top surface and a bottom surface, so that the mesh point coordinates are projected into the closed polyline, and a mesh body is further inserted and generated between the two, which requires that the control points of the closed polyline and the control points in the mesh surface have the same number.
[0004] In the actual simulation process, due to the contour characteristics of engineering buildings, the closed polyline often contains redundant control points, so that the mesh cannot be successfully matched. At present, the original Douglas method only selects the control points of the control curve direction characteristics within the smooth threshold range, but cannot specify the number of control points, often leading to the presence of redundant control points, resulting in matching failure. Therefore, how to specify the number of control points in the Douglas smoothing method is a big difficulty in the engineering field. SUMMARY
[0005] The application aims to provide a method for improving curve Douglas partitioning by specifying the number of control points, which can accurately limit the number of control points and maintain the curve characteristics, delete redundant control points to simplify the calculation, and provide convenience for subsequent curve control point matching and mesh partitioning.
[0006] In order to achieve the above-mentioned purpose, the application adopts the following technical solutions:
[0007] A method for optimizing curve Douglas partitioning by controlling the number of control points, characterized in that it comprises the following steps,
[0008] S1: obtaining the node information of the selected curve, grouping all the node information into an ordered list, denoted as a node list List1, including the serial number and coordinate value of the node;
[0009] Setting the number of control points N and the smooth threshold value ε;
[0010] Establishing an empty list for storing the serial number list of the control points, denoted as a serial number list List2;
[0011] Establishing a list for storing the distance, denoted as a distance list List3; establishing a list for storing the farthest distance, denoted as a list List4;
[0012] S2: first iteration subdivision:
[0013] S2.1: take the first and last nodes in the node list, denoted as starting point A1 and ending point B1, and connect the two nodes to form a straight line L 1, and store the serial numbers of the two nodes in the serial number list List2;
[0014] S2.2: traverse the node list List1 to find the node P1 that is farthest from the straight line L 1, store the serial number of node P1 in the serial number list List2, and store the farthest distance L 1 in the list List4;
[0015] S2.3: determine whether the farthest distance L 1 is greater than the set smoothing threshold ε:
[0016] If it is less than or equal to, stop the subdivision;
[0017] If it is greater than, proceed to step S2.4;
[0018] S2.4: determine whether the number of elements in the serial number list is equal to the set number of control points N:
[0019] If yes, stop the subdivision;
[0020] If no, proceed to the second iteration subdivision;
[0021] S3: second iteration subdivision:
[0022] S3.1: divide the node list List1 in step S1 into two parts by node P1, including a sub-list List 11 composed of nodes to the left of node P1 and a sub-list List 12 composed of nodes to the right of node P1; connect node P1 and the starting point A1 and the ending point B1 to form straight lines P1A1 and P1B1, find the node P 11 in the list List 2,1 that is farthest from the straight line P1A1, and the distance is L 21 ; find the node P 12 in the list List 2,2 that is farthest from the straight line P1B1, and the distance is L 22 ; compare the distances L 21 , L 22 , store the larger distance in the list List4, store the smaller distance in the list List3, and add the serial number of the node corresponding to the larger distance P 2,j to the serial number list List2, j=1 or 2;
[0023] S3.2: judge whether the larger distance is greater than the set smoothing threshold ε:
[0024] If not, stop the subdivision;
[0025] If yes, judge whether the number of elements in the sequence number list List2 at this time is equal to the set number of control points N:
[0026] If yes, stop the subdivision;
[0027] If not, proceed with the third iteration subdivision;
[0028] …
[0029] S4: iterate in turn until the larger distance corresponding to the last iteration is less than or equal to the set smoothing threshold ε, or the number of elements in the sequence number list List2 at this time is equal to the set number of control points N, and the subdivision ends.
[0030] Further optimization, the number of control points N is a positive integer greater than or equal to 1.
[0031] Further optimization, the i-th iteration subdivision process is as follows:
[0032] Through the larger distance corresponding to the node P generated in the i-1 iteration subdivision process i-1,j , divide the sub-list in which it is located into two parts, including a sub-list List i-1,j composed of nodes on the left side of P i1 and a sub-list List i-1,j composed of nodes on the right side of P i2 ; connect the nodes P i-1,j and the starting point A i-1 and the terminal point B i-1 respectively to form straight lines P i-1,j A i-1 and P i-1,j B i-1 , find the node P i1 in the list List i-1,j farthest from the straight line P i-1 A i,1 , and the distance is recorded as L i1 ; find the node P i2 in the list List i-1,j farthest from the straight line P i-1 B i,2 , and the distance is recorded as L i2 ; compare the distances L i1 , L i2The larger one is compared with all distance values in the list List3 for the second time, the larger distance obtained by the second comparison is stored in the list List4, and the node serial number corresponding to the larger distance obtained by the second comparison is added to the serial number list List2; the smaller distance obtained by the second comparison is stored in the list List3, and the distance value originally in the list List3 and moved to the list List4 in the present comparison is removed, and i is a positive integer greater than or equal to 2.
[0033] Compared with the prior art, the present application has the following beneficial effects:
[0034] 1、The scheme can accurately limit the number of control points of the closed polyline curve to be equal to the previously specified control point number N while keeping the curve trend and overall structure and characteristics, in actual engineering application, N is the control point number of the known grid boundary, which is obtained from the software built-in function, so that the closed polyline control points and the grid boundary control points are matched one by one, the grid points are projected into the polyline by using the shape function, and convenience is provided for subsequent grid subdivision.
[0035] 2、The method gradually approaches the set value N by adding only one farthest point as a control node in each subdivision cycle based on the original Douglas smoothing method, finally accurately satisfies that the actual control point number is equal to N, so that only part of the original curve node list is selected, redundant control points are deleted, the efficiency of numerical simulation is improved, and valuable reference is provided for future numerical modeling. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 is a flowchart of the method for optimizing the Douglas subdivision of the curve by the control point number of the present application;
[0037] Figure 2 is a schematic diagram of the closed curve before subdivision and the known grid in the embodiment using the improved Douglas method;
[0038] Figure 3 is a schematic diagram of the first iteration subdivision in the embodiment;
[0039] Figure 4 is a schematic diagram of the second iteration subdivision in the embodiment;
[0040] Figure 5 is a schematic diagram of the third iteration subdivision in the embodiment;
[0041] Figure 6 is a schematic diagram of the closed curve after smoothing by the Douglas method in the embodiment of specifying the control point number. DETAILED DESCRIPTION
[0042] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0043] As shown in Figure 1 , a method for optimizing Douglas subdivision of a curve by controlling the number of points comprises the following steps:
[0044] S1: Two-dimensional grid division is completed on the bottom surface of a known earth-rock dam three-dimensional model, and the bottom surface grid node information of the earth-rock dam three-dimensional model is obtained through a software built-in function.
[0045] Figure 2 The schematic diagram of the closed curve before the improved Douglas method is used in the present embodiment and the known grid. The closed curve is a contour line of a certain horizontal plane of an earth-rock dam, and after the control point simplification of the present algorithm, the grid boundary control points and the closed curve control points need to be one-to-one corresponding, and the grid is projected into the closed curve. The gray closed curve has 9 nodes, and there are 5 nodes on the grid boundary. All the node information of the closed curve is composed into an ordered list, denoted as node list List1, including the serial number and coordinate value of the node, and the nodes in the node list List1 are arranged in order from the beginning to the end according to the serial number.
[0046] Select one of the grids, and set the number of control points N and the smoothing threshold ε according to the number of nodes of the grid.
[0047] In the present embodiment, N is set to 5 and ε is
[0048] An empty list is established for storing the serial numbers of the control points, denoted as serial number list List2.
[0049] A list for storing distances is established, denoted as distance list List3; and a list for storing the farthest distance is established, denoted as list List4;
[0050] S2: First iteration subdivision: take the first and last two nodes in the node list, denoted as starting point A1 and ending point B1, form a straight line L 1, and store the serial numbers of the two nodes in the serial number list List2, at this time the number of elements in the serial number list List2 is 2.
[0051] S3: Traverse the node list List1 to find the node P1 farthest from the straight line L 1, as Figure 3The serial number of node P1 is stored in serial number list List2, and the farthest distance L 1 is output to list List4.
[0052] In this embodiment, the distance L 1 is 35.52 m.
[0053] S4: It is judged that the farthest distance L 1 is greater than ε, and the number of elements in serial number list List2 is 3, which is less than the set control point number N, so the second iteration subdivision is performed.
[0054] S5: Second iteration subdivision: the node list List1 in step S1 is divided into two parts by node P1, including a sub-list List 11 composed of nodes on the left side of node P1 and a sub-list List 12 composed of nodes on the right side of node P1. As Figure 4 shown, straight lines P1A1 and P1B1 are formed by connecting node P1 and starting point A1 and ending point B1 respectively, the node P 11 in sub-list List 2,1 farthest from straight line P1A1 is found, and the distance is recorded as L 21 ; the node P 12 in list List 2,2 farthest from straight line P1B1 is found, and the distance is recorded as L 22 ; the distances L 21 , L 22 are compared, the larger distance is stored in list List4, the smaller distance is stored in list List3, and the serial number P 2,j of the node corresponding to the larger distance is added to serial number list List2, j=1 or 2.
[0055] In this embodiment, it can be known that Figure 4 there is only one node in sub-list List 11 , and the node is located on straight line P1A1, so the distance L 21 is 0. There are 5 nodes in sub-list List 12 , and it is found that the node farthest from straight line P1B1 is P 2,2 , and the distance L 22 is 18.51 m.
[0056] S6: It is judged that the farthest distance L 22 is greater than ε, and the number of elements in serial number list List2 is 4, which is less than the set control point number N, so the third iteration subdivision is performed.
[0057] S7: Third iteration subdivision: the node list List1 in step S6 is divided into two parts by node P2,2 The child node list List in step S5 12 It is divided into two parts, including the node P 2,2 The sublist List composed of the nodes on the left 21 and by node P 2,2 The sublist List composed of the nodes on the right 22 .
[0058] like Figure 5 As shown, connect nodes P respectively 2,2 and child node list List 12 The starting point P1 and the end point B1 form a straight line P 2,2 P1 and P 2,2 B1. Find the sublist List 21 Middle distance straight line P 2,2 P1 is the farthest node P 3,1 , the distance is recorded as L 31 ; Find the list List 22 Middle distance straight line P 2,2 B1's farthest node P 3,2 , the distance is recorded as L 32 ; Compare distance L 31 、L 32 , 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.
[0059] In this embodiment, Figure 5 It can be seen that the sublist List 21 There are 2 nodes, but both are located on the line P1A1, so the distance L 31 0. Sublist List 22 There are 2 nodes in the equation, and the node farthest from the line P1B1 is P 3,2 , distance L 32 It is 13.99m.
[0060] S8: The longest distance determined L 22 Greater than ε, at this time the number of elements in the serial list List2 is 5, which is equal to the set number of control points N, and the segmentation is completed.
[0061] Figure 6 1 is a schematic diagram of a closed curve after smoothing using the Douglas method with a specified number of control points in this embodiment. The number of control points of the curve is 5, which is the same as the number of control points on the original mesh boundary.
[0062] In this embodiment, the sublist List 11The nodes in are on the line P1A1, so the distance L 21 is 0, and the distance L 32 Obviously not 0, natural L 32 Greater than L 21 In other embodiments, if in the last iterative subdivision process, the sublist List corresponding to the smaller distance (i-1)j There are nodes that are not located on the corresponding line P i-1,j A i-1 Then the smaller distance L (i-1)j If it is not 0, then in the next iterative subdivision process, the distance L is calculated. i1 、L i2 Afterwards, the larger distance is compared twice with all the distance values in List3. The larger distance obtained from the second comparison is stored in List4, and the node number corresponding to the larger distance is added to List2. The smaller distance obtained from the second comparison is stored in List3, and the original largest distance value in List3, which was moved to List4 in this comparison, is removed. Only in this way can we ensure that the node stored in List2 during each iterative process is the node with the largest curvature and the most convex among the remaining nodes. In other words, when the number of control points is fixed, the node connection is smoother. i is a positive integer greater than or equal to 2, and j = 1 or 2.
[0063] 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 method for optimizing the Douglas decomposition of a curve by controlling the number of points, characterized in that: The following steps are included: S1: Get the node information of the selected curve, organize all the node information into an ordered list, record it as node list List1, including the node sequence number and coordinate value; Set the number of control points N and 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; S2: First iterative segmentation: S2.1: Take the first and last two nodes in the node 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 two serial numbers in the serial number list List2; S2.2: Traverse the node 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; S2.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; S2.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: S3.1: Split the node 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 list List 11 The node P that is farthest from the line P1A1 2,1 , the distance is recorded as L 21 ; Find the list 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; S3.2: Determine whether the maximum 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 iterative subdivision; …… S4: 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 sequence list List2 is equal to the set number of control points N, and the subdivision is completed.
2. The method for optimizing the Douglas decomposition of a curve by the number of control points according to claim 1, characterized in that: The number N of control points is a positive integer greater than or equal to 1.
3. The method for optimizing the Douglas decomposition of a curve by the number of control points according to claim 2, 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.
Citation Information
Patent Citations
Multi-scale Bezier curve segmentation fitting method for vector line elements
CN108389243A
Fitting method based on cubic spline and curve fitting device
CN113554670A