tcpMDT
[PRO] interpolate contour lines - MDT25
6.14 [PRO] Interpolate Contour Lines
![]()
This option has been implemented in order to interpolate a certain number of contour lines between two given contours without needing the digital model.
The program will execute the algorithm previously set in the program configuration (see Contours Lines section in the Customization Manual).
The command has the possibility of interpolating between complete contour lines or by selecting the initial and final points of each of the original contour lines in order to interpolate partially. The following message is shown:
Select /Vertices:
If a polyline is selected directly, it is understood that one wishes to interpolate complete contours. If the second option is chosen, four control points are requested.
The graphic below shows an example of this command in use:
Before executing the command:
After interpolation:
A brief description of the two algorithms employed is given below.
Vertex Matching Algorithm
This algorithm is relatively simple and consists of the following steps:
1. Select the first vertex of every two contours.
2. Calculate the distance that joins them and create a point belonging to the initial contour line(s) (linear interpolation).
3. Determine the least distance from a vertex on a contour line to another contour line. The following step are used to do this:
a) Start from the current points on both contour lines.
b) The distance from the next point on contour line 1 to the same point on contour line 2 is calculated. Then the distance from the next point on contour line 2 to the same point on contour line 1 is calculated. Finally, distance between the next points on contour line 1 and contour line 2 are calculated. In other words, three distances are calculated.
c) A decision is made on which of the three distances is smallest. This distance will determine whether the advance occurs on the vertices of contour line 1, contour line 2 or both in this step.
4. After determining the advance, the process is repeated from point 2 with the two new vertices selected until the last vertex of both polylines is reached.
Triangulation Algorithm
This algorithm consists of the following steps:
1. Extract from the initial and final contour lines all vertices.
2. Generate a triangulation with all the vertices, considering as break lines all segments which form the contour lines and the polygon formed by these and the lines that join their ends as the boundary.
3. Contour line generation corresponding to this triangulation with the equidistance desired.