Tracing contours between triangles may be an inefficient process, since triangles that span multiple elevation levels will have to be processed multiple times. It may be more efficient to process all the contour segments for each triangle, then process those segments into buckets (for lack of a better term) for later processing. Optimization would likely involve a pre-sort of the triangles based on the lowest (bottom to top) or highest (top to bottom). Or, for even more optimization creation of the contour segments as each triangle is created.
Conrec by Bourke again
http://paulbourke.net/papers/conrec/ which dates back to 1987 advocates such a way. Once your done you still
need to unite all those line segment into polylines. It is certainly feasible, but again in view of futher processing I strongly believe that we should
setup the triangulation in a way that permits us to traverse the TIN efficiently, be it for contour profile or anything else.
Whether we use a DCEL, a Winged Edge or a Quad edge (See Wikipedia for all these), the reason we triangulate is to organize the Data that is the point list in a way that we'll make it easy to find neighbor and to find in which face any point belongs to.
The way we are doing it we are keeping coordinates for points, coordinates again for 3dface and we are destructing the most important which is the
edges list. The smart way is you keep your point with a pointer to the edge list. The edge list is only pointer to the point list. The triangle is only pointer to the edge list.
ymg