[alt.sources] graph3d, part 3/3

michel@es.ele.tue.nl (& Berkelaar) (10/13/89)

And this is the last part:

---------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# If this archive is complete, you will see the following message at the end:
#		"End of archive 3 (of 3)."
#
# Contents:
#   graph3d-tek.man graph3d.man hat.man hills.man pswrap.man
#   surface.man
#
# Wrapped by tap@cs.utoronto.ca on Wed Oct 11 23:48:19 1989
#
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f graph3d-tek.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"graph3d-tek.man\"
else
echo shar: Extracting \"graph3d-tek.man\" \(4966 characters\)
sed "s/^X//" >graph3d-tek.man <<'END_OF_graph3d-tek.man'
X.TH GRAPH3D-TEK 3D "30 September 1989"
X.SH NAME
Xgraph3d-tek \- a filter makes a perspective projection of a 3-d polygons onto a 2-d plane
X.SH SYNOPSIS
X.B graph3d ...
X.SH DESCRIPTION
X.B Graph3d-tek
Xis a version of \fIgraph3d\fP that is designed to display 3D
Xgraphics in a window in the X window system with a minimum
Xof fuss.
X.B Graph3d-tek
Xis a filter which takes a set of 3-d polygons as input, and
Xperforms a perspective projection onto a plane.  The output
Xproduced can be displayed directly on a Tektronics 4014
Xdisplay device, provided that the options
X.BR -ps or -graph are
Xnot given.
X.LP
X\fIGraph3d-tek\fP will
Xattempt to find where you have a xterm running in
Xtektronics mode.  It does not do this in any particularly
Xintelligent way, it just looks in several places to find if
Xyou have left the name of tty device file and machine of the
Xxterm running in tektronics mode.  It looks in the following
Xthree places, in the given order.  In the example, suppose
Xan xterm has been openned on a machine called
X``ephemeral'' and suppose that it has tty device /dev/ttypb.
X.LP
X(1) The command line - the machine and tty device can be
Xspecified on the command line with the \fI-tty\fP option.
XThe following specifications are all legal, but the first will
Xonly work if we run the command on the machine ``ephemeral''.
X.nf
Xgraph3d-tek -tty pb
Xgraph3d-tek -tty ephemeral:pb
Xgraph3d-tek -tty ephemeral:ttypb
Xgraph3d-tek -tty ephemeral:/dev/ttypb
X.fi
X.LP
X(2) The environment - the machine and tty device can be
Xspecified in the environment in the variable \fI$TEK_TTY\fP.
XThe following are legal contents for that environment
Xvariable: \fIpb\fP, \fIephemeral:pb\fP,
X\fPephemeral:ttypb\fP, \fIephemeral:/dev/ttypb\fP.
X.LP
X(3) The file \fI$HOME/.tek-tty\fP - the machine and tty
Xdevice can be given in this file in the same format as
Xabove.
X.LP
XIf the option \fI-forcetty\fP is not given the program will
Xendeavour to verify that the owner of the file it is writing
Xto is the same as the person running the program.  If not,
Xit will exit.  This is intended to avoid the antisocial
Xconsequences of writing to out of date tty devices specified
Xin an old \fI$HOME/.tek-tty\fP file.
X.LP
XIf you are using X you can
Xset up your csh so that it keeps the name of the current
Xtektronics window in the file \fI$HOME/.tek-tty\fP.
X.LP
XTo do so, insert the following lines in your .cshrc.  This
Xwill store the name of tty device of the most recently
Xopenned tektronics window in the file \fI$HOME/.tek-tty\fP.
XThere is a little problem with this - if the tektronics
Xwindow goes away, this file doesn't go away.  This nuiscance
Xvalue of this problem is reduced by the fact that
Xgraph3d-tek checks who owns the tty device that
X\fI$HOME/.tek-tty\fP specifies.
X.nf
X# if this is a tek4014 window,
X# create a file with the tty name in it
X#
Xif ($?prompt && ($term == tek4014)) then
X  echo `hostname`:`tty` > ~/.tek-tty
Xendif
X.fi
X.LP
XInsert the following line in your .login file.  This makes
Xsure that the file ``.tek-tty'' doesn't specify any
XTektronics windows from the last session.
X.nf
Xrm -f ~/.tek-tty
X.fi
X.LP
XThe \fIgraph3d-tek\fP program is otherwise identical to
X.B graph3d,
Xthe only difference being that it was compiled with the
Xlibaray flag -l4014 instead of -lplot.
X.SH OPTIONS
X.IP \fB-forcetty\fP
XOverride checking the ownership of the output file.  With
Xthis option specified it is possible to write to the
Xterminal devices of other users.
X.IP \fB-stdout\fP
XForce output to go to stdout.
X.IP \fB-tek\fP
XProduce output in format suitable for a tektronics 4014
Xdevice.  This flag has the same effect as the \fB-plot\fP
Xflag.  For \fIgraph3d-tek\fP this is the default output
Xformat.
X.IP "\fB-tty <hostname>:X\fP"
XSend output to file \fBX\fP on the machine \fB<hostname>\fP.
XIf \fBX\fP does not begin with ``.'', ``/'', or ``dev'' it
Xis assumed to be the abbreviated name of a tty device, e.g.
X``pb'' would be interpreted as ``/dev/ttypb''.  A name
Xbeginning with ``tty'' is assumed to be a file in ``/dev''.
XNames beginning with ``.'' or ``/'' are left unmodified.
XFor sending output to a remote machine to be successful, rsh
Xshould run csh (or some shell which takes the same commands)
Xon the remote machine.
X.LP
XAll other options are the same as for \fIgraph3d\fP.
X.SH EXAMPLE
Xhat 60 20 | surface -unit | graph3d-tek
X.LP
XPlot a hat in the tektronics window.
X.SH BUGS
XIf rsh does not run csh on remote machines, sending output
Xto remote files will not work, and some strange error
Xmessage will be returned.  This can be worked around to some
Xextent by specifying the option \fB-forcetty\fP, which will
Xresult in the rsh just trying to run the command ``cat >
X<file>'' which most shells should be able to handle.
X.SH AUTHOR
XTony Plate
X
XCopyright (C) 1989 Tony Plate
X
XThis program and documentation may be freely distributed and
Xused, provided that this copyright notice is retained
Xintact.  There is no warranty with this software.
X
X.SH SEE ALSO
Xpswrap(3d) hills(3d) surface(3d)
END_OF_graph3d-tek.man
if test 4966 -ne `wc -c <graph3d-tek.man`; then
    echo shar: \"graph3d-tek.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f graph3d.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"graph3d.man\"
else
echo shar: Extracting \"graph3d.man\" \(9446 characters\)
sed "s/^X//" >graph3d.man <<'END_OF_graph3d.man'
X.TH GRAPH3D 3D "30 September 1989"
X.SH NAME
Xgraph3d \- a filter that makes a perspective projection of a 3-d polygons onto a 2-d plane
X.SH SYNOPSIS
X.B graph3d
X.I options
X.SH DESCRIPTION
X.B Graph3d
Xis a filter which takes a set of 3-d polygons (or lines) as
Xinput, and performs a perspective projection onto a plane.
X
XOutput can be generated for
X.BR graph (1),
X.BR plot (1),
Xpostscript devices, or (by compiling with the suitable
Xlibrary), for any of the devices that
X.BR plot (1)
Xsupports (see
X.BR plot(3)).
X
XThere are various options that affect the apperance of the
Xplot.  The projection is always scaled to fill the viewport,
Xand relative scale is retained.  Hidden line removal (
X.BR -hide )
Xcan be performed, see the section below for more.  A border
Xcan be placed around the viewport (
X.BR -border ).
XA box (a cubic polygon) that contains the plot can be drawn
X(
X.BR -box ),
Xor a set of axis can be produced (
X.BR -axis ).
XA small labelled orienting axis can be produced (
X.BR -orient ),
Xit appears in the bottom right-hand corner of the viewport.
XThe graph can be scaled in any direction, and arbitrarily
Xrotated, using the
X.B -[xyz]scale
Xand
X.B -[xyz]rotate
Xoptions.  There are four options,
X.BR -left , -right ,
X.BR -front , -back ,
Xthat give the X, Y, and Z rotations an appropriate set of
Xvalues so that the origin is put at the left, right, front,
Xor back, respectively.  The origin is put at the left by
Xdefault.
X
XTwo forms of input are accepted.  One form of input
Xis in the style of the
X.B -b
Xoption of
X.BR graph (1),
Xwhere lines are lists of points terminated with a (possibly
Xblank) label.  The label, if it is not blank, is placed at
Xthe last point of the line.  The other form of input is
Xa 3d adaption of plot(5) format, and is produced by
X.BR surface (3d).
X
XText can be included in diagrams as mentioned above, i.e.
Xby attaching it to points of the diagram.  As well as
Xpositioning labels relative to the input points, labels can
Xalso be positioned relative to the viewport with a special
Xinput format for strings, which is:
X
XLABEL: <X-offset> <Y-offset> <...string...>
X
XAn offset pair of 1 1 will place the label in the bottom
Xleft-hand corner of the viewport.  Negative offsets are
Xtaken to be offsets from the other side of the viewport,
Xthus an offset pair of 1 -1 will place the label in the top
Xleft-hand corner of the viewport.  The numbers represent
Xcharacter spacing, thus an offset pair of 1 -2 will place
Xthe label just below one with an offset pair of 1 -1. Beware
Xof negative X-offsets; they must be approximately equal to
Xthe length of the string for the string not to go outside of
Xthe viewport.
X
XLabels can also be specified on the command line, e.g.  by
Xincluding the four arguments ``-label 1 1 'Figure 1' '' on
Xthe command line.  The label should be quoted if it has
Xspaces in it.
X
X.SH HIDDEN LINE REMOVAL
X.B Graph3d
Xperforms hidden line removal by z-sorting polygons, and
Xfilling them as they are drawn.
X.SS "POSTSCRIPT OUTPUT ONLY FOR HIDDEN LINE REMOVAL"
XHidden line removal is only
Xeffective with postscipt output, as neither
X.BR graph (1)
Xnor
X.BR plot (5)
Xprovide for filling polygons.  The postscript output of
X.B graph3d
Xmust be passed through
X.BR pswrap (3d)
Xbefore it can be printed (to add a prologue and epilogue).
X
X.SS "INPUT MUST BE 3 OR 4 CORNERED POLYGONS FOR HIDDEN LINE REMOVAL"
XTo do hidden line removal,
Xthe input to
X.B graph3d
Xmust be in the form of polygons with either three or four
Xcorners.  In the ascii-text style input, these are specified
Xby a line with four of five points, where the last point is
Xidentical to the first.
X
X.SS "HIDDEN LINE REMOVAL ON OUTPUT OF SURFACE(3D)"
XIf it is desired to do hidden line removal on the output of
X.BR surface (3d),
Xthe
X.B -polygon
Xoption must be given to
X.BR surface (3d),
Xas its default is to produce grid-lines, not polygons.
X
X.SH OPTIONS
XFor all of the options, an unambiguous prefix will be
Xaccepted.
X.IP \fB-2d\fP
XAccept 2 dimensional input, program functions much like
X\fIgraph\fB(1).
X.IP \fB-3d\fP
XAccept 3 dimensional input.  This is the default.
X.IP \fB-axis\fP
XProduce a set of axis.
X.IP \fB-back\fP
XSee \fB-left\fP below.
X.IP \fB-border\fP
XPut a border around the viewport.  If this option is not
Xused, an invisible border will be placed around the graph
X(i.e. four unjoined points).  This is done to prevent
Xenthusiastic programs such as \fIgraph\fP(1) from rescaling
Xin the X or Y dimension, such rescaling usually makes 3d
Xprojections very ugly.
X.IP \fB-bounds\fP
XPlace a text string that lists the x,y, and z bounds in the
Xupper left corner (label position 1 -1).
X.IP \fB-box\fP
XProduce a cubic polygon enclosing the set of points.
X.IP "\fB-focus\fP <N>"
XScale the distance of the focus from the centre of the
Xfigure.  If this distance is made too small, the resulting
Ximage will a star like apperance, and if there is bad karma,
Xa floating point exception will result.
X.IP \fB-front\fP
XSee \fB-left\fP below.
X.IP \fB-graph\fP
XProduce output suitable for display using
X.IP \fB-help\fP
XPrint out all the options with short descriptions.
X.IP \fB-hide\fP
XDo hidden line removal.  This is implemented by Z-sorting,
Xand will fail for some shapes, but performs correctly for
Xcontinuous surfaces, such as those produced by
X.BR surface (3d).
X.IP "\fB-label\fP <X> <Y> <string>"
Xputs <string> at the position X Y in the view co-ordinates.
XIf <string> has any spaces or shell meta-characters in, it
Xmust be quoted.
XThis is an alternate way of specifying labels, there is a fuller
Xdiscussion of labels and positioning above.
X.IP "\fB-left -front -right -back\fP"
XSet the rotations so that the origin is in that position,
Xand the Z-axis is vertical.  These options correspond to the
Xrotations (-65,0,30), (-65,0,-30), (-65,0,-150), and
X(-65,0,150), respectively.
X.IP \fB-noerase\fP
XDon't erase the screen.  Only used for plot style output.
X.IP \fB-noinvisibleborder\fP
XDon't delimit the viewport with four unjoined points.
X.IP \fB-orient\fP
XProduce a small labelled set of axis in the bottom right
Xhand corner of the viewport.
X.IP "\fB-plane\fP <N>"
XScale the distance of the projection plane from the
Xprojection focus.  If zero is the number supplied, a
Xparallel projection is performed instead of a perspective
Xprojection.
X.IP \fB-plot\fP
XProduce output in
X.BR plot (5)
Xformat, or for one of the devices listed in plot(3), depending
Xupon which library was used in the compilation.  For example,
Xif
X.B graph3d
Xis compiled with the -lplotimagen library, it will, given
Xthe -plot flag, produce output which can be sent directly to
Xan imagen printer.  There is another version of this
Xprogram, \fIgraph3d-tek\fP, which is compiled with the
X-l4014 flag, its output can be send to a device which
Xunderstands tektronics 4014 graphics format, such as xterm
Xin tektronics mode.
X.IP "\fB-plot_scale\fP <N>"
XProduce output in
X.BR plot (5)
Xformat and set the size of the box
Xoutput falls within.  The default is 3120 square.
X.IP \fB-ps\fP
XProduce postscript output.  This output must have a header
Xand trailer attached before it can be printed.  The output
Xis integer valued, in a box of size 10000.  The size of the
Xbox can be altered using the
X.B -ps_scale
Xoption.
X.BR graph (1).
X.IP "\fB-ps_scale\fP <N>"
XChange the size of the box that postscript output falls within.
XThe default is 10000 square.
X.IP "\fB-q1 -q2 -q3 -q4\fP"
XPut the graph in the appropriate quadrant of the output.
XThis is useful for displaying up to four graphs
Xsimulataneously on a graphics device, but the \fB-noerase\fP
Xoptions must be used for all but the first graph displayed.
X.IP \fB-right\fP
XSee \fB-left\fP above.
X.IP \fBshow-rotations\fP
XPrint out the rotations that will used, and do nothing else.
XThis is useful for finding out the defaults in order to make
Xsmall adjustments.
X.IP "\fB-xfraction|-yfraction F\fP"
XUse fraction \fBF\fP of the viewport in the specified
Xdimension.
X.IP "\fB-xlow|-ylow P\fP"
XUse only the viewport region above the value \fBP\fP
X(between 0 and 1) in the specified dimension.
X.IP "\fB-xrotation|-yrotation|-zrotation\fP R"
XSet the rotation about the specified axis to be \fBR\fP
Xdegrees.
X.IP "\fB-xscale|-yscale|-zscale\fP S"
XScale the plot by a factor of S along the specified
Xdimension.
X.SH EXAMPLES
X.LP
XThe program \fIhat\fP generated test data in the form of a
X``mexican hat''.
X.LP
X.nf
X\fBhat 30 20 | surface -poly | graph3d -plot -border -zscale 15
X-left -zrot 45 | plot -T4014 > /dev/\fP\fItty??\fP
X.LP
XPlot a hat as a three-dimensional surface and display the
Xresult on a Tektronics 4014 console (substitute the appriate
Xdevice name for /dev/tty??, discover this by typing the
Xcommand \fBtty\fP in the tektronics window), with a border
Xaround the diagram.  The z axis is scaled by a factor of 15,
Xmaking it much taller, and the figure is rotated 45 degrees
Xaround the z axis.
X.LP
X.nf
X\fBhat 60 20 | surface -poly | graph3d -ps -box -border -hide -orient | pswrap | lpr -Pps\fP
X.LP
XPlot a hat as a three-dimensional surface and display the
Xresult on the laserwriter, with hidden line removal, with a
Xsquare border around the graph, with a small orienting axis,
Xand with the frame of the cubic polygon enclosing the graph.
X
X.SH AUTHOR
XTony Plate
X
XCopyright (C) 1989 Tony Plate
X
XThis program and documentations may be freely distributed
Xand used, provided that this copyright notice is retained
Xintact.  There is no warranty with this software.
X
X.SH SEE ALSO
Xgraph(1) pswrap(3d) graph3d-tek(3d) hills(3d) plot(1) plot(5) surface(3d)
END_OF_graph3d.man
if test 9446 -ne `wc -c <graph3d.man`; then
    echo shar: \"graph3d.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f hat.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"hat.man\"
else
echo shar: Extracting \"hat.man\" \(1054 characters\)
sed "s/^X//" >hat.man <<'END_OF_hat.man'
X.TH HAT 3D "30 September 1989"
X.SH NAME
Xhat \- generate test data for graph3d
X.SH SYNOPSIS
X.B hat
X.I <grid-points> <radius>
X.SH DESCRIPTION
X.B Hat
Xproduces a surface which looks like a hat.  This is good
X.BR graph3d (3d).
XThe surface is a
X.B N
Xby
X.B N
Xgrid, there will be
X.B n
Xhills, of height
X.B h
X(default 6), and
X.B seed
X(default pid) can
Xbe used to initialize the random number generator.
X
XThe output of
X.B hills
Xis an example the type of input that
X.BR surface (3d)
Xcan accept, and provides useful test-data for
Xplaying with
X.BR graph3d (3d).
X.SH EXAMPLE
X.nf
X\fBhat 60 20 | surface -unit | graph3d-tek
Xhat 60 20 | surface -unit -poly | graph3d -ps -hide | pswrap | lpr -Pps
Xhat 60 20 | surface -unit | graph3d -plot | \fP\fI<your favourite plot(1) filter>\fP
X.fi
X.SH AUTHOR
XTony Plate
X
XCopyright (C) 1989 Tony Plate
X
XThis program and documentations may be freely distributed
Xand used, provided that this copyright notice is retained
Xintact.  There is no warranty with this software.
X
X
X.SH SEE ALSO
Xsurface(3d) graph3d(3d) graph3d-tek(3d) pswrap(3d)
END_OF_hat.man
if test 1054 -ne `wc -c <hat.man`; then
    echo shar: \"hat.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f hills.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"hills.man\"
else
echo shar: Extracting \"hills.man\" \(2284 characters\)
sed "s/^X//" >hills.man <<'END_OF_hills.man'
X.TH HILLS 3D "30 September 1989"
X.SH NAME
Xhills \- generate test data for graph3d
X.SH SYNOPSIS
X.B hills N n
X.RB [ h ]
X.RB [ seed ]
X.SH DESCRIPTION
X.B Hills
Xproduces a surface with random ``hills'' which can be used
Xtest data for
X.BR graph3d (3d).
XThe surface is a
X.B N
Xby
X.B N
Xgrid, there will be
X.B n
Xhills, of height
X.B h
X(default 6), and
X.B seed
X(default pid) can
Xbe used to initialize the random number generator.
X
XThe output of
X.B hills
Xis an example the type of input that
X.BR surface (3d)
Xcan accept, and provides useful test-data for
Xplaying with
X.BR graph3d (3d).
X.SH EXAMPLE
X.nf
X\fBhills 20 6 | surface | graph3d -plot | plot -T4014
Xhills 20 6 | surface -poly | graph3d -plot | plot -T4014
Xhills 20 6 | surface -hist | graph3d -plot -box | plot -T4014
Xhills 20 6 | surface -poly | graph3d -plot -border | plot -T4014
Xhills 20 6 | surface -poly -hist | graph3d -plot -box -orient -hide | plot -T4014\fP
X
X.fi
XThese commands, if executed in a Tektronics 4014 window (e.g. xterm
Xunder X11) will display some hills.  The same commands could be
Xexecuted in a different environment, and have their output
Xredirected to a 4014 window.
X
X.B Graph3d-tek
Xis a program compiled to produce 4014 output directly, so it
Xcan be run as follows:
X
X.nf
X\fBhills 20 6 | surface | graph3d-tek\fP
X.fi
X
XTo print the output on the imagen, try something like:
X
X.nf
X\fBhills 20 6 | surface | graph3d -plot | implot | lpr -Pimagen\fP
X.fi
X
XTo print POSTSCRIPT output, use:
X
X.nf
X\fBhills 20 6 | surface -hist -poly | graph3d -ps -hide | pswrap | lpr -Pps\fP
X.fi
X
XNote that POSTSCRIPT output could also be produced using
X.B psplot
Xinstead of
X.B implot
Xin the previous command. However,
X.B graph3d
Xcan only do hidden line removal if
X.B graph3d
Xdirectly produces POSTSCRIPT output.  Thus, hidden line
Xremoval can be done on an imagen only if it can print
XPOSTSCRIPT.  Note also that
X.B surface
Xmust be given the
X.B -polygon
Xoption for graph3d to be able to do hidden line removal.
X.SH AUTHOR
XTony Plate
X
XCopyright (C) 1989 Tony Plate
X
XThis program and documentations may be freely distributed
Xand used, provided that this copyright notice is retained
Xintact.  There is no warranty with this software.
X
X.SH BUGS
XThe hills are actually pyramids.
X.SH SEE ALSO
Xsurface(3d) graph3d(3d) graph3d-tek(3d) pswrap(3d)
END_OF_hills.man
if test 2284 -ne `wc -c <hills.man`; then
    echo shar: \"hills.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f pswrap.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"pswrap.man\"
else
echo shar: Extracting \"pswrap.man\" \(844 characters\)
sed "s/^X//" >pswrap.man <<'END_OF_pswrap.man'
X.TH PSWRAP 3D "30 September 1989"
X.SH NAME
Xpswrap \- puts a prologue and trailer around postscript files produced by \fIgraph3d\fP
X.SH SYNOPSIS
X.B pswrap
X[
X.RI filename .\|.\|.
X]
X.SH DESCRIPTION
X.I
XPswrap
Xis a program which puts a prologue and trailer around
Xpostscript files produced by
X.BR graph3d (3d).
XIt can used as a filter to wrap a single file, or multiple
Xfiles can be specified as arguments.  If multiple files are
Xspecified it assumed each file contains a graph, and it will
Xmake each graph smaller so that all fit onto the page.
X
X.SH AUTHOR
XTony Plate
X
XCopyright (C) 1989 Tony Plate
X
XThis program and documentation may be freely distributed and
Xused, provided that this copyright notice is retained
Xintact.  There is no warranty with this software.
X
X.SH SEE ALSO
Xhat(3d) hills(3d) graph3d(3d) graph3d-tek(3d) pswrap(3d) hills(3d)
X
X
END_OF_pswrap.man
if test 844 -ne `wc -c <pswrap.man`; then
    echo shar: \"pswrap.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f surface.man -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"surface.man\"
else
echo shar: Extracting \"surface.man\" \(6789 characters\)
sed "s/^X//" >surface.man <<'END_OF_surface.man'
X.TH SURFACE 3D "30 September 1989"
X.SH NAME
Xsurface \- a filter that constructs 3-d lines for a surface described by a 2-d matrix
X.SH SYNOPSIS
X.B surface
X.I options
X.SH DESCRIPTION
X.B Surface
Xis a filter which takes a 2-d matrix of real numbers as input.
XThe values of the entries in the matrix are considered as
Xheight (the ``Z'' direction), and a list of points in 3-d
Xwhich describe the 3-d surface is output.
XLists of points can be passed through the filter
X.BR graph3d (3d)
Xfor perspective projection (with optional hidden line
Xremoval) onto a plane and subsequent
Xplotting.  The two dimensions of the matrix are plotted on
Xthe horizontal (X) axis and depth (Y) axis, and the values
Xin the matrix itself are positions on the height (Z) axis.
XThere are two ways that
X.B surface
Xcan describe the 3-d surface, one is with polygons, and the
Xother is with grid lines.  The description with polygons is
Xneccessary if it is desired that
X.BR graph3d (3d)
Xdo hidden line removal.
XIf the surface is described with grid lines, there are options to
Xproduce only the lines in the X or Y direction.
X
XAn alternative mode of operation is to translate the numbers
Xin the matrix into a particularly compact representation.
XThis representation is a percent representation, and only
Xuses two characters per number, while expressing accuracy up
Xto 0.001 percent.  This mode is enabled by the
X.B -brief
Xoption and is intended for the display of probability
Xmatrices; a sqaure matrix having dimension up to 25 can be
Xdisplayed on standard 80 column terminal, without confusing
Xwrapping of lines.  In this mode, the numbers in the matrix
Xshould range between 0.0 and 1.0.
X
XThe format of the data file should be two integers,
X.I r
Xand
X.I c
Xwhich give the row and column dimensions of the matrix
Xrespectively, followed by lines of numbers, which are the
Xvalues in the matrix.
X.LP
XAn alternative format is the row dimension followed by a
X`*'.  If this format is used the program will read rows
Xuntil it cannot read any more integers.  The option
X\fB-sqaregrid\fP can be useful with the input format, it
Xwill adjust in the y direction the length of the surface
Xsuch that the grid is square.
X
X.B N.B.
XAny input remaining after the matrix
Xhas been read is copied to the output.
X
XIf the input file contains other material than the matrix,
Xthe \fB-delimit\fP option can be used to specify a string,
Xtwo of which delimit the material in the file to be used.
X
XAny deviation from the expected format will result in the program
Xprinting a message and giving up.
X.SH OPTIONS
X.LP
XFor all of the options, an unambiguous prefix will be
Xaccepted.
X.IP \fB-ascii\fP
XUse ascii format (i.e. human readable real numbers) for the output.
X.IP \fB-binary\fP
XGenerate the output in binary representation (single precision).
XThis can save alot of CPU time by not reading and writing
Xthousands of reals in ascii.  This is the default.
X.IP \fB-brief\fP
XDisplay the matrix with numbers in a very brief format.
XThis can be used to display up to 25 numbers on a single
Xline.  The numbers in the matrix should all be between 0.0
Xand 1000 to use this option. Most accuracy is obtained for
Xnumbers between 0.01 and 1.0.
X.IP "\fB-delimit\fP \fIdelimiter\fP"
XSearch for a line containing the string \fIdelimiter\fP in the
Xinput, and output the matrix found after that.  Copy input
Xfollowing the matrix to the output, up to, but not including
Xanother line containing the string \fIdelimiter\fP.  There may
Xbe other text on the line containing
X.I delimiter
X, this is ignored and not copied, no matter if it comes
Xbefore or after the delimiter.
X.IP \fB-grid\fP
XDisplay the surface using full grid lines.
X.IP \fB-histogram\fP
XDisplay the surface in a histogram format, with blocks.  The
Xoutput will be squares centred on the points specified in
Xthe input.  In the non-histogram display mode the points in
Xthe input are shown at the intersections of lines.  Thus, if
X\fB-histogram\fP is specifed, the X and Y co-ordinates of
Xthe output will range slightly outside of the specifed
Xbounds of the surface.
X.IP \fB-polygon\fP
XRepresent the surface with square panels rather than grid
Xlines.  It is neccessary to use this option if it is desired
Xthat 
X.B graph3d
Xdo hidden line removal.
X.IP \fB-squaregrid\fP
XAdjust the upper Y bound of the surface
Xthat the grid is square.  This is done before transposition,
Xif transposition was requested.
X.IP \fB-suppresstext\fP
XDon't copy extra material following the matrix to stdout.
X.IP \fB-transpose\fP
XTranspose the matrix.  This option can be combined with any
Xof the modes of display.
X.IP \fB-triangle\fP
XPresently unimplemented.
XRepresent the surface with triangular panels.  This option
Xis only useful if
X.BR -histogram is
Xnot specified, and is ignored if
X.BR -histogram is
Xspecified.
X.IP \fB-unit\fP
XInterpret the matrix as describing a surface on the unit
Xsquare.  This is an abbreviation for \fB-x 0 1 -y 0 1\fP.
X.IP "\fB-x <low> <high>\fP"
XSpecify the bounds in the X dimension of the surface being
Xdescribed.  The defaults are 0 for the lower bound and the
Xnumber of points in the X direction for the upper bound.
X.IP \fB-xlines\fP
XDisplay the surface using only the grid lines in the
Xx-direction.
X.IP "\fB-y <low> <high>\fP"
XSpecify the bounds in the Y dimension of the surface being
Xdescribed.  The defaults are 0 for the lower bound and the
Xnumber of points in the Y direction for the upper bound.
X.IP \fB-ylines\fP
XDisplay the surface using only the grid lines in the
Xy-direction.
X.SH EXAMPLE
X.nf
X\fBhills 40 10 | surface -poly | graph3d -plot -border | plot -T4014 > /dev/tty??\fP
X.fi
X
XPlot some hills test data
Xas a three-dimensional surface and display the result on a
XTektronics 4014 console (substitute the device name for
X/dev/tty??), with a border around the diagram.  The z axis
Xis scaled by a factor of 15, making it much taller.
X
X.nf
X\fBhat 60 20 | surface -unit | graph3d -ps -box -border -hide | pswrap | lpr -Pps\fP
X.fi
X
XPlot a hat as a three-dimensional surface and display the
Xresult on the laserwriter, with hidden line removal, with a
Xsquare border around the graph, and with the frame of the
Xcubic polygon enclosing the graph.  The surface is assumed
Xto describe the unit square.
X
X.nf
X\fBhat 60 20 | surface -unit | graph3d-tek\fP
X.fi
X
XPlot a hat and display the result on an xterm running in
Xtektronics mode, which \fIgraph3d-tek\fP will endeavour to
Xfind.  The surface is assumed to describe the unit square.
XSee the manual page for \fIgraph3d-tek\fP for further
Xinformation.
X
X.SH AUTHOR
XTony Plate
X
XCopyright (C) 1989 Tony Plate
X
XThis program and documentations may be freely distributed
Xand used, provided that this copyright notice is retained
Xintact.  There is no warranty with this software.
X
X.SH SEE ALSO
Xhat(3d) hills(3d) graph3d(3d) graph3d-tek(3d) pswrap(3d) hills(3d)
X
END_OF_surface.man
if test 6789 -ne `wc -c <surface.man`; then
    echo shar: \"surface.man\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 3 \(of 3\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 3 archives.
    echo "Now type 'make'"
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

--
-------------------------------------------------------------------------------
Michel Berkelaar                   | Email: michel@ele.tue.nl      (prefered)
Eindhoven University of Technology |        ..!mcvax!euteal!michel (old)
Dept. of Electrical Engineering    |
Design Automation Section          |
P.O. Box 513                       | Phone: ... - 31 - 40 - 473345
NL-5600 MB Eindhoven               | Fax:   ... - 31 - 40 - 448375
The Netherlands                    |
-------------------------------------------------------------------------------