Skip to documentation
DocumentationAll documentsEnglish

BB(nged)

NAME

bb - Report dimensional information about objects using Bounding Boxes

On this page

SYNOPSIS

bb [-c bbox_object_name.s] [-d] [-e] [-m] [-o] [-q] [-t] [-u] [-v] object1 [object2 object3 ...]

DESCRIPTION

bb calculates a bounding box for an object or set of objects supplied as arguments, and reports information about bounding box dimensions at the MGED command prompt. It supports various options, most of which control the type of information reported. It can optionally create an ARB8 in a database corresponding to the bounding box of the object(s). By default, an axis-aligned bounding box (AABB) is created, but support for an oriented bounding box (OBB) is available as well.

The objects list consists of one or more geometry objects in the current database.

-c bbox_object_name.s

Create an ARB8 primitive in the current database with the dimensions of the bounding box of the object(s) listed.

-d

Report dimensional information (length, width and height.) On by default.

-e

Report the extent of the bounding box using the min and max 3D points of the bounding box.

-m

Report the midpoint / center (x y z) of the bounding box.

-o

Calculate an oriented bounding box instead of an axis-aligned bounding box. This works for primitives, regions, all-up combinations, and multiple input objects. The default fast calculation transforms positive leaf bounds into model space and fits an oriented box to their corners. Subtraction uses its left operand and intersection uses a conservative common AABB. This generally produces a smaller box when geometry is not aligned with the model XYZ axes.

-q

Quiet mode - disable printing of the header, which is on by default. Useful when processing output from bb.

-t

Calculate a tight bounding box that accounts for subtracted (negative) geometry. The default bound is conservative and derived from the CSG tree. With -t, the box is instead derived from geometry evaluated by the ray tracer. A Cauchy-Crofton sampler fires reproducible spherical rays until its surface-area estimate stabilizes, then bounds the converged surface-point set. This bound is approximate and slower to compute than the default. Combine -t with -o for an evaluated oriented bounding box.

-u

Ignore air volumes when calculating the bounding box.

-v

Print the volume of the bounding box. On by default.

EXAMPLES

Example 1. Determine the size of the bounding box for a Havoc helicopter
mged> bb havoc
Bounding Box Dimensions, Object(s) havoc:
X Length: 1988.4 cm
Y Length: 1683.6 cm
Z Length: 625.0 cm
Bounding Box Volume: 2092246392.4 cm^3
Example 2. Report only the min and max points of a bounding box
mged> bb -q -e havoc
min {-759.447479 -8437.866455 -890.000000} max {19124.621094 8397.693207 5360.000000}
Example 3. Bounding Box for multiple components
mged> bb havoc_front havoc_middle havoc_tail
Bounding Box Dimensions, Object(s) havoc_front,  havoc_middle,  havoc_tail:
X Length: 1775.9 cm
Y Length: 358.0 cm
Z Length: 536.0 cm
Bounding Box Volume: 340782488.9 cm^3
Example 4. Create ARB8 Bounding Box
mged> bb -c havoc_parts_bbox.s havoc_front havoc_middle havoc_tail
Bounding Box Dimensions, Object(s) havoc_front,  havoc_middle,  havoc_tail:
X Length: 1775.9 cm
Y Length: 358.0 cm
Z Length: 536.0 cm
Bounding Box Volume: 340782488.9 cm^3
mged> l havoc_parts_bbox.s
havoc_parts_bbox.s:  ARB8
	1 (-75.9447, -158, -4.86374e-06)
	2 (-75.9447, -158, 536)
	3 (-75.9447, 200, 536)
	4 (-75.9447, 200, -4.86374e-06)
	5 (1700, -158, -4.86374e-06)
	6 (1700, -158, 536)
	7 (1700, 200, 536)
	8 (1700, 200, -4.86374e-06)

This software is Copyright (c) 2009-2026 United States Government as represented by the U.S. Army Research Laboratory.

BUG REPORTS

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

AUTHOR

BRL-CAD Team