in reply to Re^2: Contour mapping?
in thread Contour mapping?

So, start at the highest point, follow each of edges of each of the triangles that contain that point, recursively ... to what end? Where am I going?...

I have no idea how efficent this will be; probably, the official literature will get you down a better path. However, my thought:

  1. Make a subset of all the points that are connected to the top point (directly or indirectly) that are within deltaz from the top z_t. (So you might end up going down a few triangles, but stop if any of the z are less than z_t-deltaz)
  2. sort the subset by each point's angle from z_t; example:
    $top = [$x_t,$y_t,$z_t]; # you got this from your maxima search @subset = ( [$x0,$y0,$z0], [$x1,$y1,$z1], ...); # the subset in step1 @contour = sort { atan2($a->[1] - $top->[1], $a->[0] - $top->[0]) <=> atan2($b->[1] - $top->[1], $b->[0] - $top->[0]) } @subset;
  3. that sorted list is now the contour line -- every point in that list is within the same height band, and it is sorted such that you could draw a counterclockwise line through those points as your "contour", or calculate other angles as needed along the same contour.