comgeom-g [-h] [-?] [-d debug_lvl] [-v version_num] [-s name_suffix] input_file output_file
COMGEOM-G(1)
NAME
comgeom-g - convert GIFT COMGEOM model into MGED database
On this page
SYNOPSIS
DESCRIPTION
comgeom-g reads a COMGEOM format model from a GIFT-style input file, converts the geometry into the internal form used by the BRL-CAD package, and writes an MGED-style binary database.
Each solid is given the name s, retaining the COMGEOM solid number. Each region is given the name r, retaining the COMGEOM region number. Regions are grouped together into various groups g### based on their region-id numbers. Group g00 gets all regions with a region-id of zero, g0 gets ids 1 through 99, g1 gets ids 100 through 199, etc.
In the resulting database, a high-level group all.g is created. The units used in a COMGEOM file are specified on a header record, while the units of an MGED database are always millimeters. comgeom-g performs automatic units conversion using the built-in units conversion feature of libwdb(3).
OPTIONS
- -d debug_lvl
-
Set the debug/verbosity level. By default (level 0) the program reports only the title, units, and major errors. Any nonzero level enables verbose status reports describing the expected file layout and the progress of the conversion, which is useful for large or problematic models.
- -h, -?
-
Print a usage summary and exit.
- -s name_suffix
-
Append the specified suffix to the names of all generated solids, regions, and groups (but not the top-level all.g group). Any leading period must be included in the suffix. The suffix is limited to 15 characters.
- -v input_vers#
-
Specify the COMGEOM input format version. The default is version 5 (cg5); version 4 is also supported. Version 1 selects the DoE MORSE/RAFFLE format (believed to be the original MAGIC format). Any other value is rejected.
EXAMPLES
comgeom-g -d 1 -v 4 model.cg model.g
Converts the COMGEOM version 4 input model.cg into the BRL-CAD database model.g, printing the expected file layout and per-item progress reports during the conversion. Raising the debug level is the quickest way to find which solid or region card a malformed input file is choking on.
comgeom-g -s _a model_a.cg combined.g
comgeom-g -s _b model_b.cg combined.g
Because comgeom-g appends to an existing output database rather than overwriting it, two COMGEOM models can be merged into one BRL-CAD database. The -s suffixes ("a" and "_b") keep the auto-generated s, r, and g### names from each model distinct so they do not collide in _combined.g. The result can then be inspected with mged(1).
DIAGNOSTICS
The diagnostics are intended to be self-explanatory. Familiarity with GIFT COMGEOM terminology will be helpful.
BUGS
It is expected that the input file should be a valid COMGEOM model. While quite a bit of input checking is performed, wildly incorrect input may produce amusing results.
SEE ALSO
brlcad(1), mged(1), libwdb(3)
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