RTWEIGHT(nged)

Calculate mass, centroid, and volume of geometry using raytracing

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… rtweight (nged) β€” the glow-up ✨

okay bestie, so this is rtweight from the nged manual β€” she's a BRL-CAD MGED command and she's lowkey iconic πŸ’–

🌸 NAME 🌸

rtweight β€” calculates mass, centroid, and volume of your geometry using raytracing. that's it, that's the whole vibe 🫢

⭐ SYNOPSIS ⭐

rtweight [options]...

πŸ¦‹ DESCRIPTION πŸ¦‹

so the rtweight command does the math on the volume, weight, and centroid of whatever object(s) you currently have drawn. the output gives you values per region AND an overall calculation, so you get the whole picture, not just the group chat summary πŸ’…

how does she do it? by shooting rays at the current azimuth and elevation, periodt. by default, rtweight shoots a 512x512 grid at the screen. you can use the -s flag to pick a different grid, or the -g flag to specify a gridsize in millimeters β€” pick your fighter ✨

now the important part, no cap: rtweight requires density information to run. it can pull density from:

  1. density info stored directly in a .g database,
  2. a .density file in the home directory, or
  3. a density file you point at with the -d flag.

and here's the precedence order, bestie, memorize it 🧠: a file specified with -d wins, then embedded density information, and finally the .density file.

if you're using an external density file, it's gotta contain lines with the material number, density in g/cc, and material name β€” each separated by some white space. also go check out the gqa and mater manual pages for more on defining and managing density information, iykyk πŸ“š

the following options are recognized πŸ‘‘

✨ OPTIONS ✨

  • -s# β€” number of rays to fire in the 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 (this one's on by default, so she's already on, slay) πŸ”₯
  • -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 mean use all of them except for the count you specified β€” yes really, that's the rule 🧚

πŸŽ€ EXAMPLES πŸŽ€

Example 1. use rtweight to calculate the total volume and weight of the currently drawn group using a specified number of rays

mged>rtweight -s1024

runs rtweight using 1024x1024 rays. more rays, more accurate, more main character energy ⭐

Example 2. use rtweight to calculate the total volume and weight of the currently drawn group using a specified gridsize

mged>rtweight -g10

runs rtweight at a gridsize of 10 millimeters (regardless of model units β€” yes, regardless, don't come for me) πŸ“

Example 3. use rtweight to calculate the total volume and weight of the currently drawn group and specify a density file

mged>rtweight -d density.txt

runs rtweight and uses the density.txt file located in the current directory πŸ“

Example 4. use rtweight to calculate the total volume and weight of the currently drawn group and specify an output file

mged>rtweight -o weightfile.txt

runs rtweight and outputs the results to weightfile.txt πŸ’Ύβœ¨


this software is Copyright (c) 1987-2026 United States Government as represented by the U.S. Army Research Laboratory. fr fr, that's the actual line 🫑

πŸ’€ BUG REPORTS πŸ’€

reports of bugs or problems should be submitted via electronic mail to <bugs@brlcad.org>. not me begging you to actually report them πŸ™ˆ

🌈 AUTHOR 🌈

BRL-CAD Team β€” the icons, the legends, the moment πŸ’œ


okay that's the whole page, bestie!! go calculate some centroids πŸ’…βœ¨ source/version: BRL-CAD, and the page is RTWEIGHT(nged) β€” that's the footer info, wrapped up cute for you πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from