Hide menu
cadex::ModelSimplifier_SmallBodiesRemoverTool Class Reference

B-Rep simplification tool which removes small bodies from the model. More...

Inheritance diagram for cadex::ModelSimplifier_SmallBodiesRemoverTool:
cadex::ModelSimplifier_SimplifierTool

Public Member Functions

 ModelSimplifier_SmallBodiesRemoverTool ()
 
ModelData_Model Perform (const ModelData_Model &theSource) const override
 Runs small bodies removal algorithm. Returns the model without the small bodies. More...
 
double Threshold () const
 Returns the threshold of body size, below which the body is considered small. More...
 
void SetThreshold (double theValue)
 Sets the threshold of body size. See the method above.
 
bool RemovalIsVisualQualityAware () const
 Returns true if current strategy for removal is visual quality aware. More...
 
void SetRemovalIsVisualQualityAware (bool theValue)
 Sets visual quality removal strategy status. See the method above.
 
double VisualQualityThreshold () const
 Returns the linear threshold, such that a model change smaller than threshold considered acceptable. Used only when VisualQualityAwareRemoval is set to true. More...
 
void SetVisualQualityThreshold (double theValue)
 Sets the threshold of body size. See the method above.
 
- Public Member Functions inherited from cadex::ModelSimplifier_SimplifierTool
 ModelSimplifier_SimplifierTool (const std::shared_ptr< internal::ModelSimplifierImpl_SimplifierTool > &theImpl)
 
void SetShapePredicate (const std::shared_ptr< ModelSimplifier_ShapePredicate > &theShapePredicate)
 Sets what shapes can be split during simplification and what shapes can be simplified.
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelSimplifier_SimplifierTool
template<typename T >
T * Impl () const
 

Detailed Description

B-Rep simplification tool which removes small bodies from the model.

Warning
This class is a part of Model Simplification add-on, which is licensed separately from the base CAD Exchanger SDK.

This tool traverses the scene graph and re-creates the model skipping the bodies that were recognized as small. It measures the body size as its axis-aligned bounding box diagonal.

Constructor & Destructor Documentation

◆ ModelSimplifier_SmallBodiesRemoverTool()

cadex::ModelSimplifier_SmallBodiesRemoverTool::ModelSimplifier_SmallBodiesRemoverTool ( )

Constructor.

Exceptions
LicenseManager_LicenseErrorif no Model Simplifier license was activated.

Member Function Documentation

◆ Perform()

ModelData_Model cadex::ModelSimplifier_SmallBodiesRemoverTool::Perform ( const ModelData_Model theSource) const
overridevirtual

Runs small bodies removal algorithm. Returns the model without the small bodies.

The original model is not modified.

The method can be invoked multiple times with different models.

Implements cadex::ModelSimplifier_SimplifierTool.

◆ RemovalIsVisualQualityAware()

bool cadex::ModelSimplifier_SmallBodiesRemoverTool::RemovalIsVisualQualityAware ( ) const

Returns true if current strategy for removal is visual quality aware.

This strategy removes bodies with AABB diagonal less then Threshold BUT only if their removal would not result in model change more then visual quality threshold.

Default value is true.

◆ Threshold()

double cadex::ModelSimplifier_SmallBodiesRemoverTool::Threshold ( ) const

Returns the threshold of body size, below which the body is considered small.

Size is measured as the length of the diagonal of an object's axis-aligned bounding box. The threshold is relative to the whole model's size (i.e. the value of 0.1 means all bodies smaller than 10% of the model's size should be removed), therefore the meaningful range of this parameter is [0, 1].

Default value is 0.1, i.e. 10% of model's size.

◆ VisualQualityThreshold()

double cadex::ModelSimplifier_SmallBodiesRemoverTool::VisualQualityThreshold ( ) const

Returns the linear threshold, such that a model change smaller than threshold considered acceptable. Used only when VisualQualityAwareRemoval is set to true.

Size is measured as smallest extent of an object's axis-aligned bounding box. The threshold is relative to the whole model's size (i.e. the value of 0.1 means all bodies smaller than 10% of the model's smallest extent can be removed), therefore the meaningful range of this parameter is [0, 1].

Default value is 0.06, i.e. 6% of model's size.