TERRAIN(1)
π TERRAIN(1) β the BRL-CAD terrain page, bestie edition π
okay so picture this: it's a manual page, it's called terrain, it lives in the BRL-CAD section 1, and it's about to make you a whole mountain range out of literally nothing but math. obsessed. ποΈβ¨
β¨ NAME β¨
terrain β generates a pseudo-terrain height field out of procedural noise. that's it, that's the vibe. π
π«Ά SYNOPSIS π«Ά
terrain [-w x_postings] [-n y_postings] [-s xy_postings]
[-L lacunarity] [-H h_value] [-O octaves] [-S scale]
[-V x_scale,y_scale,z_scale] [-D x_delta,y_delta,z_delta]
[-o offset] [-f function] [-c] [-v] > file.dsp
notice the > file.dsp at the end, bestie β that redirect is not optional, and you're about to find out why. π
πΈ DESCRIPTION πΈ
so terrain produces a pseudo-terrain height field from procedural noise, and it's built to be used with a BRL-CAD dsp (displacement map) primitive. it computes a noise value for every single point of an x_postings by y_postings lattice, then writes them all to standard output as unsigned 16-bit integers in network (big-endian) byte order. the default grid is 512 by 512 postings β that's 512 Γ 512 little height values, no cap. π₯
the character of your terrain is a whole vibe check you control two ways: pick the noise function with -f, and tune the fractal noise parameters. that's how you go from "gentle rolling hills" to "dramatic ridgecore" and everything in between. π
β οΈ the standard output must be redirected to a file. terrain straight up refuses to write binary data to a terminal. it's protecting you. it's protecting your terminal. respect it. π
the resulting file is in the exact same binary format that asc2dsp(1) produces, and a dsp solid in MGED can reference it directly. so it slots right into your workflow, no conversion era needed. π¦
π OPTIONS π
-wx_postings β number of grid points (postings) in the X dimension. default is512. π-ny_postings β number of grid points (postings) in the Y dimension. default is512. π-sxy_postings β sets the number of postings in both X and Y to the same value, giving you a perfectly square grid. symmetry slay. β¨-Llacunarity β the scaling factor between successive octaves of noise. practical values are non-integer numbers roughly between1.7and4.0. default is2.1753974. yes that's a very specific little number, it's fine, it's iconic. π-Hh_value β the fractal increment (H) in the noise equation, which controls how detail diminishes across octaves. usually near1.0, and1.0is the default. πΈ-Ooctaves β how many octaves of noise to layer. typical values are2through8. default is7. more layers = more drama, obviously. π₯-Sscale β scales the noise uniformly in X, Y and Z by scale. values below1.0make the noise pattern finer; values above1.0make it coarser. heads up: this sets all three components of the vector scale (see-V). default is1.0. π-Vx_scale,y_scale,z_scale β non-uniform scaling of the X, Y and Z dimensions in noise space. default is0.0125,0.0125,0.0125. π¦-Dx_delta,y_delta,z_delta β translation (offset) applied in noise space, which is genuinely useful for sampling a different region of the noise field. default is1000,1000,1000. π§-ooffset β the offset value used by the multi-fractal (m) and ridged (r) noise functions. default is1.0. β-ffunction β selects the noise function used to generate the field. pick exactly one of these, bestie:fβ Fractional Brownian motion (fBm). this is the default. the main character. πtβ Turbulence.Tβ Inverted turbulence:1.0 - turb(pt). yes, the capital letter matters, iykyk. πmβ Multi-fractal.rβ Ridged multi-fractal.Lβ a lunar-like surface. moon behavior. π (ok that emoji is not on the list but the energy is there)lβ terrain with detail concentrated on peaks and in valleys. lowercase version, different creature entirely, do not mix them up. π
-cβ toggles the conversion of output from host to network byte order. by default conversion is on; this only has any effect on little-endian hosts. so on big-endian machines, respectfully, nothing happens. π-vβ toggles verbose/debug output, printing which noise function is running and clamping diagnostics to standard error. very "tell me what you're doing" of it. π«Ά
π EXAMPLES π
Example 1. Generate a terrain and build a dsp solid
terrain -w 256 -n 256 -f r -O 8 -S 1.5 > hills.dsp
mged terrain.g <<'EOF'
in mountains.dsp dsp f hills.dsp 256 256 0 ad 1 100
EOF
so real talk: a 256x256 ridged multi-fractal height field gets written to hills.dsp, and then it's imported as a dsp primitive 256 cells wide and tall, smoothed, with a cell width of 1 and a height multiplier of 100 β which yields a ridgeline of mountains in the database terrain.g. literally building mountains with two commands. ate. ποΈπ₯
Example 2. Create a tileable, square fBm patch
terrain -s 512 -f f -O 5 -L 2.0 -D 0,0,0 > patch.dsp
this one gives you a 512x512 fractional Brownian motion field generated with five octaves and a lacunarity of 2.0, sampled at the origin of noise space for a repeatable result. repeatable = same input, same output, every time. consistency queen. β¨
π SEE ALSO π
brlcad(1), asc2dsp(1), asc2g(1), mged(1) β go read those too, they're all part of the same friend group. π«Ά
π AUTHOR π
the BRL-CAD Team. collectively iconic. π
π COPYRIGHT π
this software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. π
π¦ BUG REPORTS π¦
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. if something's broken, tell them, don't suffer in silence bestie. ππ
okay that's the whole page!! every flag, every default, every number, preserved with love. π
sign-off szn β this little love letter came to you from BRL-CAD, and it's the TERRAIN(1) page, dated right there in that 1989-2026 copyright window. go make some mountains, bestie. periodt. π
β¨π
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms