javacontoursplines

Contour lines drawing in Java with a given Delaunay triangulation


I'm currently working on my master's thesis where I get:

My task is to use this triangulation and make contour lines at given z values. I have been nearly successful at doing this by implementing the wikipedia spline interpolation : https://en.wikipedia.org/wiki/Spline_interpolation

My problem is that I get contour lines crossing each other when implementing the splines while of course the linear drawings doesn't cross.

Parametric cubic spline interpolated contour lines

If you look at the bottom part of the screen you see two contour lines crossing, I don't have enough reputation points to show that the linear drawings doesn't. You can also see that from point to point that the edges are way too rounded. What I've tried is to interpolate more points between any pair of points to make more knot points along the lines, this to restrict them further, but to get non-crossing lines the splines look too much like a linear drawing which isn't satisfactory to the eye.

What I'd like to know, is not actual code implementation of the how, but maybe a pointer to how, readings and so forth. (NB, I'm going to make this from scratch, no libraries).

Question: How to make a higher degree polynomial function which doesn't curve too much outside its linear counterpart. By too much I mean that a given contour at let's say 50 meters, that it doesn't cross a contour at 60 meters.

Any help is highly appreciated.


Solution

  • You can try a weighted delaunay triangulation. It's defined as the euklidian distance minus the weight.