G2ASC(1)
β¨ 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 π
π 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 β 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
- 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