HOOPS Exchange Documentation

< Home

< Reference Manual

< File Formats

PROGRAMMING GUIDE

Contents

1.0 Introduction

2.0 Getting started

3.0 Product occurrence

4.0 Reading geometry

5.0 Entity attributes

6.0 Views and PMI

7.0 Advanced functions

4.2 Getting B-rep data

The following entities contain the geometric data that represents the B-rep data:

It is important to note that B-rep is only available if HOOPS Exchange was able to read it from the original model source file.

Starting from the first root representation item in our example file, we can see that it is a B-rep model because it is of type kA3DTypeRiBrepModel (if the model file did not include B-rep, the representation item length field on the parent node would be zero). Additionally, we can also see the second root representation item is of type kA3DTypeRiSet, indicating it contains other representation item entities. In this case, the part was extruded from a 2D sketch, and the child types kA3DTypeRiCurve and kA3DTypeRiPlane object describe that sketch. Since representation item sets may include other representation item sets, so you should parse them recursively. For example, you could do something similar to this:

// 'riType' is an integer value you can test against to find the type
switch (riType)
{
// find the type and proceed accordingly
A3DRiSet* riSet;
riSet = (A3DRiSet*) ri;
A3DRiSetData riSetData;
A3DRiSetGet(riSet, &riSetData);
// call recursive traversal again
traverseRI(riSetData.m_ppRepItems, riSetData.m_uiRepItemsSize);
break;
}

Adapting B-rep to your system

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. If this is the case in your system, we suggest your use the function A3DCopyAndAdaptBrepModel. This will attempt to convert the PRC in an A3DEntity into a compatible format based on the options you specify. For example, if you need to recompute UV curves or split period surfaces, this function will do that. The reference manual entry for this function has further usage details and describes the options available in A3DCopyAndAdaptBrepModelData that can be used for B-rep conversion.

B-rep hierarchy

The general process used for obtaining all the B-rep information is the same as for tessellation. However, be aware that B-rep has a much deeper assembly hierarchy than tessellation. The B-rep assembly hierarchy is called the topology.

HOOPS Exchange B-rep topology structure:

4.2.1 Getting B-rep for Parasolid users

If you are a Parasolid user, HOOPS Exchange 2015+ includes a bridge to bring your data directly into an open Parasolid session. During the import process, the bridge uses native Parasolid APIs to ensure the highest quality model import. Additionally, the algorithm calls a set of healing functions to repair any incompatibilities that may arise. You are able to export either the entire model or individual representation items.

Two API methods implement this functionality:

Regardless of which way you export, you always use a A3DRWParamsExportParasolidData structure to supply the export options.

// ... set your desired export options here
int iNbPkParts;
PK_PART_t* pPkParts;
A3DAsmModelFileTranslateToPkParts(sHoopsExchangeLoader.m_psModelFile,
&sExportOptions, // export options structure
&iNbPkParts, // [out] length of pPkParts
&pPkParts); // [out] PK_PART_t entity IDs

For a complete working example, see the "TranslateToPkParts" code sample in the HOOPS Exchange package. To use this functionality, you must include hepb.dll when you distribute your application on Windows platforms.