Skip to documentation
DocumentationAll documentsEnglish

DBCONCAT(nged)

NAME

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

On this page

SYNOPSIS

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

DESCRIPTION

Concatenates an existing BRL-CAD database to the database currently being edited. Note that each BRL-CAD object must have a unique name, so naming rules are defined that will automatically rename conflicting objects as they are merged in to a databse.

If conflicting names are encountered, by default computer-generated prefixes or suffixes will be added to the object names coming from the incoming database_file. If the user wishes to simply overwrite the current objects, the -O option may be supplied and behavior is changed to all incoming objects overwriting an original object with it conflicts. Note that using this option is destructive - old geometry is not preserved when being overwritten. Consequently this should only be used when the intent is to NOT preserve the original data.

Alternatively, if an affix string is supplied, then objects from the incoming database_file will have the affix added to their names as a prefix (by default or if the -p option is specified), or as a suffix (if the -s option is specified). By default this string is added to ALL incoming object names, but if -L is specified in either mode the affix string is used only when resolving name conflicts.

Other options are used to indicate whether or not to preserve incoming metadata such as title, units and region color table.

OPTIONS

-h, --help

Print help and exit.

-L, --lazy-affix

Apply the affix (either as a prefix or suffix) only when trying to resolve name conflicts.

-O, --overwrite

Overwrite objects in the current .g file in cases where incoming object names conflict. (WARNING: this option is destructive - old data is replaced by new.)

-c

Indicates that the region color table of the currently edited database should be replaced with that of database_file.

-p, --prefix

Use the supplied affix string as a prefix when reading in object names. (Default.)

-s, --suffix

Use the supplied affix string as a suffix when reading in object names.

-t

Indicates that the title of the currently edited database should be replaced with that of database_file.

-u

Indicates that the units of the incoming database_file should become the units of the currently edited database.

EXAMPLES

This example shows the use of the dbconcat command to copy all objects in a particular database to the current database. It also 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. If there is a still a conflict even with the prefix applied standard rules will continue to be applied for additional name generation.

Another example shows a usage to import the title, units, color table, and all the objects of a database file into the current database. This is particularly useful if the current database is empty or just created by mged.

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.

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

AUTHOR

BRL-CAD Team

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org