How to automatically draw the same line (contour) triangle method according to the discrete point

zhaozj2021-02-08  232

The method of automatically drawing the contour can be divided into two categories, interpolation, and curve fittings. The effect of the curve is not as large as interpolation algorithm, and the effect is also more important. Interpolation algorithm.

Among them, in the interpolation algorithm, different from the way is divided into objective and triangular network. The difference is that the triangular network calculation is mainly generating a triangular network process, saving the process of interpolation to the grid point. And the objective analysis process is The discrete point is analyzed to the grid point and then inserted into the fine grid, and then mostly utilized the tracking method to generate the contour, and there is also a curve fit here.

1, triangular algorithm

A, first get a delanay triangle, this is in my post "Delaunay Triangulation", you can refer to it.

B, then need to interpolate the equivalent point on the side of the triangle. To determine if there is an equivalent point on the side of a triangle, it is necessary to perform judgment and processing. Note: If a raw data point and the equivalent line value are the same, this point changes a trace. If the value of a triangular three vertex is the same, there is no equivalent point. If a triangular arbitrary side, both endpoints (A, B], ZA, ZB) satisfy (ZD-ZA) * (ZD-ZB) <0, where the zd represents the value of the contour, the side must Have an equivalent point, its flat position is XD = Xa (XB-XA) * (ZD-ZA) / (ZD-ZA), YD = Ya (YB-YA) * (ZD-ZA) / (ZB-ZA) Each triangle is impossible to have the equivalent point of the same value on the triangle, and the equivalent point of the same value is necessary.

C, the tracking of the equivalent point.

In order to track the interpolated equivalence point sequence, the equivalence line is drawn, and the plain position relationship between the equivalence points calculated in the annular network of each other is also identified. Because each annular mesh is composed of multiple triangles, let's simply analyze the case where there is an equivalent point in a single triangle. Since there is no need to consider the equivalent line through the endpoint, if there is an equivalent point on the side of a triangle, it is only possible to exist in one two edges, and it is impossible to have three sides. That is, as long as there is an equivalent point on the side of the triangle, there will be an equivalent point in the remaining two sides. According to the above convention, we researched the equivalent line through two and two adjacent diaphragular sides of any loop network, and there may be several situations where the equivalent line does not pass through the boundary of the ring. In this ring network, there must be an equivalent point on all the radial edges. If this ring network is coupled, the interpolated equivalent point can be sequentially connected to a closed curve (Fig. 5 (a) If the ring network is coupled by the boundary point, then these equivalents are connected to a open curve (Fig. 5 (b)). 2 The contour line through the boundary of the ring network, and the number of times does not exceed twice. This is the most common situation, as shown in Figures 5 (c), 5 (d). The sequential order of the contained in the adjacent edge is arranged, at least two, the starting point is the entry point of the ring network, and the end point is the exit point of the ring network. 3 The contour line four times through the boundary of the ring network. The equivalence points in the ring network are divided into two sequential order, each of which includes an entry point and an exit point. The location of this network should be the saddle of the terrain.

转载请注明原文地址:https://www.9cbs.com/read-1763.html

New Post(0)