:orphan:


####################
Wavefront OBJ Reader
####################

.. rst-class:: format-title-block

+----------------------------------------------------------------------+
|                        **Wavefront OBJ**                             |
+-----------------------------------------+----------------------------+
| **File Extension**                      | OBJ, MTL                   |
+-----------------------------------------+----------------------------+
| **Supported Versions**                  | Any                        |
+-----------------------------------------+----------------------------+
| **Platforms**                           | |wy| |ly| |my| |ay| |iy|   | 
+-----------------------------------------+----------------------------+
| **Tessellation**                        | |t_green| Supported        | 
+-----------------------------------------+----------------------------+
| :ref:`obj_rd_brep`                      | |c_grey| N/A               | 
+-----------------------------------------+----------------------------+
| :ref:`obj_rd_pmi`                       | |c_grey| N/A               | 
+-----------------------------------------+----------------------------+

Wavefront OBJ is an open file format created by Wavefront Technologies in the early 1990s as part of their Advanced Visualizer software. This format is widely used in 3D graphics and has been adopted by various other applications due to its open nature and compatibility with multiple software tools. 

Wavefront OBJ support in HOOPS Exchange allows you to import data for visualization, rendering, and downstream workflows.

* **Tessellation:** Mesh or polygonal geometry is imported directly.
* **B-rep:** Not supported by this format - HOOPS Exchange treats it as tessellation only.

The most common file extensions of OBJ files are:

* `.OBJ`
* `.MTL` *for material data*


How to Import From OBJ 
=======================

If you are new to reading models with HOOPS Exchange, see the :doc:`basic load workflow </guide/basic_operations/load_model`>` section of the Programming Guide.

To load an OBJ file, use :cpp:func:`A3DAsmModelFileLoadFromFile`.

Below, the ``A3DParamsLoadData`` structure is used to customize the loading behavior. See our :cpp:struct:`API reference manual <A3DParamsLoadData>` for more information about this important data type.

.. code-block:: c

   A3DAsmModelFile* pModelFile = 0;

   A3DRWParamsLoadData sReadParam = A3D_MAKE_DATA(A3DRWParamsLoadData);
   sReadParam.m_sGeneral.m_bReadSolids = true;

   // ... set other A3DRWParamsLoadData fields as necessary

   A3DAsmModelFileLoadFromFile("path/to/file.obj", &sReadParam, &pModelFile);

See :doc:`/guide/basic_operations/load_model` for general information about loading model files.


.. _obj_rd_brep: 

B-rep
=====

This concept is not supported by OBJ.


.. _obj_rd_pmi: 

PMI
===

This concept is not supported by OBJ.


Assembly
========

This concept is not supported by OBJ. However, many Wavefront OBJ files may contain multiple components or objects. Once loaded, HOOPS Exchange represents these as a model tree that you can traverse using the standard structure APIs.

To learn more about how HOOPS Exchange handles assemblies, see our tutorial about :doc:`assembly traversal </tutorials/c/print-assembly-structure>`.


Views
=====

This concept is not supported by OBJ.


Metadata and Attributes
=======================
HOOPS Exchange can expose colors, materials, layers, and user-defined metadata
when they are present in the source file.

See :doc:`/guide/metadata` for details on how to query and interpret
this information.
