GLTF-G(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… 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 -v reports 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 β˜•
  • -o output_file.g, --output output_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 πŸ‘‘

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