GLTF-G(1)
π gltf-g β bestie's guide to GLTF-G(1)
okay so this is a page from the BRL-CAD manual set, and it's about gltf-g, and honestly? it's kind of iconic. let's get into it β¨
πΈ NAME πΈ
gltf-g β converts a glTF model into a BRL-CAD database. that's it. that's the vibe. π
β¨ SYNOPSIS β¨
gltf-g [-h] [-v] [-E] [-o output_file.g] input_file [output_file.g]
π¦ DESCRIPTION π¦
okay so gltf-g takes a glTF (that's GL Transmission Format, iykyk) model and turns it into a BRL-CAD geometry database. every single glTF mesh gets read in and written out as a Bag of Triangles (BoT) primitive in the output .g file. and here's the cute part: if a BoT's trimesh turns out to be a closed, manifold solid, it gets stored as a solid BoT β but if it's not, it's stored as a surface BoT. vibe check passed either way π«Ά
so how does it know which input format you're feeding it? it literally reads the input_file extension, no cap:
- a file ending in
.glbβ read as binary glTF - anything else (like
.gltf) β read as ASCII glTF
triangle index data can be stored as signed or unsigned 16- or 32-bit integers, and vertex positions can be single- or double-precision floating point. any other component types? skipped with a warning π that's just how it is.
and about the output database name β you can name it either positionally as the second argument or with the -o option. but not both, bestie. mutual exclusion, periodt. π
π OPTIONS π
-h,--helpβ prints a usage message and dips out. also, the-?flag is accepted as a synonym, because why not π-v,--verbosityβ turns the volume up on how much it tells you. you can pass it more than once: a single-vreports per-mesh vertex and face counts plus any parse warnings, and if you repeat it, it additionally dumps the individual vertex and face data. more-v, more tea β-ooutput_file.g,--outputoutput_file.g β sets the name of the output BRL-CAD database. it is mutually exclusive with giving the output file as a positional argument, so don't do both, fr fr.-E,--extensionsβ preserves the original JSON for glTF extras and extensions while parsing. keep the receipts, bestie π§Ύ
π EXAMPLES π
Example 1. Convert a binary glTF model and inspect the result
gltf-g -v model.glb model.g
mged model.g tops
this imports the binary glTF file model.glb into model.g, printing the mesh, vertex, and face counts as it works β then lists the top-level BoT objects of the new database with mged(1). chef's kiss π₯
Example 2. Convert an ASCII glTF model using the output flag
gltf-g -E -o scene.g scene.gltf
this reads the ASCII glTF file scene.gltf, retaining the original JSON for any extras and extensions, and writes the geometry to scene.g. ate and left no crumbs π
β SEE ALSO β
brlcad(1), mged(1), obj-g(1), stl-g(1), g-obj(1) β go read those too, they're all part of the family πΈ
π AUTHOR π
BRL-CAD Team β the main characters of this story π
π COPYRIGHT π
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. (yes, the actual U.S. Government. iconic behavior.)
π BUG REPORTS π
found a bug or a problem? don't suffer in silence, bestie β reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org π
ngl that's the whole page, and every last flag made it in. no details were harmed in the making of this rewrite π«Ά
and that's a wrap on this shiny BRL-CAD page, from the same people who brought you the rest of the manual set β go convert something gorgeous, babe π β¨
π¦ 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