DBCONCAT(nged)

Concatenates an existing BRL-CAD database to the database currently being edited.

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… DBCONCAT πŸ’… (a.k.a. the nged girlies' favorite copy-paste moment)

okay so bestie, real talk: this is a BRL-CAD User Command and it lives inside nged. It's the "bring your whole other database over here" command. Slay.


✨ NAME ✨

dbconcat β€” concatenates an existing BRL-CAD database to the database you're currently editing. that's it. that's the whole vibe. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

dbconcat [-h] [-t] [-u] [-c] [-s|-p] [-L] [-O] {database_file} [affix]
dbconcat [--help] [--lazy-affix] [--overwrite] [--prefix] [--suffix] {database_file} [affix]

two forms, same energy. short flags or long flags, pick your fighter. ✨


🌸 DESCRIPTION 🌸

So you want to merge an existing BRL-CAD database into the one you're currently editing? iconic. dbconcat does exactly that.

But here's the thing, and this is highkey important β€” every BRL-CAD object needs a unique name. so this command has, like, rules. naming rules. defined ones. it'll automatically rename conflicting objects as they get merged in. no cap. πŸ‘‘

If conflicting names show up, by default the command adds computer-generated prefixes or suffixes to the object names coming from the incoming database_file. cute, right?

Now. if you'd rather just overwrite the current objects, you can pass the -O option and the whole behavior changes: every incoming object overwrites an original object when there's a conflict. But bestie. listen to me.

⚠️ using -O is destructive β€” old geometry is not preserved when it gets overwritten. only use this when your whole intent is to NOT preserve the original data. do not come crying to me later. πŸ’€

Alternatively, if you supply an affix string, then objects from the incoming database_file get that affix added to their names as a prefix (that's the default, or if you specify -p), or as a suffix (if you specify -s). and by default this string gets added to ALL incoming object names β€” but if -L is specified in either mode, the affix string is only used when resolving name conflicts. lazy but make it fashion. πŸŽ€

The other options are all about whether or not to preserve incoming metadata, like title, units, and the region color table. yes queen, your metadata matters. πŸ’œ


πŸŽ€ OPTIONS πŸŽ€

  • -h, β€”help β€” prints help and dips. that's it. goodbye. πŸ‘‹
  • -L, β€”lazy-affix β€” apply the affix (prefix or suffix) only when trying to resolve name conflicts. lowkey efficient.
  • -O, β€”overwrite β€” overwrite objects in the current .g file when incoming object names conflict. (WARNING: this option is destructive β€” old data is replaced by new.) πŸ™ˆ
  • -c β€” means the region color table of the database you're currently editing gets replaced with the one from database_file. give it a glow-up. 🌈
  • -p, β€”prefix β€” use the supplied affix string as a prefix when reading in object names. (this is the default, bestie.) ⭐
  • -s, β€”suffix β€” use the supplied affix string as a suffix when reading in object names. πŸ“
  • -t β€” means the title of the database you're currently editing gets replaced with the one from database_file. πŸ’–
  • -u β€” means the units of the incoming database_file become the units of the database you're currently editing. consistency is key. ✨

πŸ”₯ EXAMPLES πŸ”₯

okay this first one is the classic: copy all objects from a particular database into the current database. and bonus, it shows how to add a particular prefix to every object copied.

Example 1. Copy objects in a specified database to the current one and lazily apply a prefix to the copied objects. 🧚

mged>dbconcat -L model_two.g two_

Copies all the objects in model_two.g to the current database, using the specified prefix two_ to attempt to resolve name conflicts. and if there's still a conflict even with the prefix applied? standard rules keep on applying for additional name generation. the grind never stops. πŸ’…


Another example β€” this one imports the title, units, color table, and all the objects of a database file into the current database. it's especially useful if the current database is empty or was just created by mged. fresh start energy. 🌱

Example 2. Copy an entire database, including title, units, and color table, to the current database without any affix πŸ¦‹

mged>dbconcat -t -u -c model_two.g

Copies all the objects in model_two.g to the current database, including the title, units, and color table. No suffix or prefix is added to the object names. clean. minimal. iconic. 🀍


Example 3. Copy a database, overwriting objects in the current databse πŸ’€

mged>dbconcat -O model_two.g

Copies all the objects in model_two.g to the current database. No object names are changed while conflicts in the current database are overwritten with objects from model_two.g. (yes, databse. we don't gatekeep typos here. 🫢) and again β€” overwriting means the old stuff is gone. you've been warned. πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” the main characters, honestly.


πŸ› BUG REPORTS πŸ›

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. pls be nice to them, they're doing great. πŸ’–


go forth and concatenate, bestie. your databases are gonna look so good together. πŸ’…βœ¨

β€” brought to you by the BRL-CAD girlies, page DBCONCAT(nged), BRL-CAD build, mwah πŸŽ€

πŸ“¦ where this page comes from