rtweight [options]...
RTWEIGHT(nged)
NAME
rtweight - Calculate mass, centroid, and volume of geometry using raytracing
On this page
SYNOPSIS
DESCRIPTION
The rtweight command calculates the volume, weight, and centroid of the currently drawn object(s). Output will include values per region as well as an overall calculation. These values are calculated by shooting rays at the current azimuth and elevation. By default, rtweight will shoot a 512x512 grid at the screen. The -s flag can be used to specify a different grid and the -g flag can be used to specify a gridsize in millimeters.
The rtweight command requires density information to run. It can use density information stored directly in a .g database, read a .density file in the home directory, or read a density file specified by the -d flag. A specified file with the -d command takes precedence, then embedded density information, and finally the .density file is used. If using an external density file the file must contain lines with the material number, density in g/cc, and material name, each separated by some white space. See the gqa and mater manual pages for more information about defining and managing density information.
The following options are recognized.
- -s#
-
Number of rays to fire in X and Y directions (square grid). Default is 512 (512x512). Conflicts with -g
- -g#
-
Distance between rays in the X and Y directions in millimeters. Conflicts with -s
- -d file
-
Read density information from the specified file.
- -R
-
Disable overlap reporting.
- -r
-
Enable overlap reporting (on by default).
- -o file
-
Send the output to a specified file.
- -P#
-
Specify the maximum number of processor cores to be used on multicore systems. The default is the maximum number of cores available for the machine. Negative numbers indicate using all except for the count specified.
EXAMPLES
mged>rtweight -s1024
Runs rtweight using 1024x1024 rays.
mged>rtweight -g10
Runs rtweight at a gridsize of 10 millimeters (regardless of model units).
mged>rtweight -d density.txt
Runs rtweight and uses the density.txt file located in the current directory.
mged>rtweight -o weightfile.txt
Runs rtweight and outputs the results to weightfile.txt
COPYRIGHT
This software is Copyright (c) 1987-2026 United States Government as represented by the U.S. Army Research Laboratory.
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to <bugs@brlcad.org>.
AUTHOR
BRL-CAD Team