r3.cross.rast(1grass)
π r3.cross.rast π
okay so bestie, this is the GRASS User's Manual page for r3.cross.rast, and it is literally the glow-up tool that takes a whole 3D raster vibe and slices a cute lil 2D cross section out of it. obsessed.
KEYWORDS: raster3d, profile, raster, voxel β¨
β¨ SYNOPSIS β¨
r3.cross.rast
r3.cross.rast --help
r3.cross.rast [-m] input=string elevation=string output=string
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π Flags
-mβ use the 3D raster mask (if one exists) together with the input map. like, mask it up π--overwriteβ lets output files overwrite files that already exist. no "oops it's taken" drama.--helpβ prints the usage summary, aka the cheat sheet π«Ά--verboseβ verbose module output (she talks a lot, we love her)--quietβ quiet module output (she's giving mysterious)--uiβ force launching the GUI dialog
πΈ Parameters
input=string[required] β the input 3D raster map you're slicing your cross section out ofelevation=string[required] β the 2D elevation map used to create the cross section mapoutput=string[required] β the resulting cross section 2D raster map, your main character artifact π
π DESCRIPTION π
so r3.cross.rast creates a cross section 2D map from one 3D raster volume map, based on a 2D elevation map. that's the whole plot.
here's the mechanics, no cap: it checks if the value of the elevation map is located in the z-coordinate space of the 3D map. if it IS, then the 3D voxel value for this position gets transferred to the related cross section output map cell π. otherwise, the NULL value is set. that's it, that's the algorithm, slay.
How r3.cross.rast works
and just so you know bestie: if the 2D and 3D region settings are different, the 2D resolution will be adjusted to the 3D resolution. they gotta match, it's giving couple goals.
π NOTES π
to create a cut plane elevation map, use r.mapcalc. some examples, periodt:
- To create a cut plane elevation map in x direction type
r.mapcalc "cutplane = col()*x",
with x being the value for the elevation. If the range of col() is 1 ... 10, the elevation map has the range 1 ... 10 if x == 1 and if x == 10 the range 10 ... 100 πΈ
- To create a cut plane elevation map in y direction type
r.mapcalc "cutplane = row()*x",
with x being the value for the elevation. If the range of col() is 1 ... 10, the elevation map has the range 1 ... 10 if x == 1 and if x == 10 the range 10 ... 100 β¨
- The user can also make a cut in y and x direction with
r.mapcalcby using
r.mapcalc "cutplane = (row()+col())*x"
π₯ EXAMPLES π₯
π Simple Spearfish example π
g.region -d
g.region res=150 res3=150 t=1000 b=0 tbres=100
# synthetic data, could be geological structures:
r3.mapcalc "map3d = sin(row())+sin(col())+sin(depth()*depth())"
#create a cutplane map
r.mapcalc "cutplane = col()*10"
#create the cross section map
r3.cross.rast input=map3d elevation=cutplane output=crosssection
like, look at that. g.region -d, set your resolution and your 3D bounds with res=150 res3=150 t=1000 b=0 tbres=100, cook up some "synthetic data, could be geological structures" with r3.mapcalc, cut yourself a plane with r.mapcalc "cutplane = col()*10", and boom β cross section. ate. π
π SEE ALSO π
g.regionr.mapcalcr3.mapcalcr3.to.rast
iykyk π
π«Ά AUTHOR π«Ά
SΓΆren Gebbert
π§ SOURCE CODE π§
Available at: r3.cross.rast source code (history)
Latest change: Saturday Jul 26 17:35:15 2025 in commit: ab6f35014ec46c07f76b93fa6268ef9e4fa4b3b2
Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the whole page bestie, brought to you by GRASS 8.5.0 πΈ no cap, go slice some voxels π β¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms