ASC2G(1)
π ASC2G(1) β the BRL-CAD glow-up pipeline π
okay so bestie, real talk: asc2g lives in the BRL-CAD family, and it's the little tool that takes your geometry database from its nerdy ASCII era and gives it the full binary makeover. π¦ no cap, it's giving "text file walks in, .g file walks out."
β¨ SYNOPSIS β¨
asc2g [-h] input.asc output.g
πΈ DESCRIPTION πΈ
asc2g converts a BRL-CAD geometry database from an ASCII format (the kind g2asc(1) makes) into the current binary .g format. literally its whole job. π
and the range?? impeccable. the tool accepts both the legacy record-based ASCII format and the current Tcl-script-based ASCII format (peep HISTORY π), automatically detecting which one is present β but it always writes the current ("v5") binary geometry database. no choosing, no options, it just knows. main character energy tbh.
both input.asc and output.g are required, and they must name different files. and the conversion is one shot: the entire ASCII file is read and a new binary database is created. no incremental nonsense, no do-overs, one and done. π₯
so here's the lore, bestie π: historically, the binary representation of a geometry database was architecture-dependent. asc2g and g2asc(1) were used to export databases to a portable ASCII form for transfer between systems. while that's lowkey no longer necessary for the architecture-independent "v5" binary format, the tools remain useful for:
- migrating legacy
"v4"databases - inspecting database contents in a human-readable form
- procedurally generating models via scripts
so likeβ¦ retired from its original job but still booked and busy. π
π OPTIONS π
-h,-?β prints a usage message and dips. that's it. that's the whole options list. iconic minimalism fr fr.
π¦ EXAMPLES π¦
Example 1. Round-trip a database through ASCII to migrate it between machines
g2asc model.g model.asc
scp model.asc remote:model.asc
ssh remote "asc2g model.asc model.g"
on the local machine, g2asc(1) serializes the binary database to a portable ASCII file, which gets copied to a remote host and converted back to a binary .g with asc2g. this is the classic workflow for moving geometry between systems, and it's also handy for round-tripping a database through a text editor or revision-control system. imagine your geometry going through git. the audacity. the slay. π«Ά
Example 2. Build a database from a hand-written or generated script
asc2g model.asc model.g
mged model.g ls
the current ASCII format is a Tcl script of geometry commands (for example put, attr, color, and title), so a database can be produced procedurally by emitting such a script and feeding it to asc2g. script writes script, model builds itself, we stan automation π the resulting model.g can then be opened with mged(1).
π FILES π
input.ascβ a file previously created usingg2asc(1)output.gβ the name of the file where the resulting binary database will be stored
β SEE ALSO β
brlcad(1), g2asc(1), mged(1) β the rest of the friend group, go say hi π«Ά
π DIAGNOSTICS π
the diagnostics are intended to be self-explanatory. unrecognized or unsupported records are skipped with a warning written to standard error. so like, it's not gonna scream at you, but it will leave a lil note. π
π HISTORY π
release 6.0 introduced a new ASCII format. this format is a Tcl script that β when executed by a simplified geometry command interpreter (in essence, a suitably empowered Tcl interpreter) β rebuilds the database from which it was derived. it's giving "the file remembers where it came from." β¨
in contrast, the old ASCII format consisted of a sequence of one-line records that corresponded to the old (v4) database format records. so very "before and after" of it all.
π DISCLAIMER π
bestie, listen to me, this part matters: the ASCII representation of BRL-CAD geometry databases is not a fixed format and is allowed to change without deprecation notice. π in general, this will not occur any more frequently than the binary geometry database format changes, though both are open specifications. regardless, the ASCII representation is subject to change without notice and should not be relied upon by external codes. (see HISTORY.) so don't build your whole personality on it. π
π§ AUTHOR π§
BRL-CAD Team β absolute legends, no notes.
πΈ COPYRIGHT πΈ
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. periodt.
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β tell them everything, they're so nice about it.
and that's the whole page, bestie!! π this one's from BRL-CAD, ASC2G(1), dated 1989-2026 in the copyright zone β go convert something cute. ππ¦π
π¦ 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