Applications that need to represent their objects in exact geometrical form may create 3D models using B-Rep representation.
CAD Exchanger offers the following options to create precise B-Rep representations:
The sections below explain in details available options.
Constructed B-Rep representation can be added to a part, which in its turn can be added to a new (or existing) model and exported to a target format. The example below demonstrates how this could be done:
CAD Exchanger SDK provides high level API to create basic solid primitives such as box, sphere, cylinder, cone, etc using the ModelAlgo_TopoPrimitives class. A part can be created from a solid as follows:
B-Rep shapes can be created by extruding or rotating simpler input shapes. For instance a face can be created by rotating an edge and solid can be created by extruding a face. Refer to ModelAlgo_BRepFeatures for details.
A bottom-up creation assumes a step-by-step process of creating a ModelData_Body (solid, sheet, wireframe or accorn) starting with the lower level shapes (e.g. vertices).
Here is a typical workflow you might have to follow:
Refer to particular subclasses of the ModelData_Shape for details on constructing a particular type. Refer to the example Assembly Modeling Example for demonstration of the entire workflow.
A B-Rep representation can be created from polygonal representation. This takes place when exporting a model with parts containing only polygonal representations to a format that requires B-Rep representation. For instance, this may happen when a model previously imported from an STL file to a file in IGES, STEP, ACIS or Parasolid format.
In this case each triangle of ModelData_IndexedTriangleSet will be converted to a planar triangle ModelData_Face. The whole triangle set will be converted into one or several ModelData_Shells where each shell will correspond to a connected subset of triangles (i.e. triangles sharing the same vertex indices). Each closed shell will be additionally converted into a ModelData_Solid.
Given that such B-Rep will have very high memory footprint on the one hand and may have limited usability in any CAD system for modeling operations on the other, this conversion is discouraged and should only be used when direct use of polygonal representations is impossible.