RTG3(1)

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

πŸ’… RTG3(1) β€” raytrace a model, writing a COVART (GIFT) 3-component shotline file ✨

okay so first things first, this is rtg3, and it lives in the BRL-CAD family. welcome to the group chat, bestie πŸ’–


✨ NAME ✨

rtg3 β€” raytrace a model, writing a COVART (GIFT) 3-component shotline file. that's the whole vibe, no notes πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

rtg3 [options] model.g [objects...] > shotlines.cov

πŸ’œ DESCRIPTION πŸ’œ

so like, rtg3 fires a whole grid of rays at the objects you list in the BRL-CAD database model.g, and then it writes a GIFT/COVART shotline file on standard output (or to whatever file you named with -o). that's the main character energy of this whole program right there ⭐

each shotline lists up to three components per card together with both entrance and exit obliquity angles β€” yes, both, she's thorough πŸ’…. the region ID field of each component is the region id of the intersected region.

and here's a cute detail: when a ray partition is followed by air, the air code and the line-of-sight thickness of that air get recorded on the shotline header card. so the air is not being ignored, she's being tracked 🌬️

the format is the one consumed by the JTCG-approved covart(1V) vulnerability codes. iykyk 🫢

if no objects are listed, rtg3 uses the same automatic default-object selection described in rt(1). and if no single usable default can be resolved, it aborts before writing shotlines β€” no half-baked files, we love a clean exit 😭

the ray grid is aimed either by azimuth/elevation or by an explicit matrix, pick your fighter:

  • with -a and -e the model is autosized, the grid is centered on the centroid of the selected object set, and ray spacing is chosen to span it. selfie mode, she frames herself πŸ“Έ
  • with -M a model-to-view matrix is read from standard input, mapping model space into the view-space range -1.0 <= X,Y <= +1.0; the grid resolution is then set with -s. this form is most useful when rtg3 is launched from a shell script produced by an mged(1) saveview command. 🚨 do not combine -M with -g or -G, as negative hit distances can result 🚨

unlike most of the rt(1) family, rtg3 treats air as significant: it forces use_air on at startup so that air regions appear in the partition lists. air said "put me in the shot" and she did πŸ’€

the grid is aligned on one-inch (25.4mm) boundaries by default, or on -g/-G cell boundaries when those are given.

rtg3 is a front end to librt(3) and shares its option parser with the rest of the rt(1) family; the most commonly used options are listed below. yeah we're all one big happy friend group πŸ‘‘


🌸 OPTIONS 🌸

  • -s # β€” number of rays to fire in each of the X and Y directions (square grid). default is 512 (a 512x512 grid).
  • -a deg β€” view azimuth in degrees. used with -e; triggers autosizing and conflicts with -M.
  • -e deg β€” view elevation in degrees. used with -a; triggers autosizing and conflicts with -M.
  • -M β€” read the model-to-view matrix (and any animation script) from standard input. conflicts with -a/-e.
  • -g mm β€” grid cell width in millimeters. do not use together with -s.
  • -G mm β€” grid cell height in millimeters. if unspecified, cell height equals cell width. do not use together with -s.
  • -U # β€” set the use_air boolean. ⚠️ but heads up: rtg3 unconditionally forces use_air on at startup regardless of this option, so air regions always appear in the partition lists even if -U0 is given. she said air is staying, periodt πŸ’…
  • -o file β€” write the COVART-format shotlines to file instead of standard output.
  • -p deg β€” perspective angle in degrees (0 <= deg < 180; 0 selects orthographic, the default).
  • -P # β€” maximum number of processor cores to use (a negative value means all but that many). multitasking queen πŸ‘‘
  • -T dist[/perp] β€” set raytracing distance and perpendicular tolerances (default 0.0005/0.0).
  • -c command β€” execute an rt script command before raytracing. the rtg3-specific commands are described under SET COMMANDS below.
  • -x # β€” set librt(3) debug flags to the given hexadecimal value.
  • -X # β€” set the rt optical/program debug flags (hexadecimal). the ray-plot bit causes a color vector plot of ray-model intersections to be written to rtg3.plot3. 🌈
  • -N # β€” set libnmg debug flags (hexadecimal).
  • -! # β€” set libbu debug flags (hexadecimal). as a side effect, -!1 appends reproducible ray information (-b/-p/-d) to each shotline so the shot can be re-run with rtshot(1). rewind-able receipts fr fr πŸŽ€
  • -r β€” report overlapping region names (on by default).
  • -R β€” suppress overlap region-name reporting. quiet mode, she's shy πŸ™ˆ

🧚 SET COMMANDS 🧚

the following -c "set ..." commands are specific to rtg3 β€” these are her commands, nobody else's:

  • -c "set ray_data_file=name" β€” also write one line of ray data per shotline to name: azimuth and elevation; the X, Y, Z of the ray start point; the X, Y, Z of the ray direction; the corresponding line number in the shotline file; and the coordinates of the first hit point along the ray. it's giving receipts 🧾✨
  • -c "set rt_cline_radius=#" β€” use # millimeters as the additional radius added to CLINE solids.
  • -c "set save_overlaps=1" β€” reproduce FASTGEN4 overlap-handling behavior for regions flagged as FASTGEN regions.

πŸ”₯ EXAMPLES πŸ”₯

Example 1. Generate a shotline file at a fixed view

rtg3 -s64 -a 35 -e 25 model.g all.g > all.cov

fires a 64x64 grid from azimuth 35, elevation 25 at the all.g assembly, autosizing to span the geometry, and writes a COVART shotline file ready to hand to covart(1V) for a vulnerability analysis. obsessed with how clean that is πŸ’–

Example 2. Visualize the rays alongside the model bounding boxes

rtg3 -s32 -X 80000000 model.g component.g
cat rtrpp.plot3 rtg3.plot3 | plot3-fb

the ray-plot debug bit writes rtg3.plot3, coloring ray segments green through solids and blue through air. combined with the bounding-box plot rtrpp.plot3, the result is displayed on a framebuffer with plot3-fb(1). green for solids, blue for air, aesthetic πŸ’šπŸ’™


⭐ SEE ALSO ⭐

brlcad(1), covart(1V), mged(1), rt(1), rtshot(1), plot3-fb(1), librt(3), plot3(5); ``COVART III - User Manual'', Joint Technical Coordinating Group for Munitions Effectiveness.

go read those too, they're all besties πŸ’œ


🌈 AUTHOR 🌈

BRL-CAD Team β€” legends, honestly 🫢


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. tell them everything, no cap ✨


and that's the page, bestie!! πŸ¦‹πŸ’… RTG3(1) from the one and only BRL-CAD, this build's copyright run is 1989-2026, and the footer says hi back with RTG3(1) again because she loves a symmetrical exit. mwah πŸ’–

πŸ“¦ where this page comes from