Skip to documentation
DocumentationAll documentsEnglish

RTG3(1)

NAME

rtg3 - raytrace a model, writing a COVART (GIFT) 3-component shotline file

On this page

SYNOPSIS

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

DESCRIPTION

rtg3 fires a grid of rays at the listed objects in the BRL-CAD database model.g and writes a GIFT/COVART shotline file on standard output (or to the file named with -o). Each shotline lists up to three components per card together with both entrance and exit obliquity angles. The region ID field of each component is the region id of the intersected region. When a ray partition is followed by air, the air code and the line-of-sight thickness of that air are recorded on the shotline header card. The format is the one consumed by the JTCG-approved covart(1V) vulnerability codes.

If no objects are listed, rtg3 uses the same automatic default-object selection described in rt(1). If no single usable default can be resolved, it aborts before writing shotlines.

The ray grid is aimed either by azimuth/elevation or by an explicit matrix:

  • 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.

  • 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. 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.

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. Note that 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.

-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).

-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).

-r

Report overlapping region names (on by default).

-R

Suppress overlap region-name reporting.

SET COMMANDS

The following -c "set …​" commands are specific to rtg3:

-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.

-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.

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).

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.

AUTHOR

BRL-CAD Team

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