G2ASC(1)

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

✨ NAME ✨

g2asc β€” convert a BRL-CAD geometry database from binary to ASCII. G2ASC(1) has entered the chat, brought to you by BRL-CAD πŸ’–

🌸 SYNOPSIS 🌸

g2asc [-h] input.g output.asc

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so g2asc reads a binary BRL-CAD .g geometry database and writes out an ASCII representation of it. It’s the converse of asc2g(1) β€” together these two are a little filter duo for moving geometry between binary and ASCII forms. Iconic pair behavior, honestly πŸ‘‘

The output format depends on the version of the input database. A modern "v5" database gets exported as a Tcl command script (a sequence of put, attr, and similar commands). An older "v4" database gets exported in the legacy one-line record format. Different eras, different vibes, both handled ✨

The "v5" binary format is already machine independent, so converting to ASCII is no longer required merely to transfer a database between differing computer architectures. g2asc remains useful for inspecting, editing, or diff'ing geometry as text. Lowkey the text mode is where the main character energy lives πŸ’…

Both an input and an output file name are required. Either may be given as a single dash (-) to use standard input or standard output, but a dash is rejected for "v5" databases: those must be named regular files. Also, the input and output may not refer to the same file. No sneaky same-file nonsense, bestie 🚫

πŸ’… OPTIONS πŸ’…

  • -h, β€”help β€” print a usage summary and exit. The hidden alias -? is also accepted. We see you, secret little alias πŸ‘€

πŸŽ€ EXAMPLES πŸŽ€

Example 1. Round-trip a database through ASCII to edit it as text

g2asc model.g model.asc
sed -i 's/old_part/new_part/g' model.asc
asc2g model.asc model_edited.g

Export model.g to a text file, rename an object with a stream editor, then reimport the result with asc2g(1). This text round-trip is handy for bulk edits or scripted fixups that are awkward inside mged(1). Literally a glow-up pipeline for your geometry 🧚

Example 2. Inspect what changed between two databases

g2asc before.g before.asc
g2asc after.g after.asc
diff before.asc after.asc

Convert two binary databases to ASCII and diff them to see exactly which objects and parameters differ, which is impossible directly on the binary form. Spy on your geometry’s diff era, periodt πŸ”₯

🌈 SEE ALSO 🌈

asc2g(1), brlcad(1), mged(1)

πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team

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 β€” don’t suffer in silence, bestie 😭


That’s the whole page from BRL-CAD β€” source/version: BRL-CAD, manual: G2ASC(1), date: the footer didn’t print one, so I’m not inventing one πŸ˜­πŸ’… bye bestie! πŸ’–

πŸ“¦ where this page comes from