Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/doc/netpbm/ms/pgmcrater.ms

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TL
Pgmcrater User Manual
.SH 1
pgmcrater
.LP
Updated: 15 October 1991
.br
Table Of Contents
.SH 2
NAME
.LP
pgmcrater - create cratered terrain by fractal forgery
.SH 2
SYNOPSIS
.LP
\fBpgmcrater\fR
[\fB-number\fR \fIn\fR]
[\fB-height\fR|\fB-ysize\fR \fIs\fR]
[\fB-width\fR|\fB-xsize\fR \fIs\fR]
[\fB-gamma\fR \fIg\fR]
.LP
All options can be abbreviated to their shortest unique prefix.
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBpgmcrater\fR creates a PGM image which mimics cratered terrain.
The PGM image is created by simulating the impact of a given number of
craters with random position and size, then rendering the resulting
terrain elevations based on a light source shining from one side of
the screen.  The size distribution of the craters is based on a power
law which results in many more small craters than large ones.  The
number of craters of a given size varies as the reciprocal of the area
as described on pages 31 and 32 of Peitgen and Saupe[1]; cratered
bodies in the Solar System are observed to obey this relationship.
The formula used to obtain crater radii governed by this law from a
uniformly distributed pseudorandom sequence was developed by Rudy
Rucker.
.LP
High resolution images with large numbers of craters often benefit
from being piped through \fBpnmsmooth\fR.  The averaging performed by
this process eliminates some of the jagged pixels and lends a mellow
``telescopic image'' feel to the overall picture.
.LP
\fBpgmcrater\fR simulates only small craters, which are
hemispherical in shape (regardless of the incidence angle of the
impacting body, as long as the velocity is sufficiently high).  Large
craters, such as Copernicus and Tycho on the Moon, have a ``walled
plain'' shape with a cross-section more like:
.DS L
                /\                            /\
.br
          _____/  \____________/\____________/  \_____
.DE
Larger craters should really use this profile, including the central
peak, and totally obliterate the pre-existing terrain.
.SH 2
OPTIONS
.LP
.RS
.IP "\fB-number\fR \fIn\fR"
Causes \fIn\fR craters to be generated.  If no \fB-number\fR
specification is given, 50000 craters will be generated.  Don't expect
to see them all!  For every large crater there are many, many more
tiny ones which tend simply to erode the landscape.  In general, the
more craters you specify the more realistic the result; ideally you
want the entire terrain to have been extensively turned over again and
again by cratering.  High resolution images containing five to ten
million craters are stunning but take quite a while to create.
.IP "\fB-height\fR \fIheight\fR"
Sets the height of the generated image to \fIheight\fR pixels.
The default height is 256 pixels.
.IP "\fB-width\fR \fIwidth\fR"
Sets the width of the generated image to \fIwidth\fR pixels.  The
default width is 256 pixels.
.IP "\fB-xsize\fR \fIwidth\fR"
Sets the width of the generated image to \fIwidth\fR pixels.  The
default width is 256 pixels.
.IP "\fB-ysize\fR \fIheight\fR"
Sets the height of the generated image to \fIheight\fR pixels.
The default height is 256 pixels.
.IP "\fB-gamma\fR \fIfactor\fR"
The specified \fIfactor\fR is used to gamma adjust the image in
the same manner as performed by \fBpnmgamma\fR.  The default value is
1.0, which results in a medium contrast image.  Values larger than 1
lighten the image and reduce contrast, while values less than 1 darken
the image, increasing contrast.
.LP
Note that this is separate from the gamma correction that is part
of the definition of the PGM format.  The image \fBpnmgamma\fR
generates is a genuine, gamma-corrected PGM image in any case.  This
option simply changes the contrast and may compensate for a display
device that does not correctly render PGM images.
.RE
.SH 2
DESIGN NOTES
.LP
The\fB-gamma\fR option isn't really necessary since you can achieve
the same effect by piping the output from \fBpgmcrater\fR through
\fBpnmgamma\fR.  However, \fBpgmcrater\fR performs an internal gamma
map anyway in the process of rendering the elevation array into the
PGM format, so there's no additional overhead in allowing an
additional gamma adjustment.
.LP
Real craters have two distinct morphologies.
.SH 2
SEE ALSO
.LP
\fBpnmgamma\fR,
\fBpnmsmooth\fR
\fBpgm\fR,
.RS
.IP "[1]"
Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images,
New York: Springer Verlag, 1988.
.RE
.SH 2
AUTHOR
.LP
.DS L
John Walker
Autodesk SA
Avenue des Champs-Montants 14b
CH-2074 MARIN
Suisse/Schweiz/Svizzera/Svizra/Switzerland
    \fBUsenet:\fRkelvin@Autodesk.com
    \fBFax:\fR038/33 88 15
    \fBVoice:\fR038/33 76 33
.DE
.LP
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby granted,
without any conditions or restrictions.  This software is provided
"as is" without express or implied warranty.
.SH 2
HISTORY
.LP
.LP
The original 1991 version of this manual contains the following:
.SH 3
PLUGWARE!
.LP
.LP
If you like this kind of stuff, you may also enjoy "James Gleick's
Chaos--The Software" for MS-DOS, available for $59.95 from your
local software store or directly from Autodesk, Inc., Attn: Science
Series, 2320 Marinship Way, Sausalito, CA 94965, USA.  Telephone:
(800) 688-2344 toll-free or, outside the U.S. (415) 332-2344 Ext
4886.  Fax: (415) 289-4718.  "Chaos--The Software" includes a more
comprehensive fractal forgery generator which creates
three-dimensional landscapes as well as clouds and planets, plus five
more modules which explore other aspects of Chaos.  The user guide of
more than 200 pages includes an introduction by James Gleick and
detailed explanations by Rudy Rucker of the mathematics and algorithms
used by each program.
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
NAME
.IP \(bu
SYNOPSIS
.IP \(bu
DESCRIPTION
.IP \(bu
OPTIONS
.IP \(bu
DESIGN NOTES
.IP \(bu
SEE ALSO
.IP \(bu
AUTHOR
.IP \(bu
HISTORY
.LP

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.