summary refs log tree commit diff
path: root/pamcrater.html
blob: 77b3d8799dd5840355668e1cacd90bf1492db695 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamcrater User Manual</title></head>
<body>
<h1>pamcrater</h1>
Updated: 03 November 2014
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pamcrater - create cratered terrain by fractal forgery


<h2 id="synopsis">SYNOPSIS</h2>

<b>pamcrater</b>

[<b>-number</b> <i>n</i>]

[<b>-height</b> <i>pixels</i>]

[<b>-width</b> <i>pixels</i>]

[<b>-randomseed=</b><i>integer</i>]

[<b>-verbose</b>]

<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pamcrater</b> creates a PAM image which is a terrain map (not a visual
image) of cratered terrain.  The terrain is as if a given number of impacts
into a surface create craters with random position and size.

<p>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.

<p>A terrain map is a two dimensional map of terrain elevations.  the PAM
image that <b>pamcrater</b> produces is therefore not a visual image but a
depth-one image of tuple type "elevation", with the sample value
being proportional to an elevation.

<p>You can visualize the terrain map by generating a shaded relief image of it
with <b>pamshadedrelief</b>.  <p>High resolution images with large numbers of
craters often benefit from being piped through <b>pnmsmooth</b>.  The
averaging performed by this process eliminates some of the jagged pixels and
lends a mellow ``telescopic image'' feel to the overall picture.

<p><b>pamcrater</b> generates 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:

<pre>
                /\                            /\
          _____/  \____________/\____________/  \_____
</pre>


<p>Larger craters should really use this profile, including the central
peak, and totally obliterate the pre-existing terrain.

<p>The maxval of the PAM image is always 65535.

<p>The randomness in the image is limited before Netpbm 10.37 (December
2006) -- if you run the program twice in the same second, you may get
identical output.


<h2 id="options">OPTIONS</h2>

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>pamcrater</b> recognizes the following
command line options:

<p>All options can be abbreviated to their shortest unique prefix.

<dl compact>
<dt><b>-number</b> <i>n</i>

<dd>This causes <b>pamcrater</b> to generate <i>n</i> craters.  If you do not
specify <b>-number</b>, it generates 50000 craters.  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 longer to create.

<dt><b>-height</b> <i>height</i>

<dd>This sets the height of the generated image to <i>height</i> pixels.
The default height is 256 pixels.

<dt><b>-width</b> <i>width</i>

<dd>This sets the width of the generated image to <i>width</i> pixels.  The
default width is 256 pixels.

<dt><b>-randomseed=</b><i>integer</i>

<dd>This is the seed for the random number generator that generates the
pixels.

<p>Use this to ensure you get the same image on separate invocations.

<p>By default, <b>pamcrater</b> uses a seed derived from the time of day and
process ID, which gives you fairly uncorrelated results in multiple
invocations.

<p>This option was new in Netpbm 10.61 (December 2012).

<dt><b>-verbose</b>

<dd>This causes <b>pamcrater</b> to issue additional messages about what it
is doing.

<p>This option was new in Neptbm 10.69 (December 2014).

</dl>

<h2 id="examples">EXAMPLES</h2>

<pre>
<kbd>
    $ pamcrater | pamshadedrelief | pamx

    $ pamcrater -number=500000 -height=1000 -width=1000 &gt;craters.pam
</kbd>  
</pre>

<h2 id="designnotes">DESIGN NOTES</h2>

<p>Real craters have two distinct morphologies.


<h2 id="seealso">SEE ALSO</h2>

<b><a href="pamshadedrelief.html">pamshadedrelief</a></b>,

<b><a href="ppmrelief.html">ppmrelief</a></b>,

<b><a href="pnmsmooth.html">pnmsmooth</a></b>

<b><a href="pam.html">pam</a></b>,

<dl compact>
<dt>[1]
<dd>Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images,
New York: Springer Verlag, 1988.

</dl>

<h2 id="author">AUTHOR</h2>

<p><b>pgmcrater</b>, from which this is derived, was written by John Walker:

<pre>
John Walker
Autodesk SA
Avenue des Champs-Montants 14b
CH-2074 MARIN
Suisse/Schweiz/Svizzera/Svizra/Switzerland
    <b>Usenet:</b><a href="mailto:kelvin@Autodesk.com">kelvin@Autodesk.com</a>
    <b>Fax:</b>038/33 88 15
    <b>Voice:</b>038/33 76 33
</pre>

<p>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.


<h2 id="history">HISTORY</h2>

<p>John Walker wrote <b>pgmcrater</b> in 1991 and it was included in Pbmplus.
<b>pgmcrater</b> did the equivalent of <kbd>pamcrater | pamshadedrelief</kbd>.
In Netpbm 10.68 (September 2014), Bryan Henderson split the functions
of <b>pgmcrater</b> into two programs, one (<b>pamcrater</b>) to compute
elevations, and the other (<b>pamshadedrelief</b>) to generate a shaded relief
visual image showing those elevations.  Bryan did this because it is more in
keeping with Netpbm's modular architecture, and because
the <b>pamshadedrelief</b> might be useful with other inputs.

<p>(Like all Netpbm programs, <b>pgmcrater</b> was not static between the two
events described above; minor changes, including replacement of most of the
code, happened in between).

<p>The original 1991 <b>pgmcrater</b> manual contains the following:

<h3>PLUGWARE!</h3>

<p>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.

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
<li><a href="#examples">EXAMPLES</a>
<li><a href="#designnotes">DESIGN NOTES</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#author">AUTHOR</a>
<li><a href="#history">HISTORY</a>
</ul>
</body>
</html>