Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!waikato.ac.nz!aukuni.ac.nz!pdbourke From: pdbourke@ccu1.aukuni.ac.nz (Bourke) Newsgroups: comp.graphics Subject: Re: Surface contour plotting alg. wanted Message-ID: <1991Mar28.231605.7697@ccu1.aukuni.ac.nz> Date: 28 Mar 91 23:16:05 GMT References: Organization: University of Auckland, New Zealand. Lines: 28 chrisp@bilby.cs.uwa.oz.au (Chris Pudney) writes: >G'day, >I require an algorithm for plotting the contour lines on a surface. The >surfaces are basically 2-D potential fields (f:R^2 -> R) which I would like >to depict graphically using contour lines (or perhaps I should use >greyscale/colour?) >Could you provide me with pointers to a contour plotting algorithm. Public >domain (ftp'able) source would be most desirable. If I get a large enough >response I will post a compilation of the information I receive. A few years ago I wrote an article for BYTE magazine on just such an algorithm, in fact from memory the example I used was of a potential field. I don't have the article here (it's at home somewhere along with the source code) but it appeared I think in the June/July issue in either 1987 or 1988. It was titled CONREC - A Contouring Algorithm. Briefly - it contoured any rectangular grid of points. To contour a surface described by a function one would first evaluate the function on a rectangular mesh (not necessarily a regular spaced mesh) and pass that data onto the contouring program. One of the main features of the program was that it was very efficient, ie: even version in BASIC were quite fast. Have a look in past issues of BYTE, if you can't find it I can send the code in BASIC or FORTRAN (maybe C).