Method for optimizing curve Douglas subdivision through number of control points

The method of optimizing curve Douglas segmentation through the number of control points solves the problem of grid matching failure caused by redundant control points, achieves precise limits on the number of control points and maintains curve characteristics, and improves the efficiency of numerical simulation.

CN119337663AActive Publication Date: 2025-01-21HOHAI UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411372526.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-21
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

During the three-dimensional grid generation process of numerical simulation of earth and rock dams, the number of control points of closed polylines is redundant and cannot match the grid, resulting in the matching failure.

Method used

The curve Douglas subdivision method is optimized through the number of control points. The number of control points N is specified, and redundant control points are deleted through the iterative subdivision process to make them equal to the number of grid boundary control points.

Benefits of technology

It achieves precise limitation of the number of control points, keeps the curve characteristics intact, simplifies calculations, facilitates the matching of curve control points and grid boundary control points, and improves the efficiency of numerical simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337663A_ABST
    Figure CN119337663A_ABST
Patent Text Reader

Abstract

The invention discloses a method for optimizing curve Douglas subdivision through the number of control points, and the method comprises the steps: S1, selecting node information of a selected curve, forming an ordered list through all the node information, and recording the ordered list as a node list List1; setting the number N of control points and a smooth threshold value epsilon; s2, taking a head node and a tail node in the node list, recording the head node and the tail node as a starting point A1 and an end point B1, connecting the two nodes to form a straight line L1, and storing serial numbers of the two nodes in a serial number list List2; traversing the node list List1, and finding out a node P1 farthest from the straight line L1; judging whether the farthest distance L1 is greater than a set smooth threshold value epsilon or not, and judging whether the number of elements in the serial number list is equal to the set number N of the control points or not; the number of elements in the serial number List2 is equal to N after multiple iterations. According to the scheme, the number of the control points of the closed polyline curve can be accurately limited to be equal to the number N of the control points specified in advance while the curve trend and the overall structure and characteristics are kept, and convenience is provided for subsequent mesh generation and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of grid partitioning, and in particular relates to a method for optimizing curve Douglas partitioning by controlling the number of points. 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 process of three-dimensional mesh generation for numerical simulation of earth-rock dam, it is necessary to match the actual contour closed polyline of the project with the basic mesh surface as the top and bottom surfaces, so as to realize the projection of the grid point coordinates into the polyline, and further insert the generated mesh body between the two. This requires that the control points of the closed polyline have the same number as the control points in the mesh surface.

[0004] In the actual simulation process, due to the characteristics of the engineering building contour, closed polylines often contain redundant control points, which makes it impossible to match the grid successfully. At present, the original Douglas method only selects all control points that control the curve direction characteristics within the smoothing threshold range, but cannot specify their number, which often leads to redundant control points and matching failure. Therefore, how to specify the number of control points in the Douglas smoothing method is a major difficulty in the engineering field. Summary of the invention

[0005] The purpose of the present invention is to provide a method for improving the Douglas decomposition of a curve by specifying the number of control points. In order to accurately limit the number of control points and maintain the curve characteristics, redundant control points are deleted to simplify the calculation, which facilitates subsequent curve control point matching and mesh decomposition.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions: A method for optimizing Douglas decomposition of a curve by controlling the number of points, characterized in that it comprises the following steps: S1: Get the node information of the selected curve, and organize all the node information into an ordered list, recorded 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 iteration segmentation: S2.1: Take the first and last two nodes in the node list and record them as the starting point A1 and end point B 1 , 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 P 1 , the node P 1 The serial number is stored in the serial number list List2, and the farthest distance L 1 Save to list List4; S2.3: Determine the maximum distance L 1 Is it 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 yes, stop the segmentation; If not, perform the second iteration of segmentation; S3: Second iteration of segmentation: S3.1: Through node P 1 The node list List in step S1 1 It is divided into two parts, including the node P 1 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 list 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 list 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; S3.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; … 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 segmentation is completed.

[0007] Further optimization, the number N of control points is a positive integer greater than or equal to 1.

[0008] Further optimization, the i-th iterative subdivision process 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 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.

[0009] Compared with the prior art, the present invention has the following beneficial effects: 1. The scheme of the present invention can accurately limit the number of control points of the closed polyline curve to be equal to the previously specified number of control points N while maintaining the curve direction and overall structure and characteristics. In actual engineering applications, N is the number of control points of the known grid boundary, which is obtained by the built-in function of the software, thereby further facilitating the one-to-one matching of the closed polyline control points with the grid boundary control points, and using the shape function to project the points in the grid into the polyline, providing convenience for subsequent grid subdivision, etc.

[0010] 2. Based on the original Douglas smoothing method, this method adds only one farthest point as a control node in each subdivision cycle, so that the number of control points gradually approaches the set value N, and finally accurately satisfies the actual number of control points equal to N. Therefore, only some nodes in the original curve node list are selected, redundant control points are deleted, and the efficiency of numerical simulation is improved, which provides a valuable reference for future numerical modeling. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is a flow chart of a method for optimizing Douglas decomposition of a curve by controlling the number of points of the present invention; Figure 2 It is a schematic diagram of a closed curve and a known grid before segmentation using the improved Douglas method in an embodiment; Figure 3 Schematic diagram of the first iterative partitioning in the embodiment; Figure 4 Schematic diagram of the second iterative partitioning in the embodiment; Figure 5 Schematic diagram of the third iterative subdivision in the embodiment; Figure 6 Schematic diagram of a closed curve after smoothing by the Douglas method with a specified number of control points in an embodiment. DETAILED DESCRIPTION

[0012] 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.

[0013] like Figure 1 As shown, a method for optimizing Douglas decomposition of a curve by controlling the number of points comprises the following steps: S1: The two-dimensional mesh division of the bottom surface of the known three-dimensional model of the earth-rock dam is completed, and the bottom surface mesh node information of the three-dimensional model of the earth-rock dam is obtained through the built-in function of the software.

[0014] Figure 2 The diagram of the closed curve and known grid before using the improved Douglas method in this embodiment. The closed curve is the contour line of a horizontal surface of the earth-rock dam. After completing the control point simplification of this algorithm, it is necessary to correspond the grid boundary control points to the closed curve control points one by one, and project the grid into the closed curve. The gray closed curve has a total of 9 nodes, and there are 5 nodes on the grid boundary. All node information of the closed curve is organized into an ordered list, recorded as node list List1, including the node serial number and coordinate value. The nodes in node list List1 are arranged in order from the first to the last according to the serial number.

[0015] Select one of the grids and set the number of control points N and the smoothing threshold ε according to the number of nodes in the grid.

[0016] In this embodiment, N is set to 5 and ε is

[0017] Create an empty list to store the control point serial numbers, and record this list as serial number list List2.

[0018] 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 partitioning: Take the first and last two nodes in the node list and record them as the starting point A 1 and end point B 1 , connect these two nodes to form a straight line L 1 , and store the two serial numbers in the serial number list List2. At this time, the number of elements in the serial number list List2 is 2.

[0019] S3: Traverse the node list List1 and find the distance line L 1 The farthest node P1 ,like Figure 3 As shown, the node P 1 The serial number is stored in the serial number list List2, and the farthest distance L 1 Save to list List4.

[0020] In this embodiment, the distance L 1 It is 35.52m.

[0021] S4: The longest distance determined L 1 If it is greater than ε, the number of elements in the serial list List2 is 3, which is less than the set number of control points N, then a second iterative subdivision is performed.

[0022] S5: Second iterative subdivision: passing through node P 1 The node list List in step S1 1 It is divided into two parts, including the node P 1 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 .like Figure 4 As shown, the nodes P are connected 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 list 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.

[0023] In this embodiment, Figure 4 It can be seen that the sublist List 11 There is only one node in the line P. 1A 1 So the distance L 21 Is 0. Sublist List 12 There are 5 nodes in the distance line P. 1 B 1 The farthest node is P 2,2 , distance L 22 It is 18.51m.

[0024] S6: The longest distance determined L 22 If it is greater than ε, the number of elements in the serial list List2 is 4, which is less than the set number of control points N, then the third iterative subdivision is performed.

[0025] S7: The third iteration: passing through node P 2,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 consisting of the nodes on the left 21 and by node P 2,2 The nodes on the right are the sublist List 22 .

[0026] like Figure 5 As shown, the nodes P are connected respectively 2,2 and child node list List 12 The starting point P 1 and end point B 1 , forming a straight line P 2,2 P 1 and P 2,2 B 1 . Find the sublist List 21 Middle distance straight line P 2,2 P 1 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 B 1 The 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.

[0027] In this embodiment, Figure 5 It can be seen that the sublist List 21There are 2 nodes, but both are located on the straight line P 1 A 1 So the distance L 31 Is 0. Sublist List 22 There are 2 nodes in the distance line P. 1 B 1 The farthest node is P 3,2 , distance L 32 It is 13.99m.

[0028] 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.

[0029] Figure 6 Schematic diagram of a closed curve after smoothing by 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 of the original mesh boundary.

[0030] In this embodiment, the sublist List 11 The nodes in the line P 1 A 1 So the distance L 21 is 0, and the distance L 32 Obviously not 0, naturally L 32 Greater than L 21 In other embodiments, if in the previous 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 is not 0, then in the next iterative subdivision process, find the distance L i1 , L i2 After that, it is necessary to make a second comparison between the larger one and all the distance values ​​in List3, 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 move it to List4 in this comparison. Only in this way can we ensure that the nodes stored in List2 in each iterative subdivision process are the nodes with the largest curvature and the most convex among the remaining nodes, that is, when the number of control points is certain, the points that make the connection lines of the nodes smoother. i is a positive integer greater than or equal to 2, j=1 or 2.

[0031] 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 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, and organize all the node information into an ordered list, recorded 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 iteration segmentation: S2.1: Take the first and last two nodes in the node list, record them as the starting point A1 and the 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 1The 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 yes, stop the segmentation; If not, perform the second iteration of segmentation; S3: Second iteration of segmentation: S3.1: Divide the node list List1 in step S1 into two parts through node P1, including a sublist List consisting of nodes on the left side of node P1 11 and a sublist List consisting of the nodes to the right of node P1 12 ; Connect the node P1 with the starting point A1 and the end point B1 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 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; …… 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 segmentation 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 Douglas decomposition of a curve by controlling the number of control points according to claim 2, characterized in that: The i-th iteration partitioning process 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 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.

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

  • Rough opening fracture grid generation method adopting improved parting iteration method

    CN116756788A

  • Method and device for extracting curved line

    JP1993314268A

  • System and method for automatically fitting a B-spline curve to a set of data points

    US5566288A