Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any "Geometry Contour Line Algorithm"?

I want to find & draw contour lines like this.

Data is just List of (x,y,z) and only a few points (about 40~60) in there. (x and y are position and z is height)

How can i find this contour line and point?

like image 732
JaeWoo So Avatar asked Dec 04 '25 07:12

JaeWoo So


1 Answers

As a first approximation, you can admit that your function is piecewise planar over a triangulation of the data points.

The Delaunay triangulation technique can be used, but in this case, given the regular polar arrangement, I guess that a simple rule based on the polar arguments could do.

Interpolating inside the triangles and obtaining the horizontal sections is a simple matter. Unfortunately, this will produce a gross approximation and you will probably notice artifacts due to the coarseness of the polylines.

A possible cure is to smooth the polylines as a postprocessing step, for instance turning them to polyBeziers.

Another method, which I prefer, is to use a higher order interpolation method. For C1 continuity, you can compute estimates of the gradient at the given points and fit quadratic functions on the triangles. Then subdivide the triangles in sub-triangles, interpolate the function at the sub-vertices, and switch to the planar model in these sub-triangles.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!