g-iges [-f|-t|-m] [--flatten-brep] [-s] [-v] [-a _abs_tol_] [-r _rel_tol_] [-n _norm_tol_] [-d _dist_tol_] [-P _ncpu_] [-x _rt_debug_] [-X _nmg_debug_] [-o _output_file_] _database.g_ [_output.igs_] [_object_ ...]
G-IGES(1)
NAME
g-iges - convert a BRL-CAD database to an IGES file
On this page
SYNOPSIS
DESCRIPTION
g-iges converts the specified object(s) from a BRL-CAD database.g database into an IGES version 5.3 file.
By default a CSG IGES file is produced: every region is written as a Boolean tree, with each solid represented by its IGES CSG equivalent. Any solid that has no IGES CSG equivalent uses a primitive B-Rep conversion where available, including general truncated cones, oblique cylinders, pipes, extrusions, clines, and legacy B-splines. Already-faceted geometry keeps its polygonal representation. Tessellation is a fallback for other supported geometry when no usable primitive B-Rep conversion is available; it is controlled by the tessellation tolerances. Native OpenNURBS B-Reps are written with IGES manifold topology (type 186), preserving shared vertices, edges, loops, faces, shells, and NURBS geometry. The -f, -t, and -m options select alternative output modes and are mutually exclusive.
CLINE plate-mode geometry is exported with fixed wall thickness. Its native ray-dependent line-of-sight thickness cannot be represented exactly in IGES; the exporter reports this limitation.
Temporary B-Reps produced by native primitive callbacks receive the same conservative closed-shell orientation check used by iges-g. Clearly inverted isolated shells are corrected before export, with a diagnostic. This does not change the source database or reorient authored B-Rep inputs; open, nested, overlapping, and uncertain shells are left unchanged.
An output filename ending in .igs or .iges (case-insensitive) may follow the input database, as in g-iges input.g output.igs. Remaining arguments select objects; when a destination is given without objects, all top-level objects are exported. The -o option overrides a positional destination and supports output filenames without an IGES extension. In multi-file mode, an existing output directory may take the place of the positional filename. If the candidate destination also names an object in the database, -o is required to disambiguate; that positional argument then selects the object.
If neither form specifies a destination, the IGES file for the named objects is written to standard output. The inverse translation, from IGES to BRL-CAD, is performed by iges-g(1).
Long conversions report their current operation, elapsed time, and completed top-level selections about every five seconds. Counts describe source items, not an estimate of remaining time.
OPTIONS
- -f
-
Facetized B-Rep output. Every region is tessellated, its Boolean operations are evaluated, and the result is written as a single manifold-solid B-Rep object. Tessellation accuracy is governed by -a, -r, and -n.
- -t
-
Trimmed-surface output (experimental). Each region is written as a collection of trimmed NURBS derived from the facets of the tessellated, Boolean-evaluated region.
- -m
-
Multi-file output: write a separate IGES file for each converted region occurrence. Implies -t, and the output destination must name an existing directory in which the per-region files are created. Repeated regions retain their individual assembly placements. Names are sanitized and numbered to avoid overwriting another occurrence or an existing file.
- -s
-
Write NMG facets using NURBS surfaces and boundary curves instead of analytic planes and lines. This does not tessellate native OpenNURBS B-Reps.
- --flatten-brep
-
Write native OpenNURBS B-Reps as independent type 144 trimmed surfaces instead of type 186 manifold topology. This compatibility mode is intended for older readers that do not implement IGES 5.3 B-Rep entities. Exact surfaces and trimming curves are retained, but shared topology is not represented explicitly in the file. The faces remain grouped so instances reference the entire original object.
- -a abs_tol
-
Absolute tessellation tolerance, in millimeters. Default 0.0 (disabled).
- -r rel_tol
-
Relative tessellation tolerance, as a fraction of object size. Default 0.01.
- -n norm_tol
-
Surface-normal tessellation tolerance. Default 0.0 (disabled).
- -d dist_tol
-
Minimum distance between distinct points, in millimeters. Default 0.0005.
- -P ncpu
-
Requested maximum worker count. Default 1. IGES conversion currently runs serially to protect record ordering and NMG error recovery; larger positive values are accepted with a diagnostic.
- -v
-
Include entity-type counts in the export summary.
- -x rt_debug
-
Set the librt raytrace debug flag (hexadecimal). See raytrace.h for values.
- -X nmg_debug
-
Set the NMG debug flag (hexadecimal). See nmg.h for values.
- -o output_file
-
Write the IGES output to output_file, overriding a positional destination. With -m, this argument must be a directory. File output is staged beside its destination. Input/output aliases are rejected before writing, and an I/O failure does not replace an existing destination. A diagnosed partial conversion may publish its usable geometry while returning a nonzero status.
EXAMPLES
g-iges assembly.g assembly.iges hull turret
Writes the hull and turret regions of assembly.g as a CSG IGES file, preserving the Boolean tree where IGES primitive equivalents exist and using B-Rep representations for other supported geometry.
g-iges -f -a 0.1 -n 0.01 -o widget.iges widget.g widget
Tessellates the widget region to within an absolute tolerance of 0.1 mm and a surface-normal tolerance of 0.01 radians, then writes it as a manifold-solid B-Rep, suitable for downstream CAD packages that prefer evaluated geometry over CSG.
mkdir parts
g-iges -m -o parts model.g topgroup
Writes each region under topgroup as its own trimmed-NURBS IGES file inside the parts directory, which is convenient for importing assemblies part-by-part.
EXIT STATUS
Zero indicates successful conversion. A nonzero status indicates an error, including missing requested objects or omitted solids or combinations. A partial IGES file may still contain usable geometry; consult the diagnostics before using it.
SEE ALSO
brlcad(1), iges-g(1), g-step(1), mged(1)
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