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_...
G-RAW(1)
NAME
g-raw - convert BRL-CAD geometry to RAW triangle facet format
On this page
SYNOPSIS
DESCRIPTION
g-raw converts the named object(s) from a BRL-CAD database.g file into the RAW triangle facet format. Each specified region is tessellated using the NMG boolean evaluator and written as a list of triangle vertex coordinates.
By default all converted geometry is written as a single stream to standard output. With -o the output is written to a named file, and with -m each region is written to its own file inside a directory; the two are mutually exclusive. When writing to a directory, file names are derived from the region’s full path name with "/" replaced by "@" and spaces and periods replaced by "_".
Coordinates are emitted in millimeters unless -i requests inches.
OPTIONS
- -v
-
Enable verbose output, reporting the objects processed and the tessellation and calculation tolerances in effect.
- -i
-
Emit vertex coordinates in inches instead of the default millimeters.
- -8
-
Tessellate using the marching cubes algorithm instead of the standard NMG boolean evaluation.
- -o output_file.raw
-
Write all output to the named file rather than standard output. Mutually exclusive with -m.
- -m output_directory
-
Write each converted region to a separate ".raw" file within the named directory. Mutually exclusive with -o.
- -a abs_tol
-
Set the absolute tessellation tolerance in millimeters. Specifying this disables the relative tolerance.
- -r rel_tol
-
Set the relative tessellation tolerance (fraction of bounding box size). The default is 0.01.
- -n norm_tol
-
Set the surface-normal tessellation tolerance in degrees. Specifying this 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
g-raw -o engine.raw engine.g block piston
Tessellates the regions named "block" and "piston" from engine.g and writes both as triangles into engine.raw.
mkdir parts
g-raw -i -m parts -a 0.1 model.g top_assembly
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.
SEE ALSO
brlcad(1), g-stl(1), g-obj(1), mged(1)
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