Overview

Programming Guide

API Reference

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: