home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / graphuti / polyops.zip / POLYOPS.DOC < prev    next >
Text File  |  1993-08-06  |  4KB  |  71 lines

  1.                                POLYOPS
  2.  
  3.      This program calculates the intersection, union or difference of two
  4.      plane regions bounded by polygonal simple closed curves, using the
  5.      algorithms described by Margarit and Knott, Comput. & Graphics, v.13,
  6.      nunber 2, 1989. Data may be input graphically, from data files, or from
  7.      the keyboard, and the results may be displayed graphically or listed to
  8.      the screen or to a disk file. Source code is included; some of thee
  9.      supporting routines use special features of Turbo C, but the main
  10.      algorithm, polycalc.c, should be acceptable to any ANSI C compiler.
  11.  
  12.      POLYOPS requires an IBM PC compatible computer with 640K RAM, and an
  13.      EGA/VGA graphics board with 256K memory.
  14.  
  15.      Keyboard input is made in response to more or less self-explanatory
  16.      prompts; the numbers entered must be separated by spaces, commas, or
  17.      other non-numeric characters, but there is little restriction on format;
  18.      e.g., (x0,y0), (x1,y1),...  or x0,y0; x1,y1;... or  x0 y0 x1 y1... or
  19.      any combination of these is acceptable.
  20.  
  21.      The demonstration program assumes that all input polygons lie in the
  22.      region [0,1]x[0,1], and any data files used should be normalized to
  23.      these limits. A data file should be an ASCII file containing the number
  24.      of vertices of the polygon A, all the x-coordinates of these vertices,
  25.      then all the y-coordinates, followed by the same information for B. The
  26.      file POLY.DAT contains 16 more or less random examples, which are named
  27.      "pdat1" ... "pdat16". These names may be used directly, since the demo
  28.      program automatically searches POLY.DAT if a file name starting 'pdat'
  29.      is given.
  30.  
  31.      Input from the graphics screen is a little more complicated. The cursor
  32.      may be moved with the arrow keys or diagonally by PgUp, PgDn, End, Home.
  33.      The amount of movement is normally 10 screen pixels, but this may be
  34.      increased or decreased with the +/- keys. Increments of 1, 10, or 100
  35.      pixels are available. The current cursor position is marked as a vertex by
  36.      pressing Ins, which will also result in a line being drawn to this vertex
  37.      from the previous one, if any. Entry of a polygon is completed by pressing
  38.      Enter, which also closes up the figure, joining the final vertex to the 
  39.      initial one (thus it is not necessary to move the cursor to the starting
  40.      point to finish the polygon). If the program detects an active mouse
  41.      driver, you may use the mouse for entry if desired, using the left button
  42.      to mark points and the right button to close up the polygon. (Mouse entry
  43.      is usually faster but not as accurate.) During the entry process, pressing
  44.      Del will delete the last vertex drawn (and erase the side to it), and Esc
  45.      will abort the whole entry process. The current cursor coordinates
  46.      (scaled to the range [0,1]) are displayed in the lower right of the screen.
  47.      These are only approximate values, so text or file entry should be used
  48.      if specific polygons are needed.
  49.  
  50.      Output curves are of two types, 'island' and 'hole'. The names indicate
  51.      the function rather clearly. In the graphics display, islands are yellow,
  52.      holes are blue.
  53.  
  54.      The output curve data files are text files which include the number of
  55.      curves and the type (island or hole) of each. Their vertices are in 
  56.      floating point form (4 decimals in disk files, 1 decimal on the screen).
  57.  
  58.      Little checking of input is done; all entry processes allow unacceptable
  59.      "polygons" to be input. The program will reject polygons which are not
  60.      simple (i.e., with repeated vertices or crossing sides), but most likely
  61.      will give erroneous results, or none at all, if the input polygons are
  62.      irregular in some other way.
  63.  
  64.      The files listobjs and listlibs may be used in linking the necessary
  65.      modules and libraries.
  66.  
  67.  
  68.      Questions or comments should be sent to B. J. Ball, 3304 Glen Rose Drive,
  69.      Austin, Texas, 78731 (Compuserve 71141,2321).
  70.  
  71.