RTAREA(1)

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

πŸ’… RTAREA(1) β€” the rtarea girlies' guide πŸ’…

okay so bestie, welcome to rtarea(1) from the BRL-CAD fam πŸŽ€ this is the page where we learn how to ask "how much surface area is actually facing the camera rn" and get a genuinely useful answer. let's go πŸ’–


✨ NAME ✨

rtarea β€” computes the exposed and presented surface areas of geometry, from a view πŸ‘€

✨ SYNOPSIS ✨

rtarea [options] model.g [objects...]

✨ DESCRIPTION ✨

so rtarea uses librt(3) to ray trace the objects you list in the database model.g, from one single view direction, and then reports the projected surface area of each region, of each assembly (that's a combination containing regions, iykyk), plus the overall totals 🫢 the view is set with -a (azimuth) and -e (elevation), or by feeding a model-to-view matrix on standard input with -M. all results go to standard output as text. iconic behavior, no cap.

if you don't list any objects, rtarea falls back to the same automatic default-object selection described in rt(1). and if no single usable default can be resolved, it aborts before computing any areas β€” it's not gonna guess for you πŸ™ˆ

two areas get reported, and the difference actually matters:

  • exposed area β€” the occluded 2D projection. this is literally what an observer would see if every object were opaque, so an object hiding behind another only contributes its visible fraction πŸ’€
  • presented area β€” the unoccluded 2D projection. each region is considered in isolation and reports its full silhouette, no matter what's sitting in front of it.

and here's the cute detail: when you're totaling presented area for a group, area covered by more than one region gets counted only once (the union of the regions), not the cumulative sum. math girlies stay winning ✨

only surfaces whose normal has a component facing back toward the ray are counted, so back faces don't get reported as presented area. bye πŸ‘‹

accuracy depends on the grid resolution: finer cell spacing (smaller -g/-G, or larger -s) yields more accurate areas. area centers are off by default and can be enabled with -c "set cc=1".

okay and here's the diagram situation, because visual learners deserve nice things 🌸

|----------------| rear region          |----------------| rear region
|                |                      |****************|
|        |--------------| front region  |****************-------| front region
|        |**************|               |***********************|
|--------|**************|               |--------|**************|
         |**************|                        |**************|
         |--------------|                        |--------------|

  exposed = presented area of front       exposed = presented area for groups
  region (fully visible)                  (e.g. comb of both visible regions)
|----------------| rear region          |----------------| rear region
|****************|                      |****************|
|********|--------------| front region  |****************-------| front region
|********|              |               |****************       |
|--------|              |               |--------|              |
         |              |                        |              |
         |--------------|                        |--------------|
  exposed area of rear                    presented area of rear
  region (partially occluded)             region (partically occluded)
⚠️ Warning ⚠️ the terminology and the output format of rtarea may change in future releases. so don't get too attached to the exact text, bestie πŸ’€

✨ OPTIONS ✨

  • -a azimuth β€” sets the view azimuth in degrees and enables auto-sizing. use it with -e; it conflicts with -M 🫢
  • -e elevation β€” sets the view elevation in degrees and enables auto-sizing. use it with -a; it conflicts with -M ✨
  • -M β€” reads a model-to-view transformation matrix (plus an optional animation script) from standard input, instead of using -a/-e πŸŽ€
  • -s # β€” sets the square grid size to # rays on a side (default 512). more rays = better area accuracy, periodt πŸ”₯
  • -w # β€” sets the grid width in rays.
  • -n # β€” sets the grid height in rays (scanlines).
  • -g mm β€” sets the grid cell width in millimeters. if you set it without -G, the cell height defaults to the same value (e.g. -g 25.4 gives 1 inch ray spacing β€” love a unit conversion moment πŸ’…).
  • -G mm β€” sets the grid cell height in millimeters.
  • -p deg β€” sets the perspective angle in degrees (0 <= deg < 180; 0 is orthographic, and that's the default).
  • -V #[:#] β€” sets the view aspect ratio width/height (e.g. 1.33 or 4:3).
  • -u units β€” reports areas in the named units (default mm). use -u model for the database's local units 🌈
  • -U # β€” sets whether air-coded regions are retained (0 = discard, 1 = keep, and 1 is the default for rtarea).
  • -P # β€” sets the maximum number of processor cores to use (negative = all but #). parallel girlies rise 🧚
  • -c command β€” runs an rt script command before ray tracing; may be repeated ⭐ rtarea recognizes set compute_centers=# (or the alias set cc=#) where 1 enables and 0 disables (default) computation and reporting of area centers.
  • -x # β€” sets librt debug flags as a hexadecimal bit vector (see raytrace.h).
  • -X # β€” sets rt program/optical debug flags as a hexadecimal bit vector.
  • -? or -h β€” prints a usage summary and exits. the "help me help you" move 🫢

✨ EXAMPLES ✨

Example 1. areas of a group with centers, in inches

rtarea -u in -a 35 -e 25 -s 1024 -c "set cc=1" model.g all

ray traces the group all in model.g from azimuth 35, elevation 25 degrees on a 1024x1024 grid, reporting exposed and presented areas in square inches along with the center of each area. increasing the grid size and naming explicit units gives a more accurate, readable report than the defaults. she understood the assignment πŸ‘‘

Example 2. front-view area from a saved MGED view

rtarea -M model.g component < saveview.rt

reuses the camera from an mged(1) saveview script (the matrix gets read from standard input via -M), so the area of component is measured from exactly the view that was set up interactively. chef's kiss, no notes 😭


✨ SEE ALSO ✨

brlcad(1), mged(1), rt(1), rtweight(1), librt(3) β€” go read the whole friend group πŸ’œ

✨ 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 β€” tell them everything, they want to know πŸ’–


okay that's the whole page bestie, you're basically an area-measuring legend now 🌈✨ this has been RTAREA(1) from BRL-CAD, and honestly? iconic of it. go compute something slay πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from