Alternately, assuming a smoothish/continuous surface

  1. take the gradient (dz/dx,dz/dy)
  2. find (x,y) for local minima and maxima (slopes=0)
  3. work your way up or down your particular valley or hill, and things that are approximately the same height (within your bands, or whatever) will be connected as a contour band; work clockwise around the min/max
  4. look for intersections with the bands from other minima or maxima, and possibly join bands when necessary

Not sure how well this will work... and I cannot immediately see whether or not your triangle data set will help. Are the triangles all supposed to be in the same contour band, or are those just surface polygons which could be all over, height-wise?

edit: http://www.innovativegis.com/basis/mapanalysis/topic11/topic11.htm gives some interesting surfaces for GIS-based data, so some of the details there might help, since I started thinking about hills and valleys. (and the google:how to distinguish mountain or valley or saddle in 3d surface data that found that, which has some other interesting links)


In reply to Re: Contour mapping? by pryrt
in thread Contour mapping? by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.