RTWEIGHT(1)
π rtweight(1) β the BRL-CAD girlies' mass-properties moment
okay so bestie, you know that one program in the BRL-CAD fam? yeah. rtweight. that's her. she's the one who tells you how heavy your geometry is and where its balance point lives, and honestly she ate. π
β¨ NAME β¨
rtweight β calculate mass, volume, and centroid of geometry via ray tracing π¦
πΈ SYNOPSIS πΈ
rtweight [options] model.g [objects...]
π DESCRIPTION π
so basically rtweight fires a whole grid of rays at the objects you listed inside the BRL-CAD database model.g, and then it takes the line-of-sight (LOS) thickness of each region, mixes in the per-material density, and bam β you get volume, mass, and the overall geometric centroid of the geometry. π₯ Boolean operations are honored, meaning overlapping or subtracted solids are accounted for correctly. she does not fumble the math, periodt.
if you don't list any objects, rtweight uses the exact same automatic default-object selection described in rt(1). and if no single usable default can be resolved? she aborts before computing mass properties. no vibe, no compute. π
density info comes from these sources, in order of preference:
- a density file named with
-d - a
_DENSITIEStable embedded inmodel.g - material objects in the database
- finally, a
.densityfile in the current directory
a density file has one entry per line: the integer material id, the density in grams per cubic centimeter, and the material name, separated by whitespace. regions whose material id has no density entry have their mass reported as undefined while their volume is still computed. (iykyk that's a little heartbreaking but she's doing her best π) see gqa(1) for more on defining and managing density information.
by default rtweight reports the mass of every region individually β by region path name and by region id β on top of the totals. use -R if you want only the summary, no per-region chaos. results are written in metric or English units, chosen from the database's editing units. π
rtweight accepts the same view, grid, and threading options as rt(1); the most useful ones are listed below. heads up though β the -C (background color) and -W (white background) options of rt(1) are disabled here. not invited to the party. π
β OPTIONS β
-dfile β read density definitions from file instead of from the database.-ofile β write the report to file rather than to standard output.-rβ report the mass of each region verbosely (this is the default, she's chatty like that π ).-Rβ suppress the per-region report and print only the totals. minimal queen behavior.-s# β fire a square grid of # by # rays (default512). conflicts with-g.-g# β set the grid cell width in millimeters. conflicts with-s.-G# β set the grid cell height in millimeters.-adeg β set the view azimuth in degrees. use with-e; conflicts with-M.-edeg β set the view elevation in degrees. use with-a; conflicts with-M.-Mβ read themodel2viewmatrix from standard input. conflicts with-aand-e.-P# β use at most # processor cores. the default is all available cores; a negative value means use all but that many. π-U# β set whether air-coded regions are retained (0= discard, the default;1= keep).-h,-?β print a help summary and exit.
most other rt(1) options (non-square views, perspective, tolerances, debugging flags, and so on) are also accepted. she's flexible. π§
π EXAMPLES π
Example 1. Total mass and centroid with a custom density file
rtweight -d steel.density -R -s 1024 engine.g block crankshaft > engine.wt
fires a 1024x1024 grid at the block and crankshaft regions of engine.g, using the material densities defined in steel.density, and writes only the volume, mass, and centroid totals to engine.wt. clean, focused, iconic. β¨
Example 2. Per-region breakdown using densities stored in the database
rtweight -a 35 -e 25 model.g hull
ray traces the hull assembly from azimuth 35, elevation 25 degrees, pulling density values from the _DENSITIES table (or material objects) inside model.g, and prints the mass of each contained region followed by the overall totals. the full breakdown, no crumbs. π
π«Ά SEE ALSO π«Ά
brlcad(1), rt(1), gqa(1), mged(1), librt(3)
π AUTHOR π
BRL-CAD Team
π COPYRIGHT π
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
ngl if something's giving broken, tell the devs β they genuinely want to know. π
and that's the whole page, bestie π this was rtweight(1) from the BRL-CAD manual set, part of the BRL-CAD docs, dated in that sweet 1989-2026 copyright window. go compute some mass. slay. πβ¨
π¦ 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