LinuxCommandLibrary

bcomps

Compare binary files part by part

TLDR

Decompose one or more graphs into their biconnected components

$ bcomps [path/to/input1.gv path/to/input2.gv ...] > [path/to/output.gv]
copy

Print the number of blocks and cutvertices in one or more graphs
$ bcomps -v -s [path/to/input1.gv path/to/input2.gv ...]
copy

Write each block and block-cutvertex tree to multiple numbered filenames based on output.gv
$ bcomps -x -o [path/to/output.gv] [path/to/input1.gv path/to/input2.gv ...]
copy

Display help
$ bcomps -?
copy

SYNOPSIS

bcomps [options] dbfile.g [objects ...]

PARAMETERS

-o file.g
    Output new database with grouped components to file.g.

-n
    Print only the number of top-level components.

-r
    Report (list) components without creating output database.

-s
    Suppress creation of output database (report mode only).

-g groupname
    Prefix for output group/combination names.

-v
    Enable verbose output during processing.

DESCRIPTION

bcomps is a utility from the BRL-CAD solid modeling suite that analyzes combinatorial geometry (CSG) models to identify and decompose them into topologically connected components. These include regions, shells, lumps, and coedges, providing insights into the model's structure.

It processes BRL-CAD .g database files, traversing the Boolean tree to find disconnected or independent parts. This is crucial for model validation, simplification, and preparation for rendering or analysis tools like rt or pic.

By default, it creates a new database grouping components under named combinations (e.g., "comps.1.region.1"). Users can opt for reporting only, counting components, or suppressing output. Ideal for large assemblies where manual inspection is impractical, it aids in detecting modeling errors like overlapping or floating geometry.

Output components retain original attributes, enabling further manipulation in MGED. It's non-destructive on input files and supports selective object processing.

CAVEATS

Processes only BRL-CAD .g files; input objects must form valid Booleans. Large models may require significant memory. No support for NURBS or other non-CSG geometry.

EXAMPLE USAGE

bcomps -o comps.g model.g
bcomps -r -n model.g tank.s

OUTPUT STRUCTURE

Components grouped as comps.N.region.M, preserving hierarchy and attributes for import into MGED.

HISTORY

Developed as part of BRL-CAD since the 1980s by the U.S. Army Research Laboratory. Evolved from early CSG tools in the 1979 BRL-CAD release, with modern enhancements for topology analysis in version 7.x+.

SEE ALSO

mged(1), rt(1), gqa(1), pic(1)

Copied to clipboard