contour plot

Feb 24, 2016 at 4:05 AM
Any one suggest how to include contour plotting in triangle.net
Coordinator
Feb 24, 2016 at 1:51 PM
Edited Feb 24, 2016 at 1:58 PM
So, you got a mesh and discrete function values associated to each node?

1) You need a routine that computes the requested contour levels.
2) You probably want to display the contour lines as an overlay.

Both is not implemented in Triangle.NET. 2) is planned, 1) will definitely not be part of Triangle.NET.

Did you have a look at CONREC (http://paulbourke.net/papers/conrec/)? Here's what you do:
foreach triangle
   foreach edge of triangle
      foreach requested contour level
         let a = edge endpoint 1
         let b = edge endpoint 2
         if (a.z <= level <= b.z) or (b.z <= level <= a.z)
            report contour level segment
There are a couple of cases you will have to distinguish. Have a look at the CONREC page (and the code) for details.

The contour level segments will be reported in no specific order. If you need the levels to be connected, you'll have to post-process the segments.