:orphan:

###########
STEP Reader
###########

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

+--------------------------------------------------------------------------------------------------------+
|                          **Standard for the Exchange of Product Data (STEP)**                          |
+-----------------------------------------+--------------------------------------------------------------+
| **File Extension**                      | STEP STP STPZ                                                |
+-----------------------------------------+--------------------------------------------------------------+
| **Supported Versions**                  | AP 203 Ed1, Ed2 - AP 214 - AP 242 Ed1, Ed2, Ed3              |
+-----------------------------------------+--------------------------------------------------------------+
| **Platforms**                           | |wy| |ly| |my| |ay| |iy|                                     |
+-----------------------------------------+--------------------------------------------------------------+
| :ref:`stp_rd_tessellation`              | |c_green| Supported (Computed)                               |
+-----------------------------------------+--------------------------------------------------------------+
| :ref:`stp_rd_brep`                      | |c_green| Supported                                          |
+-----------------------------------------+--------------------------------------------------------------+
| :ref:`stp_rd_pmi`                       | |c_green| Supported                                          |
+-----------------------------------------+--------------------------------------------------------------+

The STEP file format was created by the International Organization for Standardization (ISO). It was developed to facilitate the exchange of 3D data between different CAD systems and was first published in 1994. The format is defined in the ISO 10303-21 standard, which ensures compatibility across various CAD applications.

STEP (Standard for the Exchange of Product Data) is a widely-used ISO standard file format for representing 3D product data.
It is commonly employed in industries such as manufacturing, engineering, and aerospace for exchanging 3D models between different CAD systems.
The STEP format supports detailed and accurate representations of 3D objects, including geometry, topology, and product manufacturing information (PMI).
This makes it ideal for applications requiring interoperability, data exchange, and long-term archiving of product information.

Our STEP reader provides full access in reading :doc:`and writing <step_writer>` to the assembly, B-rep and PMI.

STEP uses Application Protocols (AP) as versions, which can be seen as specific subsets of the STEP standard.

How to Read from STEP
=====================

To load a STEP file, use :cpp:func:`A3DAsmModelFileLoadFromFile`.
The :cpp:struct:`A3DParamsLoadData` structure is used to customize general loading behavior.
Additionally, the :cpp:struct:`A3DRWParamsStepData` structure can be used to specifiy load options specific to STEP files.
This structure is available as a field of ``A3DParamsLoadData``:

.. code-block:: c

   A3DAsmModelFile* pModelFile = 0;

   A3DRWParamsLoadData sReadParam;
   A3D_INITIALIZE_DATA(A3DRWParamsLoadData, sReadParam);
   sReadParam.m_sGeneral.m_bReadSolids = A3D_TRUE;

   // Configuration specific to Step
   sReadParam.m_sSpecifics.m_sStep.m_bPreferProductName = A3D_TRUE;

   // ... set other A3DRWParamsLoadData fields as necessary

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

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

.. _stp_rd_tessellation:

Tessellation
============

The tessellation data for this format is generated by the HOOPS Exchange tessellation engine.

.. _stp_rd_brep:

B-rep
=====

We provide full support for the B-rep model defined in a STEP file. Evaluators are provided to allow you to directly query these geometries.

The specific surfaces supported by STEP are:

* ``BEZIER_SURFACE``
* ``BOUNDED_SURFACE``
* ``B_SPLINE_SURFACE_WITH_KNOTS``
* ``B_SPLINE_SURFACE``
* ``CONICAL_SURFACE``
* ``CURVE_BOUNDED_SURFACE``
* ``CYLINDRICAL_SURFACE``
* ``DEGENERATE_TOROIDAL_SURFACE``
* ``OFFSET_SURFACE``
* ``QUASI_UNIFORM_SURFACE``
* ``RATIONAL_B_SPLINE_SURFACE``
* ``RECTANGULAR_TRIMMED_SURFACE``
* ``SPHERICAL_SURFACE``
* ``SURFACE_OF_LINEAR_EXTRUSION``
* ``SURFACE_OF_REVOLUTION``
* ``TOROIDAL_SURFACE``
* ``UNIFORM_SURFACE``

The specific curves supported by STEP are:

* ``BEZIER_CURVE``
* ``B_SPLINE_CURVE_WITH_KNOTS``
* ``B_SPLINE_CURVE``
* ``QUASI_UNIFORM_CURVE``
* ``UNIFORM_CURVE``

* ``CIRCLE``
* ``COMPOSITE_CURVE``
* ``ELLIPSE``
* ``HYPERBOLA``
* ``PARABOLA``

* ``INTERSECTION_CURVE``
* ``POLYLINE``
* ``RATIONAL_B_SPLINE_CURVE``
* ``SURFACE_CURVE``

.. _stp_rd_pmi:

PMI
===

We provide support for the graphical representation of PMI which includes a link back to the referenced entity.
The specific PMI supported includes:

* ``Datum Target``
* ``Datum``
* ``Dimension (angular)``
* ``Dimension (curve)``
* ``Dimension (diameter)``
* ``Dimension (general)``
* ``Dimension (linear)``
* ``Dimension (ordinate)``
* ``Dimension (radial)``
* ``Feature control frame``
* ``Label``
* ``Note``
* ``Roughness``
* ``Weld``

Note: A ``DIMENSION_SIZE_WITH_PATH`` from STEP is read as a ``KEA3DMDDimensionTypeLengthCurvilinear`` in HOOPS Exchange, while a ``DIMENSION_SIZE`` with "curve length" is read as a ``KEA3DMDDimensionTypeLength``.

.. rubric:: Assembly

In addition to full support of the assembly tree our STEP reader will also honor external file references including those that point to other non-STEP files.

Views
=====

HOOPS Exchange provides support for the SAVED VIEWS concept in STEP. We specifically support the following SAVED VIEW concepts:

* ``CAMERA_MODEL_D3_MULTI_CLIPPING``
* ``CAMERA_MODEL_D3``
* ``DRAUGTHING_MODEL``

Other Features
==============

Our STEP reader provides support for both user defined and validation properties defined at a part level. Also, support for compressed STEP files is included.

Our STEP reader includes a built-in healing algorithm. However, in the interest of performance, it is not enabled by default.

For shell based surface models, each body is put into a separate B-rep entity. This can be toggled using the `m_bSplitSHELL_BASED_SURFACE_MODEL` flag.
