5. Converting From BRL-CAD
- 1. General Information About Converting From BRL-CAD
- 2. Converting to ACAD Format
- 3. Converting to AutoCAD DXF Format
- 4. Converting to EUCLID Format
- 5. Converting to IGES Format
- 6. Converting to Jack
- 7. Converting to STL Format
- 8. Converting to TANKILL Format
- 9. Converting to VRML Format
- 10. Converting to Wavefront Format
- 11. Converting to X3D Format
1. General Information About Converting From BRL-CAD
BRL-CAD export converters. contains the primary file formats (other than ASCII) to which BRL-CAD currently converts. Once again, the "g-" designation at the beginning of each converter name indicates that the conversion process begins with BRL-CAD’s standard geometry (.g) format.
Note that most of the BRL-CAD export converters operate by tessellating all the primitive shapes in the BRL-CAD model, then evaluating the Boolean formula for each region. The result of this is a facetted representation of each region. The tessellation tolerances are used to determine the coarseness of the tessellation of curved surfaces. Smaller tolerances result in more, smaller facets and a larger output file. The calculation tolerance is the minimum distance between any two vertices in a region. Any vertices closer than this are fused into a single vertex.
CAD format | Export Converter |
---|---|
ACAD |
g-acad |
AutoCAD DXF |
g-acad |
EUCLID [1] |
g-euclid |
IGES |
g-iges |
Jack |
g-jack |
STL |
g-stl |
TANKILL |
g-tankill |
VRML |
g-vrml |
Wavefront (.obj) |
g-wave |
X3D |
g-x3d |
Occasionally, the Boolean evaluation process will fail. When this happens, an error message specifying the region that failed to convert will be generated. The converter will then proceed to work on the next region to be converted.
2. Converting to ACAD Format
The Advanced Computer Aided Design (ACAD) format is the format for the in- house CAD package developed in the early 1980s by Lockheed Martin Tactical Aircraft Systems (then General Dynamics - Fort Worth) and distributed since 1995 by the Electromagnetic Code Consortium. The package was developed to improve the product design process by eliminating manual drawing boards and reducing design iteration cycle times. Notable aircraft programs that have used ACAD include the Joint Strike Fighter (F-35), the Raptor (F-22), the Advanced Technology Fighter, the National Aerospace Plane (X-30), and the Attack/Fighter-Experimental (A/F-X) (SURVICE Engineering Company, 2002).
A notable characteristic of ACAD is the layers by which modeled parts are separated and managed (e.g., by subsystem). The package stores geometric data in a relational database that uses parent-child dependencies to enable automatic and rapid geometric modification. For example, changing a control spline of a fuselage will automatically regenerate any surface(s) built with that spline. Any geometry that is associated to the fuselage surface (i.e., plane/curve and surface intersections, fillets, etc.) will then regenerate.
One of ACAD’s strengths is its bidirectional IGES translator, which provides compatibility with other IGES-supported formats, including CADAM, CATIA, COMPUTERVISION, AutoCAD, and Pro/E.
As its name implies, the g-acad
utility converts a file in BRL-CAD
format to a file in facetted ACAD format. The form of the command is
as follows:
g-acad [options] -o output_file input.g object(s)
The options for the g-acad command are as follows:
-i
-
designates that the output be in inches (the default is millimeters).
-x lvl
-
sets librt debug flag (see
raytrace.h
in the binary distribution for definitions of DEBUG_xxx). -X lvl
-
sets the NMG library debug flag (see
nmg.h
in the binary distribution for definitions of DEBUG_xxx). -e error_file
-
sends error messages to specified file (default is standard error
stderr
]). -v
-
verbose; prints out progress information.
-D tolerance_distance
-
sets distance calculation tolerance (in millimeters) (default is 0.005).
-r rel_tess_tol
-
sets relative tessellation tolerance (normally 0.0 to 1.0) (default is 0.1).
-a abs_tess_tol
-
sets absolute tessellation tolerance to specified value (in millimeters) (overrides
-r
option). -n norm_tess_tol
-
sets surface normal tessellation tolerance (angle in radians) (overrides
-r
option).
For more information on the ACAD file format and conversion potential, contact Lockheed Martin Tactical Aircraft Systems at http://www.lockheedmartin.com ( Lockheed Martin , 2003).
3. Converting to AutoCAD DXF Format
The g-dxf command converts BRL-CAD objects to the previously mentioned AutoCAD DXF format. The syntax for this command is as follows:
g-dxf [options] input.g object(s)
The options for the g-dxf command are as follows:
-i
-
requests the output DXF file to be in inches (default is millimeters).
-o output.dxf
-
specifies the file to receive the DXF output (default is stdout).
-p
-
requests that the output DXF file consist of POLYFACE MESH entities (the default is 3DFACE entities).
The command also accepts the -v
, -r
, -a
,
-n
, -x
, and -X
options, which have been discussed
in the import converters portion of this document
(Converting to
BRL-CAD).
For more information on the DXF file format and export possibilities, see the on-line documentation on the Autodesk web site at http://www.autodesk.com ( Autodesk, Inc. , 2003).
4. Converting to EUCLID Format
The g-euclid
command converts BRL-CAD objects to a EUCLID "decoded"
facetted format. Note that, as previously mentioned, this format is
not native EUCLID format. The form of the command is as follows:
g-euclid [options] input.g objects(s)
The options for the g-euclid
command are as follows:
-u units
-
sets the output units (the default is millimeters).
-o output_file_name
-
sets the output file name (the default is
stdout
).
For more information about the EUCLID file format and export possibilities, see the MDTVISION web site at http://support.mdtvision.com (MDTVISION, 2003).
5. Converting to IGES Format
The syntax for the BRL-CAD to IGES converter is as follows:
g-iges
[options] input.g object(s)
The options for the g-iges command are as follows:
-o output_name
-
indicates the name of the resulting IGES file. If the m option is specified, then this is the name of a directory where resulting IGES files will be placed (the directory must already exist). (The default is
stdout
.) -f
-
designates that the resulting IGES file will be entirely facetted BREP entities. The
-f
and-t
options (the next option discussed) are mutually exclusive. -t
-
designates that the resulting IGES file will be entirely trimmed NURB entities similar to the
-f
option, but each facet is represented as a trimmed NURB. The-f
and-t
options are mutually exclusive. -m
-
Each region in the specified objects is output in an individual IGES file and placed in the directory specified with the
-o
option. This option implies the-t
option. -s
-
Used in conjunction with the
-f
or-t
options to indicate that the facets should all be expressed as planar NURB surfaces rather than the default simple planar surface.
With the -t
and -f
options, the converter will employ
Boolean evaluation of each region. If neither option is specified,
then a CSG IGES file will be produced. The command also accepts the
previously mentioned -v
, -r
, -a
, -n
,
-x
, and -X
options.
For more information about the IGES file format and export possibilities, see the NIST web site at http://www.nist.gov/iges (NIST, 2003).
6. Converting to Jack
The syntax for the jack-g converter is as follows:
jack-g [options] input.jack output.g
The options for the jack-g command are as follows:
-r region_name
-
specifies the name of the region to create in the BRL-CAD output (by default, this name is constructed from the input filename).
-g combination_name
-
specifies the name of a combination to be created to hold the region produced. If not specified, no combination will be created.
For more information about the Jack file format and export possibilities, see the EDS web page at http://www.eds.com/products/plm/efactory/jack (EDS, 2003a).
7. Converting to STL Format
The syntax for the BRL-CAD to STL converter is as follows:
g-stl [options] input.g object(s)
The options for the g-stl
command are as follows:
-o output_name
-
specifies the name of the file to receive the STL format output. This option is mutually exclusive with the m option. (The default is
stdout
.) -m directory_name
-
specifies the name of an existing directory where output STL files will be placed. This option is mutually exclusive with the
-o
option. When this option is exercised, each region in the specified object(s) is output in a separate file written to the specified directory. The file names will be based on the BRL-CAD database path to the region, with "/" characters replaced by "@" and "." characters replaced by "_". -b
-
produces binary format STL files. The combination of this option and the
-o
option produces a binary STL file containing one solid object representing all the regions in the specified object(s). (The default output format is ASCII.) -D calculation_tolerance
-
sets the distance calculation tolerance (in millimeters) (the default is 0.005).
-i
-
produces an STL file in units of inches (the default is millimeters).
The command also accepts the previously mentioned -v
,
-r
, -a
, -n
, -x
, and -X
options.
For more information on the STL file format and export possibilities, see the 3D Systems web site at http://www.3dsystems.com (3D Systems, 2003).
8. Converting to TANKILL Format
As discussed previously, the TANKILL format is another purely triangulated representation of solid objects.
The syntax for the g-tankill command is as follows:
g-tankill [options] input.g object(s)
The options for the g-tankill
command are as follows:
-i idents_file
-
specifies that the ident numbers in the output file should be assigned sequentially as BRL-CAD regions are encountered (rather than using the ident numbers assigned in the BRL-CAD file). A mapping of the assigned ident numbers and the BRL-CAD regions is written to the specified idents_file.
-s surroundings_code
-
specifies the surroundings code, which is a code TANKILL uses to indicate the type of volume that surrounds an object (the default is 1000).
-o output_name
-
specifies the name of a file to receive the output (default it
stdout
).
The command also accepts the previously mentioned -v
,
-r
, -a
, -n
, -x
, and -X
options.
For more information on the TANKILL file format and export possibilities, contact the Advantage Business Group at the Barbician, East Street, Farnham, Surrey GU9 7TB or visit the web site at http://www.advantage-business.co.uk (Advantage Business Group, 2003)
9. Converting to VRML Format
The Virtual Reality Modeling Language (VRML) began in 1994 at the first World Wide Web Conference. The format — which is maintained by the nonprofit, vendor-neutral Web3D Consortium — was designed to be a Web-interoperable standard for specifying multiparticipant 3-D graphical visualization tools. When a user selects a hyperlink to a VRML document from within a correctly configured WWW browser, a VRML viewer is launched to navigate through a given geometry (e.g., a model of a building). Future versions of VRML are planned to include more advanced features, including animations, motion physics, and real-time multiuser interaction (Web3D Consortium, 2003b).
The g-vrml command converts BRL-CAD objects to the VRML 2.0 format. It takes the following form:
g-vrml [options] input.g object(s)
The options for the command are as follows:
-d tolerance_distance
-
sets distance calculation tolerance in millimeters (the default is 0.005).
-u units
-
sets the desired output units (the default is millimeters).
-o output_file_name
-
sets output file name (the default is
stdout
).
The command also accepts the previously mentioned -v
,
-r
, -a
, -n
, -x
, and -X
options.
For more information on VRML, see the Web3D Consortium web site at http://www.web3d.org /fs_technicalinfo.htm (Web3D Consortium, 2003b).
10. Converting to Wavefront Format
The Wavefront OBJ format was developed in 1984 by Wavefront Technologies (now Alias , a company that merged with Wavefront under SGI ). The format, which was intended for use with the Wavefront Advanced Visualizer, consists of lines, polygons, and smooth surfaces.
This g-wave
converter produces an OBJ file that consists entirely of
polygons (triangles). The command takes the following form:
g-wave [options] input.g object(s)
The options for the command are as follows:
-m
-
includes "usemtl" statements in the output (encoded aircode, los, and material number).
-i
-
sets the output units to inches (the default is millimeters).
-d tolerance_distance
-
sets distance calculation tolerance in millimeters (the default is 0.005).
-u
-
includes vertexuse normals in the output.
-o output.obj
-
specifies the output file name (default is
stdout
).
The command also accepts the previously mentioned -v
,
-r
, -a
, -n
, -x
, and -X
options.
For more information on the Wavefront file format and export possibilities, see the Alias web site at http://www.alias.com/eng/index.shtml (Alias, 2003).
11. Converting to X3D Format
The successor to the Web3D Consortium’s VRML format, the Extensible 3D (X3D) format was designed to be a standard for interactive web- and broadcast-based 3-D content. Its intended uses include engineering and scientific visualization, multimedia presentations, entertainment and educational applications, web pages, and shared virtual worlds. It is also intended to serve as a universal interchange format for integrated 3-D graphics and multimedia. X3D possesses several improvements over VRML, including advanced APIs, additional data encoding formats, stricter conformance, and a componentized architecture that allows for a modular approach (Web3D Consortium, 2003a).
The g-x3d
command converts BRL-CAD objects to the X3D format. It
takes the following form:
g-x3d [options] input.g object(s)
The options for the command are as follows:
-d tolerance_distance
-
sets distance calculation tolerance in millimeters (the default is 0.005).
-u units
-
sets the desired output units (the default is millimeters).
-o output_file_name
-
sets output file name (the default is
stdout
).
The command also accepts the previously mentioned -v
,
-r
, -a
, -n
, -x
, and -X
options.
For more information on the X3D file format and export possibilities, see the Web3D Consortium web site at http://www.web3d.org/technicalinfo/specifications/ISO_IEC_19775 (Web3D Consortium, 2003a).