4.2 Getting B-rep data

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

  • Topology B-rep data: a topological boundary representation comprised of a bounding box and references to multiple Connex entities (See Create a topology B-rep data entity.)
  • Connex: a collection of shell entities, such as a hollow sphere that contains another sphere that is represented by two connexes
  • Shell: a collection of face entities
  • Face: a surface and a collection of loops

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 (and only) 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).

Since representation item sets may include other representation item sets, you should parse them recursively. For example, you could do something similar to this:

// Traverse Representation Items recursively
A3DStatus traverseRI(const A3DRiRepresentationItem* pRI)
{
// 'riType' is an integer value you can test against to find the type
CHECK_RET(A3DEntityGetType(pRI, &riType));
if (riType == kA3DTypeRiBrepModel)
{
traverseBREPModel(pRI);
}
else if (riType == kA3DTypeRiSet)
{
A3DRiSetData sRiSetData;
CHECK_RET(A3DRiSetGet(pRI, &sRiSetData));
for (int i = 0; i < sRiSetData.m_uiRepItemsSize; ++i)
{
traverseRI(sRiSetData.m_ppRepItems[i]);
}
}
return iRet;
}

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. When this is the case in your system, we suggest using use the function A3DCopyAndAdaptBrepModel()
This will attempt to convert the PRC 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: