Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!masscomp!peora!tarpit!bilver!alex From: alex@bilver.uucp (Alex Matulich) Newsgroups: comp.sys.amiga.advocacy Subject: Re: Contour plotting Message-ID: <1991Feb28.173901.27728@bilver.uucp> Date: 28 Feb 91 17:39:01 GMT References: <1991Feb27.194218.12227@csun.edu> Organization: W. J. Vermillion - Winter Park, FL Lines: 55 In article <1991Feb27.194218.12227@csun.edu> bcphyagi@csunb.csun.edu (Stephen Walton) writes: >Using the demo version of this "wonderful, beautiful, powerful" program >called GRAFTOOL for MS/DOS (which has received rave reviews) I had to: >1) generate a 3-d plot of the image (1 hour) and 2) ask the program to >generate the contour plot (another hour+, I haven't had the patience to >run it to completion). This is on a _20 MHz_ 386 machine! > >To do the same thing on my good old Amiga 2000 (no FPU, 7 MHz 68000), >I malloc'ed a 512 by 512 float array and called Tony Richardson's >plcont() routine from his PLPLOT library. Total time for generating >the plot was less than 5 minutes. It is less than 1 minute on a 3000. Comparing two machines according to completely different contour algorithms tells nobody anything. As a programmer who has written contour-drawing algorithms for different purposes, I think I can shed some light on this. If you are only going to display your contour plots on a video screen, there are a LOT of things you can do to speed up the algorithm. On the other hand, if you are going to output your contours to a pen plotter, which is what I think GRAFTOOL's algorithm was designed for, things slow down considerably. For the pen-plotter algorithm, you have to design the routine to minimize the number of pen lifts and pen color changes. If you don't, a simple plot can take 4 or 5 hours to complete. This means that your algorithm must find a contour of a desired level, figure out how to trace it all around your data array, keep track of where the pen has been so the program knows when a contour closes or whether a given contour has already been drawn if there are several same-level contour lines in your data. Only one contour interval can be handled at a time, which means, if your data contains 50 contour intervals, your array will have to be scanned that many times to complete the plot. You can reasonbaly expect an efficient pen-plotter algorithm to complete a 512x512 plot in about an hour, depending on the complexity of the data and the number of contour intervals in it. This was what I observed on a 33 MHz 68030 Hewlett-Packard workstation which I was programming. A screen-only contour plot is very fast. The fastest algorithm is to simply paint each pixel on the screen using a color calculated from an interpolation of your data. This results in filled-color contours instead of line drawings. For line drawings, you can simply draw all the contours in a data cell, move to the next cell and draw all its contours, and so on (this would result in thousands of unnecessary pen lifts and moves and color changes for pen-plotter output). Take a careful look at the capabilities of your contouring programs on the Amiga and IBM compatibles. What are they designed for? I would venture that the GRAFTOOLS algorithm would take just as long if it were run on the Amiga. And your Amiga PLPLOT library would probably run in as short a time if it were ported to MSDOS. -- _ |__ Alex Matulich (alex@bilver.UUCP) /(+__> Unicorn Research Corp, 4621 N Landmark Dr, Orlando, FL 32817 //| \ UUCP: ...uunet!tarpit!bilver!alex ///__) bitnet: IN%"bilver!alex@uunet.uu.net"