CONCAT(nged)

merge objects from an external database file into the current database

πŸ“… published 7.44.0, from nixpkgs unstable

✨ CONCAT πŸ’… (from the nged manual)

okay bestie so this page is all about concat, one of the BRL-CAD User Commands, and honestly it's giving "glow-up for your database" energy 🌈

πŸŽ€ NAME πŸŽ€

concat β€” merge objects from an external database file into the current database. that's it. that's the vibe. πŸ¦‹

🌸 SYNOPSIS 🌸

concat [options] file.g [affix]

πŸ’– DESCRIPTION πŸ’–

okay so picture this: concat reads geometry objects out of the external BRL-CAD database file.g and merges them, like, straight into the database you currently have open. iconic behavior honestly πŸ‘‘

here's the drama though β€” what if a name collision happens between an incoming object and one that already exists? 😭 by default concat just automatically generates a unique name for the incoming object, no stress, no tears. that is, UNLESS you use -O to overwrite. then it's on sight πŸ’€

you can also pass an optional affix string to slap a prefix or suffix onto incoming object names. the -p and -s flags are the ones in charge of whether that affix goes on the beginning or the end of each name. and by default (that's with -L), the affix is only applied lazily β€” like, only to names that actually conflict. without -L, the affix goes on every single incoming name. every one. no exceptions 🫢


⭐ Options ⭐

  • -h, --help β€” print help and exit. your little escape hatch πŸ™ˆ
  • -O, --overwrite β€” overwrite existing objects when names conflict, instead of generating a shiny new unique name. bold move, love that for you πŸ”₯
  • -c β€” use the incoming database's region color table instead of the current database's. aesthetic upgrade ✨
  • -p, --prefix β€” apply the affix string to the beginning of incoming object names (prefix mode, obviously πŸ’…)
  • -s, --suffix β€” apply the affix string to the end of incoming object names (suffix mode, also obviously πŸ’…)
  • -L, --lazy-affix β€” apply the affix only when needed to resolve name conflicts, not to every incoming name. without this flag, the affix gets applied to all names whenever an affix is provided. lowkey the chill option 😌
  • -t β€” use the incoming database's title string instead of the current database's title.
  • -u β€” use the incoming database's unit settings instead of the current database's units. units matter, bestie, no cap πŸ“

πŸ¦‹ EXAMPLES πŸ¦‹

Example 1. Merge a database without renaming

mged> concat other.g

merges all objects from other.g into the current database. any name collisions get resolved by automatically incrementing names. easy, breezy πŸ“

Example 2. Merge with a prefix applied to all incoming names

mged> concat -p other.g imported_

merges all objects from other.g, prefixing every incoming name with imported_. so like, hull.r becomes imported_hull.r. the way that just works πŸ˜­πŸ’–

Example 3. Merge with a suffix applied lazily on conflict only

mged> concat -s -L other.g _v2

merges objects from other.g, appending _v2 only to names that collide with existing objects. minimal effort, maximum slay 🌸

Example 4. Overwrite on conflict

mged> concat -O other.g

merges other.g, silently overwriting any existing objects with the same name. silent but deadly πŸ’€

Example 5. Merge and use the incoming color table and units

mged> concat -c -u other.g

merges other.g and adopts its color table and unit settings. new db, new me 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

dbconcat(nged), keep(nged) β€” go read those too, iykyk 🫢

πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” legends, fr fr πŸ‘‘

⭐ BUG REPORTS ⭐

found a bug? a problem? something cursed? 😭 reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. they want the tea, bestie πŸ’Œ


and that's the whole page!! this iconic little writeup lives in BRL-CAD, source/version BRL-CAD, dated alongside the CONCAT(nged) header β€” mwah, go merge something beautiful πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from