Skip to documentation
DocumentationAll documentsEnglish

REGIONS(nged)

NAME

regions - write a region and Boolean member summary table to a file

On this page

SYNOPSIS

regions file object(s)

DESCRIPTION

The regions command traverses the hierarchy of one or more objects and writes a summary of all regions found to file. The file is opened in write mode and overwritten if it already exists.

regions is one of four related commands that all share the same underlying logic but produce different levels of detail:

Command Output detail

idents

Region-level summary only: region count, ident, air code, material code, LOS, and path. No primitives listed.

regions

Region-level summary with the Boolean formula (member names and operators) for each region.

solids

Full summary down to primitives: same as regions, plus the evaluated parameters of each primitive shape with accumulated transformation matrices applied.

tables

Not a valid standalone command. Invoking tables directly returns an input error. Use one of the three specific commands above.

Output format

The output file is a fixed-width text table. Each region entry includes the following fields in order:

  1. Region count — sequential index of the region as encountered.

  2. Region ID (ident) — the region’s identifier number.

  3. Air code — air region code (0 if not an air region).

  4. Material code (GIFTmater) — GIFT material code.

  5. LOS — line-of-sight percentage (0–100).

  6. Path — the full path from the listed object to the region.

  7. Boolean members — the list of member primitives and Boolean operators (u, -, +) forming the region. Combination sub-members are shown as RG entries; unknown object types as ??.

A header is written at the top of the file containing the command name, database filename, username, database title, units, and the list of objects processed.

After the table, a summary line is appended: Number Primitives = N Number Regions = N.

Primitive numbering

Each primitive in the Boolean formula is assigned a unique solid number in brackets (e.g. [3]). The same primitive used in multiple regions is assigned the same number if the accumulated transformation matrix is identical; a different transformation produces a different number. This uniqueness is tracked via a temporary file at /tmp/mged_discr.

EXAMPLES

Example 1. Write a regions summary for two groups

mged> regions regions_file group1 group2

Writes a region and Boolean member summary for all regions reachable from group1 and group2 to regions_file. The result string reports how many primitives and regions were processed.

Example 2. Write a summary for a specific top-level object

mged> regions hull_report.txt vehicle.c

Writes the regions table for all regions under vehicle.c to hull_report.txt.

SEE ALSO

idents(nged), solids(nged)

AUTHOR

BRL-CAD Team

BUG REPORTS

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