The DIRSIG Geometric Database (GDB) file was originally created in the late 1980’s with the original version of DIRSIG when 3D computer graphics was still in its infancy and standards for 3D polygon data had not yet been established. These days there are many commonly used file formats for 3D polygon geometry, but many of these still lack support for some of the features provided by the GDB format. For that reason it is still frequently used in the creation of DIRSIG scenes.
General File Structure
A GDB file has a hierarchy of data contained within it. At the top of the hierarchy are one or more objects, which can contain one of more parts, which can contain one or more facets. This 3-level hierarchy is a natural fit for most objects. Consider an object (a "car") that has multiple components (the "hood", a "door", the "front bumper", etc.) and each component is composed of multiple polygons. Most GDB files created today contain only a single object and employ features of the Object Database file to combine multiple objects in order to create a complex scene. However, some older GDB files exist that contain multiple objects.
The following example GDB file is used to describe the format in more detail. It illustrates the basic hierarchy using a single facet that belongs to a single part, which belongs to a single object:
OBJECT car 1-0-0 PART hood 1-1-0 FACE hood_1 1-1-1 steel 36 FACET 0.0 1.0 0.0 0.0 NULL NULL NULL 4 +5.000000e-01 -5.000000e-01 0.000000e+00 +5.000000e-01 +5.000000e-01 0.000000e+00 -5.000000e-01 +5.000000e-01 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 0.00000000000000000000e+00 0.00000000000000000000e+00 1.00000000000000000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 END
Object Header
The start of a new object is marked by the OBJECT
tag, followed by a
line containing the name of the object (for example, "car"), followed by
an ID string:
OBJECT car 1-0-0
The name of an object does not need to be unique within a GDB file |
The object ID string is no longer used in modern versions of DIRSIG. |
Part Header
The start of a new part is marked by the PART
tag, followed by a
line containing the name of the part (for example, "bumper"), followed by
an ID string:
PART hood 1-1-0
The name of an part does not need to be unique within a GDB file |
The part ID string is no longer used in modern versions of DIRSIG. |
Facet Header
The start of a new facet is marked by the FACE
tag, followed by a
line containing the name of the facet (for example, "bumper_1"), followed by
an ID string:
FACE hood_1 1-1-1
The name of a facet does not need to be unique within a GDB file |
The facet ID string is no longer used in modern versions of DIRSIG. |
Facet Data
The next block of data describes the attributes and geometry off the facet.
Facet Attributes
The first block of data in the facet description are the attributes associated with the facet.
-
Material name (unused)
-
Material ID (used for material look-up)
-
Name (unused)
-
Temperature in Celsius (a value of
0
or-1
forces the temperature to be computed). -
Thickness in centimeters (used by the thermal model and/or extinction property)
-
Self-generated power (unused)
-
Exposed area (unused)
-
(reserved field, unused)
-
(reserved field, unused)
-
(reserved field, unused)
steel 36 FACET 0.0 1.0 0.0 0.0 NULL NULL NULL
Facet Geometry
The next line contains the number of vertexes in the facet (DIRSIG only supports 3-sided or 4-sided facets). The next N lines are the X,Y,Z coordinates of the N vertexes for the facet. The next line is the explicitly defined surface normal for the facet.
The GDB file does not follow a right-handed (or left-handed) rule for computing the surface normal from the vertexes. The surface normal is explicitly defined in the geometry description. |
The last 3 lines are reserved for future use (currently unused).
4 +5.000000e-01 -5.000000e-01 0.000000e+00 +5.000000e-01 +5.000000e-01 0.000000e+00 -5.000000e-01 +5.000000e-01 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 0.00000000000000000000e+00 0.00000000000000000000e+00 1.00000000000000000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
Following the end of a facet description, one of the following can appear:
-
A facet header, marking the start of another facet,
-
A part header, marking the start of a another part,
-
An object header, marking the start of another object, or
-
The end of the file marker (
END
)