Hide menu
No Matches
B-Rep Representation Example

Table of Contents

Explores topological and geometrical entities inside a B-Rep representation: faces, edges, curves, surfaces, etc.


Each part of a model may contain a B-Rep Representation. In this example we use a visitor to obtain ModelData_Part from the ModelData_Model and then check ModelData_BRepRepresentation for an existence. Next, we may get a ModelData_BodyList from it which contains all the ModelData_Body of the B-Rep Representation.

As shown in the Topology Guide each ModelData_Body is an owner of topological entities represented by ModelData_Shape base-class. ModelData_Body is inherited from ModelData_Shape so we can iterate over this object to gain access to other shapes it contains.

ModelData_Shape may store information about its orientation. CAD Exchanger SDK provides two types of shape hashers and equalers: oriented and unoriented to consider and not to consider shape orientation respectively:

#define ShapesOrientationIsUsed 0
#if ShapesOrientationIsUsed
typedef ModelData_OrientedShapeHash HasherType;
typedef ModelData_OrientedShapeEqual EqualerType;
typedef ModelData_UnorientedShapeHash HasherType;
typedef ModelData_UnorientedShapeEqual EqualerType;

Shapes equivalence consist of three parts: entity, location and orientation. There are two ways to compare shapes: ModelData_Shape::IsEqual() and ModelData_Shape::IsSame(). Two shapes are equal if all three equivalence parts are identical for both shapes. Two shapes are same if all equivalence parts are identical except orientation.

ModelData_Part may contain a ModelData_PolyRepresentation. You could find more in the Polygonal Representation Example.


You can try this example with the following model: