RTHIDE(1)

πŸ“¦
version 7.44.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… RTHIDE(1) β€” the BRL-CAD glow-up where your model gets a hidden-line sketch πŸŽ€

ok so bestie, welcome to rthide, one of the little icons of the BRL-CAD family ✨


πŸ¦‹ NAME

rthide β€” ray-trace a model and write a hidden-line UNIX-Plot file. literally that's the whole vibe πŸ’–


🌸 SYNOPSIS

rthide [options] model.g [objects...] > output.plot3

πŸ‘‘ DESCRIPTION

okay so here's the tea β˜• rthide ray-traces the objects you list in the BRL-CAD database model.g and emits a hidden-line-removed UNIX-Plot file (peep plot3(5)) with bas-relief detail. it draws a boundary line wherever the region ID changes between neighboring rays, and additionally portrays abrupt changes in surface curvature and surface height. the way this works is genuinely iconic: pits, protrusions, and curvature changes all show up as relief β€” the result looks flat when you view it head-on but shows detail when you rotate it. πŸ’« the plot goes to standard output by default, or to a named file with -o.

if you don't list any objects, rthide uses the same automatic default-object selection described in rt(1). and if no single usable default can be resolved, it just aborts before rendering β€” no render, no drama, just abort πŸ™ˆ

the view is normally specified with -a (azimuth) and -e (elevation), and in that case the model is auto-sized and the grid is centered on its bounding box 🎯 alternatively, -M reads a model-to-view matrix from standard input, as produced by an mged(1) saveview script β€” in that case the grid size is set with -s.

rthide is a member of the rt(1) family and shares its option set with librt(3). but listen πŸ‘€ because it produces vector plot output rather than a shaded raster image, most raster-oriented options (lighting, framebuffer, hypersampling, and similar) have no useful effect. the options most relevant to rthide are described first below, and they ate πŸ’…


✨ OPTIONS ✨

  • -s # β€” number of rays (cells) to fire in each of X and Y, i.e. a square grid. default is 512 (a 512x512 grid). ⭐
  • -a deg β€” view azimuth in degrees. used with -e; enables auto-sizing. conflicts with -M. 🧭
  • -e deg β€” view elevation in degrees. used with -a; enables auto-sizing. conflicts with -M. 🧭
  • -A deg β€” shading angle in degrees. a boundary is shaded wherever the angle between adjacent surface normals exceeds this value. default is 5.0; a large value such as 89.0 shades only steep rises and drops, suppressing curvature cross-hatching. lowkey the glow-up knob πŸŽ€
  • -M β€” read a model-to-view (model2view) matrix from standard input instead of using -a/-e. conflicts with -a and -e. 🫢
  • -o output.plot3 β€” write the plot to the named file instead of standard output.
  • -g mm β€” grid cell width in millimeters.
  • -G mm β€” grid cell height in millimeters. if unspecified, cell height equals cell width.
  • -w # β€” image/grid width in cells (overrides the X dimension set by -s).
  • -n # β€” image/grid height in cells (overrides the Y dimension set by -s).
  • -V #[:#] β€” view aspect ratio, width/height (e.g. 1.33 or 4:3). πŸ“
  • -p deg β€” perspective angle in degrees (0 <= deg < 180; 0 means orthographic).
  • -E # β€” distance from the eye to the model center (default sqrt(2)).
  • -P # β€” maximum number of processor cores to use during prep (a negative value means all but that many). ray tracing itself is forced to a single CPU. yes bestie, one (1) CPU, that's the rule πŸ’€
  • -U # β€” set the librt use_air flag: 0 discards air regions (default), non-zero retains them.
  • -T #[/#] β€” ray-tracing tolerances, dist[/perp] (default 0.0005).
  • -r β€” report overlapping region names (on by default).
  • -R β€” suppress overlap region-name reports.
  • -c cmd β€” execute an rt script command before ray tracing (may be repeated). πŸ”
  • -I file β€” read object names from a text file, one per line, in addition to those on the command line.
  • -k x,y,z,nx,ny,nz β€” apply a cutting plane, equivalent to subtracting a half-space from the scene. accepts xdir,ydir,zdir,dist, x,y,z,nx,ny,nz, or x,y,z forms. πŸ”ͺ
  • -j xmin,ymin,xmax,ymax β€” ray-trace only the given sub-rectangle of the view.
  • -u units β€” display units; "model" uses the database's own units.
  • -D # β€” starting frame number (for animation scripts read via -M).
  • -K # β€” ending (kill-after) frame number.
  • -x # β€” set librt debug flags to the given hexadecimal value.
  • -X # β€” set rt program/optical debug flags (hexadecimal).
  • -N # β€” set libnmg debug flags (hexadecimal).
  • -! # β€” set libbu debug flags (hexadecimal).
  • -v [#] β€” increase verbosity; repeat (e.g. -vvvv) or supply a hexadecimal level. πŸ—£οΈ

the following options are accepted because rthide shares the rt(1) command parser, but they have little or no effect on plot output: -w and -n aside, the raster-only controls -O, -F, -C, -W, -l, -m, -i, -t, -S, -H, -J, -z, -d, -b, -Q, -B, -q, and -+. πŸ’€ they're literally just along for the ride, iykyk.


🌈 EXAMPLES 🌈

🌸 Example 1. Bas-relief line drawing of a model

rthide -s512 -a35 -e25 -A89.0 moss.g all.g > moss.plot3
plot3-fb moss.plot3

ray-traces the all.g assembly in moss.g over a 512x512 grid from azimuth 35deg, elevation 25deg, suppressing curvature cross-hatching with a 89.0deg shading angle, then displays the resulting hidden-line plot on a framebuffer with plot3-fb(1). the plot can equally be rotated with plot3rot(1) or overlaid in mged(1) with the overlay command. obsessed. 🫢

πŸ¦‹ Example 2. Overlaying hidden-line work onto a shaded rt image

AZ=35; EL=25
rt     -s512 -a$AZ -e$EL moss.g all.g
rthide -A89.9 -s512 -a$AZ -e$EL -o rthide.plot3 moss.g all.g
plot3-fb -o rthide.plot3

renders a shaded image with rt(1) into the framebuffer, traces the matching hidden-line plot with rthide using the same view and grid size, then overlays the line work onto the shaded image with plot3-fb(1) (-o keeps the existing framebuffer contents) for an "edge enhanced" result. ⚑ this assumes FB_FILE points to a valid framebuffer β€” so, you know, check that first bestie 😭


πŸ”₯ SEE ALSO

brlcad(1), rt(1), rtedge(1), mged(1), plot3-fb(1), plot3rot(1), rtscale(1), librt(3), plot3(5) β€” go read them, they're all part of the family πŸ’œ


πŸŽ€ AUTHOR

BRL-CAD Team β€” the main characters πŸ‘‘

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 β€” don't be shy, they want to hear it πŸ“


ngl, plot3 output plus a big shading angle is a whole aesthetic, go try it ✨
πŸͺ½ sign-off time: this was RTHIDE(1) from BRL-CAD, straight out of the BRL-CAD manual set β€” mwah, take care of her πŸ’…πŸŒΈ
πŸ“¦ where this page comes from