Skip to documentation
DocumentationAll documentsEnglish

MKBUILDING(1)

NAME

mkbuilding - generate parametric buildings and building parts

On this page

SYNOPSIS

mkbuilding [options] [output.g]

DESCRIPTION

mkbuilding creates physically dimensioned BRL-CAD building geometry from archetype presets, a native JSON specification, OpenStreetMap (OSM) data, or OGC CityJSON 2.x data. Lengths are interpreted as metres unless the input schema declares another unit.

The generated model separates walls, slabs and foundations, roofs, opening frames and panels, structural columns and beams, and installations into material-bearing regions. Exterior walls use Boolean subtraction for doors, windows, and unfilled openings. Floor slabs, closed roof solids, and structural members use the requested physical thicknesses and cross sections. Building parts are generated recursively.

The native schema is JSON Schema draft 2020-12. It covers identity and classification; arbitrary or rectangular footprints; above- and below-ground storeys; skipped lower storeys; envelope dimensions and materials; roofs; doors, windows, and openings; column and beam grids; installations; nested building parts; OSM tags; CityGML attributes; and extension metadata. Print the schema with --schema. Example files are installed with the source under src/shapes/building/examples.

OSM GeoJSON Feature and FeatureCollection inputs accept Polygon geometry and either direct OSM properties or a nested tags object. Overpass JSON ways with inline geometry are also accepted. All tags are retained as osm::key database attributes. The Simple 3D Buildings tags for height, minimum height, storeys, minimum storey, material, colour, roof geometry, and building parts are interpreted. Documented building= taxonomy values select an appropriate physical archetype; unknown values are retained and use a conservative house-like realization.

CityJSON 2.x Building and BuildingPart objects are accepted. Classification, function, usage, roof type, measured height, storey counts and heights, children, transforms, extents, and referenced geometry bounds are mapped into the generator. Source attributes remain available as cityjson::key database attributes. CityJSON input is currently converted to a procedural building envelope derived from its bounds; its original boundary surfaces are not copied verbatim.

OPTIONS

-o file.g, --output file.g

Write the output database to file.g. The default is mkbuilding.g. A single positional output filename is accepted for compatibility.

-s file.json, --spec file.json

Read a native JSON, OSM GeoJSON, Overpass JSON, or CityJSON specification.

-p name, --preset name

Start from house, apartments, office, warehouse, church, barn, garage, parking, greenhouse, sports_hall, silo, tower, civic, carport, shed, or service. An OSM building= value may also be used.

-t value, --type value

Set the OSM-compatible building type stored on the generated object.

-n name, --name name

Set the top-level object name.

-L count, --levels count

Set the number of above-ground storeys.

-W metres, --width metres

Set the rectangular footprint width. Must be used with --depth.

-D metres, --depth metres

Set the rectangular footprint depth. Must be used with --width.

-H metres, --floor-height metres

Set a uniform floor-to-floor height.

-R shape, --roof-shape shape

Set an OSM-compatible roof:shape. Use --list-roofs to show the implemented values.

--roof-height metres

Set roof height above the facade.

--wall-thickness metres

Set exterior wall thickness.

--structure system

Enable a structural column-and-beam grid and record its system name.

--no-auto-openings

Suppress automatically placed exterior doors and windows.

-f, --force

Replace an existing output database.

-j, --append

Append generated objects to an existing database.

--validate-only

Parse, normalize, and validate the input without writing geometry.

--effective-spec file.json

Write the fully resolved native specification after imports and command-line overrides.

--demo-file file.g

Generate a catalog containing at least 50 distinct building types and a nested building-part example. Generation fails if two catalog entries differ only in classification or appearance but have identical shape and structure.

--schema

Print the native JSON Schema and exit.

--list-types

List the covered OSM building taxonomy and exit.

--list-roofs

List supported OSM roof shapes and exit.

-h, -?, --help

Print usage information and exit.

EXAMPLES

Example 1. Generate a three-storey framed house
mkbuilding --preset house --levels 3 --structure wood_frame -o house.g
Example 2. Validate and generate an OSM GeoJSON building
mkbuilding --validate-only --spec building.geojson
mkbuilding --spec building.geojson -o building.g
Example 3. Generate a broad taxonomy catalog
mkbuilding --demo-file buildings.g

SEE ALSO

art(1), mged(1), rt(1), gqa(1)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 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