
########################
A3DCopyAndAdaptBrepModel
########################

.. c:function:: A3DStatus A3DCopyAndAdaptBrepModel(const A3DEntity *p, const A3DCopyAndAdaptBrepModelData *psSetting, A3DEntity **const pp)

   .. rst-class:: sig-pretty-signature
   
      | :c:enum:`~A3DStatus` A3DCopyAndAdaptBrepModel(*const* :c:type:`~A3DEntity`\ \* **p**\ , *const* :c:struct:`~A3DCopyAndAdaptBrepModelData`\ \* **psSetting**\ , :c:type:`~A3DEntity`\ \*\* **pp**\ )
   
   Copy and adapt B-rep parameters.
   
   The B-rep used by HOOPS Exchange may not be completely compatible with modeling systems that do not support the full range of B-rep as employed by PRC. This function attempts to convert PRC B-rep into a format that is compatible with your system.
   
   In order to use this function, you create an ``A3DCopyAndAdaptBrepModelData`` structure and configure it to create a new B-rep model using entities you are able to support. The function can transform predetermined surface types and curves to NURBS. It also can process parametric curves and 3D curves, as well as split periodic parametric surfaces.
   
   :c:func:`~A3DCopyAndAdaptBrepModel` creates a new, independent B-rep model. To free the allocated memory, the model must be manually deleted by calling :c:func:`~A3DEntityDelete` after use. If the new B-rep model is inserted into an existing model tree, however, ownership is transferred to the model tree and explicit deletion of the model is no longer required.
   
   ``A3DCopyAndAdaptBrepModel`` will perform the following steps:
   
   
   - For each face, the bearing surface and the 3D curves are converted
   - Surfaces are reduced in size
   - Cross-period UV curves are deleted if necessary
   - Faces are split at periodic seams and/or mid-parameter for closed surfaces
   - Final UV curves are computed
   - A second surface shrink is performed with new UV parameters
   - Final 3D curves are computed
   
   
      When the function A3DCopyAndAdaptBrepModel returns an error, you may try to set the parameters m_bSplitFaces and/or m_bForceComputeUV to 'false' and retry the conversion.
   
   
   **Return Values**
   
   
      **A3D_BREPDATA_CANNOT_GETBOUNDINGBOX**\ : if the bounding box could not be computed
   
      **A3D_COEDGE_BAD_ORIENTATION_DATA**\ : if input coedge orientation data is incorrect
   
      **A3D_CRV_INVALID_PARAMETER**\ : if ``psSetting->m_puiAcceptableCurves`` contains a value that is not a supported ``kA3DTypeCrv*`` type
   
      **A3D_ERROR**\ : on a general, unclassified error
   
      **A3D_EXCEPTION**\ : if an exception was caught during processing
   
      **A3D_INCOMPATIBLE_FUNCTION_WITH_KEEP_PARSED_ENTITY_MODE**\ : if the input was read in Keep Parsed Entities mode, which is not supported by this function
   
      **A3D_INITIALIZE_BAD_VALUES**\ : if initialization led to bad internal values for globals; this is a fatal error requiring the program to be reinitialized
   
      **A3D_INITIALIZE_NOT_CALLED**\ : if the library has not been initialized via ``A3DDllInitialize``
   
      **A3D_INVALID_ENTITY_NULL**\ : if ``p`` or ``pp`` is null
   
      **A3D_INVALID_ENTITY_TYPE**\ : if ``p`` is of an invalid entity type
   
      **A3D_INVALID_LICENSE**\ : if the current license does not allow this function
   
      **A3D_LOOP_BAD_ORIENTATION_DATA**\ : if input loop orientation data is incorrect
   
      **A3D_NOT_IMPLEMENTED**\ : if the requested operation is not yet implemented
   
      **A3D_SHELL_BAD_ORIENTATION_DATA**\ : if input shell orientation data is incorrect
   
      **A3D_SRF_INVALID_PARAMETERS**\ : if ``psSetting->m_puiAcceptableSurfaces`` contains a value that is not a supported ``kA3DTypeSurf*`` type
   
      **A3D_SUCCESS**\ : returned on success
   
      **A3D_TOOLS_COMPUTE_3D_FAILURE**\ : if computing a 3D space curve fails
   
      **A3D_TOOLS_COMPUTE_UV_FAILURE**\ : if computing a space parametric (UV) curve fails
   
      **A3D_TOOLS_NURBSCONVERT_3D_FAILURE**\ : if converting a 3D space curve fails
   
      **A3D_TOOLS_NURBSCONVERT_GENERAL_FAILURE**\ : on a general, unclassified NURBS conversion failure
   
      **A3D_TOOLS_NURBSCONVERT_SURFACE_FAILURE**\ : if converting a surface to NURBS fails
   
      **A3D_TOOLS_NURBSCONVERT_UV_FAILURE**\ : if converting a space parametric (UV) curve fails
   
      **A3D_TOOLS_SPLIT_FAILURE**\ : if splitting a surface at a seam fails
   
      **A3D_TOPO_CONSISTENCY**\ : if the input topology has a consistency problem
   
      **A3D_TOPO_GEOMETRY_MISSING**\ : if the input topology is missing geometry
   
      **A3D_TOPO_NON_CONNEX_SHELL**\ : if a shell in the input topology is non-connex
   
      **A3D_TOPO_OPEN_SOLID**\ : if the input solid is invalid, containing edges without neighbors
   
      **A3D_TOPO_VERTICES_MISSING**\ : if the input topology is missing vertices
   
      **A3D_TOPO_WRONG_TOLERANCES**\ : if tolerances on edges, vertices, or faces are invalid or inconsistent
   
   
   **Parameters**
   
   
      **p**\ : A pointer to the source B-rep entity
   
      **psSetting**\ : The structure that defines which types of B-rep you would like to convert to
   
      **pp**\ : A pointer to the result B-rep entity or entities
   
   
   **Returns**
   
   
      ``A3D_SUCCESS`` on success, or an error code on failure
   
   




