:orphan:

###########
Creo Reader
###########

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

+------------------------------------------------------------------------------+
|                        **Creo - Pro/E**                                      |
+-----------------------------------------+------------------------------------+
| **File Extension**                      | ASM, NEU, PRT, XAS, XPR            |
+-----------------------------------------+------------------------------------+
| **Supported Versions**                  | Pro/Engineer 19.0 to Creo 12.4.0.0 |
+-----------------------------------------+------------------------------------+
| **Platforms**                           | |wy| |ly| |my| |an| |iy|           | 
+-----------------------------------------+------------------------------------+
| :ref:`creo_tessellation`                | |c_green| Supported                | 
+-----------------------------------------+------------------------------------+
| :ref:`creo_brep`                        | |c_green| Supported                | 
+-----------------------------------------+------------------------------------+
| :ref:`creo_pmi`                         | |c_green| Supported                | 
+-----------------------------------------+------------------------------------+

The Creo Reader provides full access to the assembly, b-rep, views, and PMI data that is stored within a particular Creo file. 

A file does not need to have a particular extension to be read correctly by HOOPS Exchange. However, the file extensions of Creo files that you can expect to be loaded by HOOPS Exchange include:

* ``.ASM``
* ``.NEU``
* ``.PRT``
* ``.XAS``
* ``.XPR``

How to Import From Creo - Pro/E 
===============================

To load a Creo - Pro/E file, use :cpp:func:`A3DAsmModelFileLoadFromFile`.
The :cpp:struct:`A3DParamsLoadData` structure is used to customize the loading behavior:

.. code-block:: c

   A3DAsmModelFile* pModelFile = 0;

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

   // ... set other A3DRWParamsLoadData fields as necessary

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

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

.. _creo_tessellation: 

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

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

.. _creo_brep: 

B-rep
=====

HOOPS Exchange extracts the exact B-rep definition from the model. The list of surface types provided is:

* B-spline surface
* Cone
* Cylinder
* Cylindrical spline surface
* Fillet surface
* Plane
* Revolution surface
* Ruled surface
* Sphere
* Spline surface
* Swept surface
* Tabulated surface
* Torus

The list of available curve types is:

* B-spline
* Circle
* Ellipse
* Line
* Spline
* UV curve

.. _creo_pmi: 

PMI
===

HOOPS Exchange provides access to all PMI data available in Creo file. This list includes:

* Dimension (driven)
* Dimension (ordinate baseline)
* Dimension (ordinate driven)
* Dimension (ordinate reference)
* Dimension (reference)
* Geometric tolerance
* Note
* Set datum tag
* Surface finish
* Symbol

Assembly
========

Incremental load is supported by our Creo reader.

Additionally, both construction geometry and datum planes are supported and accessed through the assembly tree.

Boolean Operation Support
=========================

* ``BooleanOpUseGenericIfNoTess = A3D_FALSE`` -> Tessellation is loaded if available, otherwise nothing is loaded.
* ``BooleanOpUseGenericIfNoTess = A3D_TRUE`` -> Tessellation is loaded if available, otherwise the generic is loaded.

Family Table Support
====================

The HOOPS Exchange Creo file reader has the following behaviors when loading a model with family tables:

* If the source file was saved _with_ the instance accelerator, HOOPS Exchange will be able to load the file and the associated XPR/XAS files. The resulting model will look exactly the same as in Creo.
* When loading a part or assembly, the generic instance is not loaded by default. Instead, only the tessellation is loaded (if found). A warning message is written in the log file mentioning the fact that this file contains a family table and that XPR/XAS files must be created from Creo to be displayed properly in HOOPS Exchange.

File reader options related to family tables are as follows:

* ``FamilyTables = 0`` -> Use only XPR/XAS for family tables. Nothing displayed if XPR/XAS is missing. No family table data is loaded and a warning is written to the log file.
* ``FamilyTables = 1`` -> Use tessellation if XPR/XAS is missing (this is the default behavior). The tessellation of the family table is loaded if found. Generics are not loaded by default anymore.
* ``FamilyTables = 2`` -> Use wire representation and generic if no tessellation and no XPR/XAS. This representation is the generic representation of the family table. It can be an incorrect representation compared to Creo.

Because HOOPS Exchange can represent the model more accurately with XPR/XAS files, we recommend that you generate them every instance that you handle family tables.

For more detailed information about importing Creo Family tables, please see this forum post: `How ProE/Creo family tables, flexible components and boolean operations are handled by HOOPS <https://forum.techsoft3d.com/t/faq-how-proe-creo-family-tables-flexible-components-and-boolean-operations-are-handled-by-hoops/1554>`_

Flexible Component Support
==========================

The generic representation of the flexible component is not loaded anymore by default.
* ``FlexibleCompUseGenericIfNoTess = A3D_FALSE`` -> Tessellation is loaded if available, otherwise nothing is loaded.
* ``FlexibleCompUseGenericIfNoTess = A3D_TRUE`` -> Tessellation is loaded if available, otherwise the generic is loaded.

Layers
======

Creo uses layers to control visibility, selection and appearance of various elements in a component, which can include parts, features, datums, annotations, and other entities.
These layers are defined by including (or excluding) objects.
Unlike other formats, a Creo entity can belong to several layers.

:cpp:struct:`layer <A3DAsmLayer>` has been modified accordingly to store the Creo note, layer visibility status and referenced entities.

In Creo, a dedicated layer is specifically used to keep track of items that have been hidden.
This layer is named *.BLACK_HOLE*.

Material colors
===============

Creo uses several internal parameters to define RGB colors set on a model.
Starting with HOOPS Exchange 2024.6.0, the following parameters are also read and set as generic attributes to :cpp:struct:`A3DGraphMaterialData` structure:

* CreoFlatColor: base color of a surface in Creo : 3 doubles (0. - 1.0) for RGB components
* CreoAmbient: double (0. - 1.0)
* CreoIntensity: double (0. - 1.0)
* CreoShine: double (0. - 1.0)
* CreoHighlight: double (0. - 1.0)
* CreoReflection: double (0. - 1.0)
* CreoTransmission: double (0. - 1.0)
* CreoHighlightColor : 3 doubles (0. - 1.0) for RGB components

The relations between these parameters and basic material properties are defined as:

* :cpp:member:`~A3DGraphMaterialData::m_uiAmbient`  = CreoFlatColor * CreoAmbient
* :cpp:member:`~A3DGraphMaterialData::m_uiDiffuse`  = CreoFlatColor * CreoIntensity
* :cpp:member:`~A3DGraphMaterialData::m_uiSpecular` = CreoHighlightColor * CreoShine
* :cpp:member:`~A3DGraphMaterialData::m_dShininess` = CreoHighlight

The global transparency parameter affected to a renderable object is defined by field :cpp:member:`A3DGraphStyleData::m_ucTransparency`:

* m_ucTransparency = (1. - CreoTransmission) * 255

Views
=====

There are two types of views supported in Creo:

* *Views:* A view plane in addition to visibilities that are applied to the PMI entities. Home views
  are also supported - this is a setting that allows you to create a view that is equivalent to the state in
  which the file has been saved.

* *Combined states:* A full camera definition, visibilities applied to PMI, visibilities and transformations that
  can be applied to components in the assembly and the optional definition of section planes. Basic support is provided
  for simplified representations - this includes master representations, exclusions, and user-defined representations.

All view types are fully supported by HOOPS Exchange.


Miscellaneous
=============

HOOPS Exchange also supports:
* Persistent IDs
* User-defined coordinate systems
* Cosmetic geometry
* User attributes attached to geometrical elements or part / assembly nodes
* Entity names attached at all levels of the model (assemblies, parts, instances, faces, coordinate axes, etc.)
* Cables at assembly level

Additional Notes
================

* A density value of -1 means that no density was set in the CAD file.
* HOOPS Exchange cannot use family tables to modify the shape of a model.
* Creo does not account for the "Hidden" attribute in an .ASM file, so parts marked as "Hidden" will not actually be hidden when imported into Exchange. In order to set a part as hidden, mark the representation of the instance as "exclude" in Creo.
