G-STL(1)
π G-STL(1) β the BRL-CAD manual page, but make it make sense π
okay bestie so this is g-stl from the BRL-CAD fam (yes that BRL-CAD, the one your CAD professor keeps hyping) β let's get into it β¨
β¨ NAME β¨
g-stl β convert BRL-CAD geometry to the STL file format π¦ like, it takes your big fancy BRL-CAD model and turns it into something a 3D printer can actually vibe with.
πΈ SYNOPSIS πΈ
g-stl [-bvi8] [-x rt_debug] [-X nmg_debug] [-a abs_tol] [-r rel_tol] [-n norm_tol] [-D dist_tol] [-o output_file.stl | -m directory] database.g object ...
no cap, that's the whole shape of it π
π DESCRIPTION π
g-stl converts the specified object(s) from a BRL-CAD database.g file into the stereolithography (STL) file format by tessellating the geometry into triangle facets via the NMG boolean evaluator. Lowkey the whole point: it smashes your smooth geometry into lil triangles so machines can read it. STL is widely used for 3D printing and rapid prototyping β it's giving "the people's format" ngl π¨οΈβ¨
By default an ASCII STL stream is written to standard output. With -o a single STL file (ASCII or, with -b, binary) is produced; with -m each region is written to a separate file in the named directory, with the region's path name mangled into the file name ("/" becomes "@" and spaces or periods become "_"). Yes, mangled β that's the actual word and the actual behaviour, she's a little chaotic but she works π
β οΈ Binary output cannot be sent to standard output. So if you pass-byou need-oor-m, no exceptions, periodt.
Output units default to millimeters; see -i. Related converters include g-obj(1), g-ply(1), and stl-g(1) for the reverse direction (iykyk β that one goes STL β BRL-CAD π¦).
β¨ OPTIONS β¨
-bβ Write a binary STL file instead of the default ASCII format. Compact, slay, chef's kiss. But binary output cannot be written to standard output, so-oor-mis required β fr fr, don't skip that part.-vβ Enable verbose output, reporting object names, tolerances, and conversion statistics. Main character energy: she tells you everything she's doing π£οΈ-iβ Use inches as the output units (the default is millimeters). USA USA πΊπΈ lol.-8β Tessellate using the marching cubes algorithm rather than the default NMG boolean evaluation. Different vibe, different triangles π-aabs_tol β Set the absolute tessellation tolerance in millimeters (the maximum chord deviation). Setting this clears the relative tolerance. So it's one or the other, bestie β no having both π«Ά-rrel_tol β Set the relative tessellation tolerance as a fraction of the bounding box (default0.01).-nnorm_tol β Set the surface normal tessellation tolerance in degrees. Setting this clears the relative tolerance. Same deal as-aπ-Ddist_tol β Set the calculation distance tolerance in millimeters used to decide whether two vertices are coincident (default0.0005). Tiny number, huge consequences π§-xrt_debug β Set the librt debugging flags as a hexadecimal value. Debug girlies rise π₯-Xnmg_debug β Set the libnmg debugging flags as a hexadecimal value. Same energy, different library.-ooutput_file.stl β Write all converted geometry to the named output file. Mutually exclusive with-mβ pick a lane, bestie π-mdirectory β Write each region to its own STL file inside the named directory. Mutually exclusive with-o. One solid per file, very organized of her π-h,-?β Print a usage message and exit. The "help I forgot the flags" button π
π EXAMPLES π
Example 1. Convert a component to a binary STL file for 3D printing
g-stl -b -i -a 0.1 -o bracket.stl model.g bracket
Tessellates the bracket region from model.g with a 0.1 mm absolute tolerance, writing a compact binary STL in inch units suitable for slicing and printing. Cute, tiny, printable β she ate π
Example 2. Export every region of an assembly to separate files
mkdir parts
g-stl -m parts model.g assembly
Walks the assembly tree and writes one ASCII STL file per region into the parts directory, each named after the region's full path. This is convenient when downstream tools expect a single solid per file. Iconic behavior honestly π
π SEE ALSO π
brlcad(1), stl-g(1), g-obj(1), g-ply(1), g-dxf(1), mged(1)
(the whole converter friend group π)
π AUTHOR π
BRL-CAD Team β legends, no notes.
β 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
not me telling you to email your bugs, but like, do email your bugs π§π
aaaand that's the page! mwah π β with love from the BRL-CAD crew, dated all the way back to 1989 and running through 2026, G-STL(1) forever π«Άβ¨
π¦ 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