Skip to content

Commit 49f0a70

Browse files
committed
wrap readme
1 parent adb7e47 commit 49f0a70

File tree

1 file changed

+40
-10
lines changed

1 file changed

+40
-10
lines changed

README.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,43 +72,73 @@ $ hmm input.png output.stl -z 100 -e 0.001 -t 1000000
7272

7373
### Visual Guide
7474

75-
Click on the image below to see examples of various command line arguments. You can try these examples yourself with this heightmap: [gale.png](https://www.michaelfogleman.com/static/hmm/guide/gale.png).
75+
Click on the image below to see examples of various command line arguments. You
76+
can try these examples yourself with this heightmap: [gale.png](https://www.michaelfogleman.com/static/hmm/guide/gale.png).
7677

7778
![Visual Guide](https://www.michaelfogleman.com/static/hmm/guide/all.png)
7879

7980
### Z Scale
8081

81-
The required `-z` parameter defines the distance between a fully black pixel and a fully white pixel in the vertical Z axis, with units equal to one pixel width or height. For example, if each pixel in the heightmap represented a 1x1 meter square area, and the vertical range of the heightmap was 100 meters, then `-z 100` should be used.
82+
The required `-z` parameter defines the distance between a fully black pixel
83+
and a fully white pixel in the vertical Z axis, with units equal to one pixel
84+
width or height. For example, if each pixel in the heightmap represented a 1x1
85+
meter square area, and the vertical range of the heightmap was 100 meters, then
86+
`-z 100` should be used.
8287

8388
### Z Exaggeration
8489

85-
The `-x` parameter is simply an extra multiplier on top of the provided Z scale. It is provided as a convenience so you don't have to do multiplication in your head just to exaggerate by, e.g. 2x, since Z scales are often derived from real world data and can have strange values like 142.2378.
90+
The `-x` parameter is simply an extra multiplier on top of the provided Z
91+
scale. It is provided as a convenience so you don't have to do multiplication
92+
in your head just to exaggerate by, e.g. 2x, since Z scales are often derived
93+
from real world data and can have strange values like 142.2378.
8694

8795
### Max Error
8896

89-
The `-e` parameter defines the maximum allowed error in the output mesh, as a percentage of the total mesh height. For example, if `-e 0.01` is used, then no pixel will have an error of more than 1% of the distance between a fully black pixel and a fully white pixel. This means that for an 8-bit input image, an error of `e = 1 / 256 ~= 0.0039` will ensure that no pixel has an error greater than one full grayscale unit. (It may still be desireable to use a lower value like `0.5 / 256`.)
97+
The `-e` parameter defines the maximum allowed error in the output mesh, as a
98+
percentage of the total mesh height. For example, if `-e 0.01` is used, then no
99+
pixel will have an error of more than 1% of the distance between a fully black
100+
pixel and a fully white pixel. This means that for an 8-bit input image, an
101+
error of `e = 1 / 256 ~= 0.0039` will ensure that no pixel has an error greater
102+
than one full grayscale unit. (It may still be desireable to use a lower value
103+
like `0.5 / 256`.)
90104

91105
### Base Height
92106

93-
When the `-b` option is used to create a solid mesh, it defines the height of the base before the lowest part of the heightmesh appears, as a percentage of the heightmap's height. For example, if `-z 100 -b 0.5` were used, then the final mesh would be about 150 units tall (if a fully white pixel exists in the input).
107+
When the `-b` option is used to create a solid mesh, it defines the height of
108+
the base before the lowest part of the heightmesh appears, as a percentage of
109+
the heightmap's height. For example, if `-z 100 -b 0.5` were used, then the
110+
final mesh would be about 150 units tall (if a fully white pixel exists in the
111+
input).
94112

95113
### Border
96114

97-
A border can be added to the mesh with the `--border-size` and `--border-height` flags. The heightmap will be padded by `border-size` pixels before triangulating. The (pre-scaled) Z value of the border can be set with `border-height` which defaults to 1.
115+
A border can be added to the mesh with the `--border-size` and
116+
`--border-height` flags. The heightmap will be padded by `border-size` pixels
117+
before triangulating. The (pre-scaled) Z value of the border can be set with
118+
`border-height` which defaults to 1.
98119

99120
### Filters
100121

101-
A Gaussian blur can be applied with the `--blur` flag. This is particularly useful for noisy images.
122+
A Gaussian blur can be applied with the `--blur` flag. This is particularly
123+
useful for noisy images.
102124

103-
The heightmap can be inverted with the `--invert` flag. This is useful for [lithophanes](https://en.wikipedia.org/wiki/Lithophane).
125+
The heightmap can be inverted with the `--invert` flag. This is useful for
126+
[lithophanes](https://en.wikipedia.org/wiki/Lithophane).
104127

105128
### Normal Maps
106129

107-
A full resolution [normal map](https://en.wikipedia.org/wiki/Normal_mapping) can be generated with the `--normal-map` argument. This will save a normal map as an RGB PNG to the specified path. This is useful for rendering higher resolution bumps and details while using a lower resolution triangle mesh.
130+
A full resolution [normal map](https://en.wikipedia.org/wiki/Normal_mapping)
131+
can be generated with the `--normal-map` argument. This will save a normal map
132+
as an RGB PNG to the specified path. This is useful for rendering higher
133+
resolution bumps and details while using a lower resolution triangle mesh.
108134

109135
### Performance
110136

111-
Performance depends a lot on the amount of detail in the heightmap, but here are some figures for an example heightmap of a [40x40 kilometer area centered on Mount Everest](https://i.imgur.com/1i9djJ0.jpg). Various heightmap resolutions and permitted max errors are shown. Times computed on a 2018 13" MacBook Pro (2.7 GHz Intel Core i7).
137+
Performance depends a lot on the amount of detail in the heightmap, but here
138+
are some figures for an example heightmap of a [40x40 kilometer area centered
139+
on Mount Everest](https://i.imgur.com/1i9djJ0.jpg). Various heightmap
140+
resolutions and permitted max errors are shown. Times computed on a 2018 13"
141+
MacBook Pro (2.7 GHz Intel Core i7).
112142

113143
#### Runtime in Seconds
114144

0 commit comments

Comments
 (0)