RTSHOT(1)
π RTSHOT β the manual page for BRL-CAD's single-ray icon π
okay so bestie, welcome to rtshot(1) β the BRL-CAD manual page that's literally about shooting one ray and telling you everything it smooched on the way through. no cap, it's the most main-character little tool in the whole suite. let's get into it π
β¨ NAME β¨
rtshot β fire a single ray at a BRL-CAD model and report what it hits β
π¦ SYNOPSIS π¦
rtshot {-p|-d|-a} _x_ _y_ _z_ {-p|-d|-a} _x_ _y_ _z_ [options] model.g [objects...]
π DESCRIPTION π
so rtshot fires one single ray at the objects you list inside the BRL-CAD database model.g, and then prints a textual summary of every region the ray passes through β the in and out hit points, surface normals, surface curvature, the regions claiming stuff for any overlaps, and optionally whatever region attributes you asked for. it's giving "x-ray vision but make it text" π₯
if you don't name any objects, rtshot will attempt to use a deterministic database default object. and omitting objects only works when that resolver finds exactly one usable geometry object β like a valid _GLOBAL default_object attribute, exactly one top-level geometry object, exactly one combination, exactly one combination matching the database filename, or exactly one top-level combination whose name begins with all or scene. π
heads up bestie: if default selection is disabled, if you name an unusable geometry object, if it's ambiguous, or if there's just no deterministic match βrtshotprints the resolver's explanation and exits with"no objects specified."π
now the ray itself: you define it by supplying exactly two of these three options β a start point (-p), a direction vector (-d), and a point to shoot "at" (-a). when -a is combined with -d, the start point is backed off from the "at" point by half the model diagonal so the ray begins outside the geometry. and the direction vector is always normalized. always always. π«Ά
rtshot is a thin front-end to librt(3) intended for inspecting and debugging geometry β it's literally the command-line analog of the ray that a single pixel of rt(1) would cast. iconic behavior honestly π
πΈ OPTIONS πΈ
-p_x_ _y_ _z_ β set the ray starting point.-d_x_ _y_ _z_ β set the ray direction vector (it gets normalized before use, don't worry).-a_x_ _y_ _z_ β set the point the ray is fired "at".-U_#_ β set reporting of air regions. the default is1(air is reported).-o_#_ β set theonehitflag, stopping the ray after the given number of hits (0, which is the default, means no limit).-r_#_ β set the maximum ray length, in millimeters. the default of0means unlimited.-O_keyword_ β set overlap-claimant handling. accepts a keyword or its numeric equivalent:resolve(or0, the default) β resolves all overlaps so none appear in the outputrebuild_fastgen(or1) β mimics FASTGEN4 plate-mode behaviorrebuild_all(or2) β rebuilds and reports every overlap along the rayretain(or3) β does not resolve overlaps
-v"attr1 attr2 ..." β report the listed region attribute names (and their values) for each region hit. the names are given as a single space-separated string. π-A_name_ β report, for each region carrying the named attribute, the hit points and ray direction transformed into that region's local (untransformed) coordinate system via the inverse of its placement matrix.-n_#_ β set the number of rings to use for a ray bundle (the central ray is not counted).-c_#_ β set the number of rays per ring for a ray bundle. the rings spiral outward and are not aligned ring-to-ring; a central ray is always included.-R_#_ β set the ray bundle radius, in millimeters. the outermost ring lies at this radius.-g_#_ β set the grid spacing, in millimeters, for a circular-grid ray bundle (the default is1mm).-u_#_ β set thelibbu(3)debug flags (hexadecimal).-x_#_ β set thelibrt(3)debug flags (hexadecimal).-X_#_ β set the optical/rt program debug flags (hexadecimal). setting the ray-plot bit writes a plot of the ray and its hits tortshot.plot3. π-N_#_ β set the NMG debug flags (hexadecimal).
π RAY BUNDLES, THE VIBE CHECK π
a ray bundle can be cast in two ways, bestie, pick your fighter:
- supplying both
-nand-c(with an optional-Rradius) fires a spiral ring bundle whose results are merged as a single ray. - supplying only
-R(with an optional-ggrid spacing) fires a circular grid of parallel rays.
the default is to fire a single ray. just one. solo. main character energy β¨
π₯ EXAMPLES π₯
Example 1. Fire a ray down the X axis at a component
rtshot -p 0 0 0 -d 1 0 0 havoc.g hull
shoots a single ray from the origin in the +X direction at the hull region of havoc.g, printing the in/out points and normals of each region encountered. slay π
Example 2. Aim at a known point and list a material attribute
rtshot -a -1000 0 500 -d -1 0 0 -v "material_id" model.g engine
fires a ray toward the point (-1000, 0, 500) heading in the -X direction, with the start point automatically placed outside the geometry, and prints the material_id attribute of every region the ray strikes. this is a quick way to verify which components and materials lie along a line of sight. lowkey the most useful thing ever π
Example 3. Use the database default object
rtshot -p 0 0 0 -d 1 0 0 single.g
shoots the ray at single.g's automatically selected default object. this form is valid only when the database default-object rules resolve exactly one usable object. in a database with multiple top-level candidates and no explicit _GLOBAL default_object, name the intended object after model.g. no shortcuts, bestie π€
π§ SEE ALSO π§
brlcad(1), mged(1), rt(1), rtarea(1), nirt(1), librt(3), plot3(5)
π DIAGNOSTICS π
numerous error conditions are possible. descriptive messages are printed on standard error. that's it, that's the tea π
π AUTHOR π
BRL-CAD Team π«Ά
β COPYRIGHT β
this software is Copyright (c) 1987-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 β they will read it, fr fr π
okay that's the whole page!! this all comes to you straight out of BRL-CAD, and it's the rtshot(1) manual page β go shoot a single ray at something and think of me πβ¨π
π¦ 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