How to simplify a B-Rep model with CAD Exchanger SDK?

B-Rep simplification tools allow to remove blind and through holes, internal and hence invisible faces and bodies, as well as small bodies that are not so important for the visual appearance of the model.

Maria Gazarkh
Maria Gazarkh
4 min read

Last time we broached the subject of geometry simplification, having started with the mesh decimation case. Today we offer you to delve further and study B-Rep simplification.

What is B-Rep Simplification?

Section of a solid model with multiple through holes and after passing through Hole remover
Section of a solid model with multiple through holes and after passing through Hole remover

B-Rep simplification, one of the key features of 3D Model Simplifier add-on, involves the reduction of faces (or shells, or solids) number while preserving the model’s overall shape and features. Depending on the use case it might be done by removing internal details, small bodies, holes, or a combination thereof.

If you’d like to know more about the algorithm and API, please refer to our documentation.

B-Rep Simplification Use Cases

Precise 3D CAD model in Boundary Representation is an ultimate digital representation of a physical product, a precursor of its digital twin if you will.

3D CAD models often contain a huge volume of information, including geometry, graphical attributes, PMI, and various meta-data. This creates a large memory footprint and requires substantial processing times. However, not all of these data items are required in every situation. With the multitude of stakeholders involved, there is an ongoing data exchange process, which requires content optimization for greater productivity. So sometimes it is just vital to find better trade-offs between data completeness and processing speed. Let’s review the major cases when B-Rep simplification may be helpful:

  • CAE simulation

Small features (holes, fillets, chamfers, and others) can increase the computational time and rather distort the results of the calculations than improve them. A well-designed model simplification algorithm removes irrelevant details and enhances simulation performance.

  • Collaborative engineering

The necessity to share 3D CAD data with project stakeholders raises the issue of storage limits and data transfer speed. Often there is no need for a high level of details, whereas the general design geometry and position are essential. B-Rep simplification meets this challenge and facilitates communications.

  • IP (Intellectual Property) protection

When working with external stakeholders, apart from transfer speeds, the issue of IP protection comes into play. You may have to provide your suppliers with context data, “detailed enough” for them to do their part but “rough enough” not to compromise your IP. For example, by removing inner geometry, engineering know-how can be protected even in the case of creating section and exploded views.

  • Visualization and rendering

3D models designed for engineering, manufacturing, and design review purposes contain thousands of faces, which are not essential for such operations as scientific analysis and marketing materials creation. On the contrary, oversized files complicate the rendering and make it impossible to access data from mobile devices. Due to removed tiny details and invisible parts, beautiful and meaningful renders can be made faster to generate and transmit.

Section of a solid assembly before and after passing through the Internal faces remover
Section of a solid assembly before and after passing through the Internal faces remover

B-Rep Simplification Tools

B-Rep simplification is used to remove blind and through holes, internal faces and bodies, and small bodies. Depending on the set parameter, the algorithm identifies corresponding geometric configurations and removes them.

  • Hole remover

This tool removes blind and through holes, relying on four parameters: Extent, Volume, and Diagonal Thresholds, as well as Perform Interference Check. The bodies below the thresholds are considered appropriate for removal, while the later parameter detects possible faces intersection to preserve model visual appearance.

Hole remover currently works only with holes whose entrances are bounded by inner wires (i.e. holes whose entrances are incident to more than 1 face are not supported).

4517 faces → 3247 faces
4517 faces → 3247 faces

  • Internal faces and bodies remover

This simplification tool acts in accordance with the visibility of the objects. Those not visible from most viewing angles and viewpoints are to be removed. The result may be controlled with linear and angular tolerance, which defines the maximum distance between two viewpoints and the maximum value of the angle between two viewing directions correspondingly. The larger the tolerances are, the coarser the simplification is.

Initial (13818 faces) → Medium (4172 faces) → High (2401 faces)
Initial (13818 faces) → Medium (4172 faces) → High (2401 faces)

  • Small bodies remover

The operation of this tool depends on the body size and its role within the model. The first is defined by the threshold relative to the whole model's size and the latter is estimated by the severity of visual appearance change in case of removal.

20372 faces → 13095 faces
20372 faces → 13095 faces

B-Rep Simplification Pipeline

In case it’s necessary to combine several of the above-mentioned tools, the simplification pipeline can be created. There are two ways to organize the algorithm:

  • Automatic pipeline

The parameters of the tools are tuned and arranged in order automatically. The only thing to do is to set two meta-parameters: Simplification Level and Simplified Feature Size. The first one controls the aggressiveness of the simplification which is reflected by deactivating consistency checks. The higher the aggressiveness is, the more faces are removed and the more the risk of invalid geometry is. In the meantime, the Simplified Feature Size affects the simplification thresholds. The small level implies default thresholds and its increasing results in expansion of the affected features set.

Here is an example of how the B-Rep simplification automatic pipeline can be used:

ModelData_Model aModel = /\* fill model \*/;
ModelSimplifier_SimplifierBuilder aBuilder;
aBuilder.SetLevel (ModelSimplifier_SimplifierBuilder::Low);
aBuilder.SetFeatureSize (ModelSimplifier_SimplifierBuilder::Large);
ModelSimplifier_Simplifier aSimplifier = aBuilder.CreatePipeline();
ModelData_Model aSimplifiedModel = aSimplifier.Perform (aModel);
  • Manual pipeline

The manual pipeline requires separate creation of the simplification tools, their manual adjustment, and adding to the pipeline. This approach makes sense if not all the tools are needed and/or parameters created by the automatic pipeline interface don't suit the use case.

CAD Exchanger B-Rep Simplifier Benefits

B-Rep simplification add-on is designed as a user-friendly tool for getting lighter 3D models. Its major benefits are the following:

  • Model Simplifier API acts as a container for B-Rep simplification tools and provides an interface allowing to run them all at once.
  • Automatic creation of the pipeline simplifies the tools adjustment.
  • The add-on works directly with an instance of ModelData_Model, applying simplification tools only to parts' geometry and preserving the product structure, however complex the content is.
  • B-Rep simplification add-on is easy to integrate with CAD Exchanger SDK and consequently shares all its advantages: numerous 3D formats support, no complex data preparation, compatibility with C++, C#, and Java.

B-Rep simplification add-on allows to make 3D CAD models lighter, which is particularly useful in case of file transfers between stakeholders and necessity to regularly perform computational simulations. CAD Exchanger solution offers a developer-centric tool, which doesn’t require complex adjustments and programming, and yet has enough options to be realigned with a current use case.

\

In case you currently use CAD Exchanger, please check the model simplification example in the ${install_dir}/examples subdirectory. You may insert its source code into your application and modify it as needed.
Maria Gazarkh
Maria Gazarkh
Content Manager

Get the CAD Exchanger Newsletter

From us to your inbox weekly.