G-RAW(1)

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

πŸ’… G-RAW(1) β€” the g-raw page, bestie edition πŸŽ€

okay so you found the g-raw page in the BRL-CAD manual set, and honestly? you're about to have a great time. this one's from the BRL-CAD crew and it's literally the glow-up pipeline from BRL-CAD geometry to RAW triangle facets. let's get into it ✨


🌸 NAME 🌸

g-raw β€” converts BRL-CAD geometry into the RAW triangle facet format. that's it. that's the whole vibe. πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

g-raw [-vi8] [-x rt_debug] [-X nmg_debug] [-a abs_tol] [-r rel_tol] [-n norm_tol] [-D dist_tol] [-o output_file.raw | -m output_directory] database.g object...

like, yes, that's a lot of brackets, but hear me out β€” every single one of them is doing something. πŸ‘‘

πŸ’« DESCRIPTION πŸ’«

so g-raw takes the object(s) you named and pulls them out of a BRL-CAD database.g file, converting them into the RAW triangle facet format. each region you specify gets tessellated using the NMG boolean evaluator and then written out as a list of triangle vertex coordinates. that's the whole serve. πŸ”₯

by default, all the converted geometry goes out as one single stream to standard output. no cap. but if you pass -o the output lands in a named file instead, and if you pass -m each region gets its own file inside a directory. the two are mutually exclusive β€” pick one, you can't have both, that's the rules bestie. πŸ’…

when you're writing to a directory, the file names are derived from the region's full path name, with "/" replaced by "@" and spaces and periods replaced by "_". so your paths stay cute and filesystem-safe. πŸŽ€

coordinates come out in millimeters unless -i asks for inches. millimeters is the default, don't come for me. 🫢


✨ OPTIONS ✨

  • -v β€” turn on verbose output! it reports the objects processed plus the tessellation and calculation tolerances that are actually in effect. very "let me tell you everything" of it. πŸ™ˆ
  • -i β€” emit vertex coordinates in inches instead of the default millimeters. yep, that's the whole flag. ⭐
  • -8 β€” tessellate using the marching cubes algorithm instead of the standard NMG boolean evaluation. different algorithm, same goal. 🧚
  • -o output_file.raw β€” write all output to the named file rather than standard output. mutually exclusive with -m (i said what i said). πŸ’€
  • -m output_directory β€” write each converted region to its own separate ".raw" file inside the named directory. mutually exclusive with -o. πŸ“
  • -a abs_tol β€” set the absolute tessellation tolerance in millimeters. heads up: specifying this disables the relative tolerance. 😭
  • -r rel_tol β€” set the relative tessellation tolerance, expressed as a fraction of the bounding box size. the default is 0.01. πŸ‘‘
  • -n norm_tol β€” set the surface-normal tessellation tolerance, in degrees. specifying this also disables the relative tolerance. 🌈
  • -D dist_tol β€” set the calculation distance tolerance in millimeters, used to decide whether two vertices are coincident. the default is 0.0005. 🌸
  • -x rt_debug β€” set the librt debug flags, given as a hexadecimal value. πŸ”
  • -X nmg_debug β€” set the libnmg debug flags, given as a hexadecimal value. πŸ”

πŸŽ€ EXAMPLES πŸŽ€

Example 1. Convert selected regions to a single RAW file

g-raw -o engine.raw engine.g block piston

this tessellates the regions named "block" and "piston" from engine.g and writes both of them as triangles into engine.raw. two regions, one file, iconic. πŸ’–

Example 2. Export every region to its own file in inches

mkdir parts
g-raw -i -m parts -a 0.1 model.g top_assembly

this walks the "top_assembly" tree in model.g, tessellating each region with an absolute tolerance of 0.1 mm, and writes a separate ".raw" file per region into the "parts" directory β€” with coordinates expressed in inches. the mkdir parts first is not optional, she needs a home. πŸ¦‹


πŸ’œ SEE ALSO πŸ’œ

brlcad(1), g-stl(1), g-obj(1), mged(1) β€” go read those too, iykyk. πŸ“š

🌟 AUTHOR 🌟

BRL-CAD Team β€” legends, honestly. πŸ‘‘

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. periodt. πŸ‡ΊπŸ‡Έ

🫢 BUG REPORTS 🫢

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. if something's acting up, tell them β€” don't suffer in silence, bestie. πŸ’Œ


ok that's the whole page, no skips, no summaries, every flag accounted for. now go tessellate something gorgeous. ✨

and finally, the cutest sign-off: this little beauty is from BRL-CAD, page G-RAW(1) β€” mwah, go ship some triangles πŸ’…πŸŽ€

πŸ“¦ where this page comes from