| 1 |
greg |
1.1 |
.\" RCSid "$Id"
|
| 2 |
|
|
.TH GENSURF 1 11/15/93 RADIANCE
|
| 3 |
|
|
.SH NAME
|
| 4 |
greg |
1.2 |
gensurf - generate a RADIANCE or Wavefront description of a curved surface
|
| 5 |
greg |
1.1 |
.SH SYNOPSIS
|
| 6 |
|
|
.B "gensurf mat name 'x(s,t)' 'y(s,t)' 'z(s,t)' m n"
|
| 7 |
|
|
[
|
| 8 |
|
|
.B "\-e expr"
|
| 9 |
|
|
][
|
| 10 |
|
|
.B "\-f file"
|
| 11 |
|
|
][
|
| 12 |
|
|
.B \-s
|
| 13 |
greg |
1.2 |
][
|
| 14 |
|
|
.B \-o
|
| 15 |
greg |
1.1 |
]
|
| 16 |
|
|
.br
|
| 17 |
|
|
.B "gensurf mat name 'x(s,t)' 'y(s,t)' dfile m n"
|
| 18 |
|
|
[
|
| 19 |
|
|
.B "\-e expr"
|
| 20 |
|
|
][
|
| 21 |
|
|
.B "\-f file"
|
| 22 |
|
|
][
|
| 23 |
|
|
.B \-s
|
| 24 |
greg |
1.2 |
][
|
| 25 |
|
|
.B \-o
|
| 26 |
greg |
1.1 |
]
|
| 27 |
|
|
.br
|
| 28 |
|
|
.B "gensurf mat name dfile dfile dfile m n"
|
| 29 |
|
|
[
|
| 30 |
|
|
.B \-s
|
| 31 |
greg |
1.2 |
][
|
| 32 |
|
|
.B \-o
|
| 33 |
greg |
1.1 |
]
|
| 34 |
|
|
.SH DESCRIPTION
|
| 35 |
|
|
.I Gensurf
|
| 36 |
greg |
1.2 |
produces either a RADIANCE scene description or a Wavefront .OBJ
|
| 37 |
|
|
file of a functional surface defined by the parametric equations
|
| 38 |
greg |
1.1 |
.I x(s,t),
|
| 39 |
|
|
.I y(s,t),
|
| 40 |
|
|
and
|
| 41 |
|
|
.I z(s,t).
|
| 42 |
|
|
The surface normal is defined by the right hand rule as
|
| 43 |
|
|
applied to
|
| 44 |
|
|
.I (s,t).
|
| 45 |
|
|
.I S
|
| 46 |
|
|
will vary from 0 to 1 in steps of
|
| 47 |
|
|
.I 1/m,
|
| 48 |
|
|
and
|
| 49 |
|
|
.I t
|
| 50 |
|
|
will vary from 0 to 1 in steps of
|
| 51 |
|
|
.I 1/n.
|
| 52 |
|
|
The surface will be composed of
|
| 53 |
|
|
.I 2*m*n
|
| 54 |
|
|
or fewer triangles and quadrilaterals.
|
| 55 |
|
|
The expressions are of the same type used in RADIANCE
|
| 56 |
|
|
function files.
|
| 57 |
|
|
Auxiliary expressions and/or files may be specified
|
| 58 |
|
|
in any number of
|
| 59 |
|
|
.I \-e
|
| 60 |
|
|
and
|
| 61 |
|
|
.I \-f
|
| 62 |
|
|
options.
|
| 63 |
|
|
The
|
| 64 |
|
|
.I \-s
|
| 65 |
|
|
option adds smoothing (surface normal interpolation) to the surface.
|
| 66 |
greg |
1.2 |
The
|
| 67 |
|
|
.I \-o
|
| 68 |
|
|
option produces a Wavefront .OBJ file rather than a RADIANCE
|
| 69 |
|
|
scene description.
|
| 70 |
|
|
This is most useful as input to the
|
| 71 |
|
|
.I obj2mesh(1)
|
| 72 |
|
|
program for producing a compiled mesh.
|
| 73 |
greg |
1.1 |
.PP
|
| 74 |
|
|
Rough holes may be cut in the mesh by defining a valid(s,t) function.
|
| 75 |
|
|
Where this function is positive, polygon vertices will be produced.
|
| 76 |
|
|
Where it is negative, no geometry will be output.
|
| 77 |
|
|
Surface normal interpolation will ignore any invalid vertices.
|
| 78 |
|
|
.PP
|
| 79 |
|
|
The second invocation form reads z data values from the file
|
| 80 |
|
|
.I dfile.
|
| 81 |
|
|
This file must give either m*n or (m+1)*(n+1) floating point z
|
| 82 |
|
|
values.
|
| 83 |
|
|
If m*n values are given, then the values correspond to the centroid
|
| 84 |
|
|
of each quadrilateral region.
|
| 85 |
|
|
If (m+1)*(n+1) values are given, then the values correspond to the
|
| 86 |
|
|
vertices of each quadrilateral region.
|
| 87 |
|
|
The ordering of the data in the file is such that the s values are
|
| 88 |
|
|
changing faster than the t values.
|
| 89 |
|
|
If a minus ('-') is given for
|
| 90 |
|
|
.I dfile,
|
| 91 |
|
|
then the values are read from the standard input.
|
| 92 |
|
|
.PP
|
| 93 |
|
|
The third invocation form is used to read coordinate triplets from a
|
| 94 |
|
|
file or the standard input.
|
| 95 |
|
|
The three
|
| 96 |
|
|
.I dfile
|
| 97 |
|
|
arguments must all be the same, and the corresponding file must
|
| 98 |
|
|
contain three floating point values for each point location.
|
| 99 |
|
|
The ordering and other details are the same as those described
|
| 100 |
|
|
for z value files above.
|
| 101 |
|
|
.SH EXAMPLE
|
| 102 |
|
|
To generate a tesselated sphere:
|
| 103 |
|
|
.IP "" .2i
|
| 104 |
|
|
gensurf crystal ball 'sin(PI*s)*cos(2*PI*t)' 'cos(PI*s)' 'sin(PI*s)*sin(2*PI*t)' 7 10
|
| 105 |
|
|
.PP
|
| 106 |
|
|
To generate a 10x20 smoothed height field from 12 recorded vertex
|
| 107 |
|
|
z values:
|
| 108 |
|
|
.IP "" .2i
|
| 109 |
|
|
gensurf dirt ground '10*s' '20*t' height.dat 2 3 -s
|
| 110 |
|
|
.SH AUTHOR
|
| 111 |
|
|
Greg Ward
|
| 112 |
|
|
.SH BUGS
|
| 113 |
|
|
The smoothing operation requires that functions be defined
|
| 114 |
|
|
beyond the [0,1] boundaries of s and t.
|
| 115 |
|
|
.SH "SEE ALSO"
|
| 116 |
greg |
1.2 |
calc(1), genbox(1), genrev(1), genworm(1),
|
| 117 |
|
|
obj2mesh(1), rpict(1), rview(1), xform(1)
|