The facet_tool utility provides a way to convert facetized objects from the OBJ or GDB formats to the more compact "object HDF" format and a means to gather information about these facet geometry files.

Overview

The help for the facet_tool utility.
$ facet_tool -h
Usage: facet_tool [options] <command> ...

Options:
  -h/--help
	Display this help and exit.
  --log_level string
	Sets the minimum logging level. Values are: debug, info, warning, error, critical, off

Commands:
  summary
  convert

For subcommand help: facet_tool <command> -h

The Convert Tool

The convert tool is primarily used to convert an OBJ or GDB file to an object HDF file. The benefit of the this format is that it is binary (and can be compressed) and therefore uses dramatically less storage space than the corresponding ASCII OBJ or GDB file is was created from.

Usage for the convert tool.
$ facet_tool convert -h
Usage: facet_tool ... convert [options] filenames+

Positional Arguments:
  filenames
	The input filename(s) to convert

Options:
  -h/--help
	Display this help and exit.
  --ignore_materials
	Ignore materials entirely, mapping every facet to the 0-index.

Example Usage

The syntax for the conversion tool is straight forward:

$ facet_tool convert aircraft.obj
Material indexes for "aircraft.obj":
  0 => painted_surface_1
  1 => painted_surface_2
  2 => tire
  3 => radome
  4 => canopy

The material index table produced by the tool is the mapping from the material indexes in the object HDF to the original materials in the source geometry file. In this case, the aircraft.obj file contained usemtl directives for materials named painted_surface_1, etc. Since the HDF only stores indexes, the indexes in this table (rather than the material names) must be used in the GLIST material remappings. Below is an example of the GLIST material mappings when using the original OBJ file containing the material names:

Example GLIST material assignments to the original OBJ (material names)
<object>
  <obj>
    <filename>aircraft.obj</filename>
    <assign id="painted_steel_roof">painted_surface_1</assign>
    <assign id="painted_steel_side">painted_surface_2</assign>
    <assign id="rubber">tire</assign>
    <assign id="fiberglass">radome</assign>
    <assign id="plexiglass">canopy</assign>
  </obj>
  ...
</object>

Below is an example of the GLIST material mappings when using the object HDF file that must employ the resulting material indexes:

Example GLIST material assignments to the object HDF (material indexes)
<object>
  <hdf>
    <filename>aircraft.obj.hdf</filename>
    <assign id="painted_steel_roof">0</assign>
    <assign id="painted_steel_side">1</assign>
    <assign id="rubber">2</assign>
    <assign id="fiberglass">3</assign>
    <assign id="plexiglass">4</assign>
  </hdf>
  ...
</object>

The Summary Tool

The "summary" tool can be used to display information about a source OBJ, GDB or object HDF file.

Usage for the summary tool.
$ facet_tool summary -h
Usage: facet_tool ... summary [options] filenames+

Positional Arguments:
  filenames
	The input filename(s) to summarize.

Options:
  -h/--help
	Display this help and exit.

Example Usage

Below is an example using the summary tool to extract information about a GDB file:

Summary information for a GDB file.
$ facet_tool summary aircraft.gdb
"aircraft.gdb"
  Vertex count = 5821
  Facet count = 9492
  Part count = 84
    - "FOXBAT_BOMB_1_ATTS" (Facet count = 80)
    - "FOXBAT_BOMBFIN1_1_ATTS" (Facet count = 38)
...
    - "FOXBAT_AERIALL_ATTS" (Facet count = 154)
    - "FOXBAT_AERIALR_ATTS" (Facet count = 154)
  Extent min = -10.770, -6.715, +0.000
  Extent max = +10.770, +6.715, +5.357
  Has facet thicknesses? = Yes
  Has facet temperatures? = Yes
  Has facet thermal emissivities? = No
  Material count = 5
    - "painted_surface_1" (Facet count = 4244)
    - "painted_surface_2" (Facet count = 1908)
    - "tire" (Facet count = 3200)
    - "radome" (Facet count = 20)
    - "canopy" (Facet count = 120)

The tool can also be run on an object HDF file, which is "flattened" (the part hierarchy has been removed):

Summary information for an object HDF file.
$ facet_tool summary aircraft.gdb.hdf
"aircraft.gdb.hdf"
  Vertex count = 5821
  Facet count = 9492
  Part count = 1
  Extent min = -10.770, -6.715, +0.000
  Extent max = +10.770, +6.715, +5.357
  Has facet thicknesses? = Yes
  Has facet temperatures? = Yes
  Has facet thermal emissivities? = No
  Material count = 5
    - "0" (Facet count = 4244)
    - "1" (Facet count = 1908)
    - "2" (Facet count = 3200)
    - "3" (Facet count = 20)
    - "4" (Facet count = 120)