Open CASCADE Technology
7.3.0
|
The BRepAlgoAPI_Defeaturing algorithm is the API algorithm intended for removal of the unwanted parts from the shape. The unwanted parts (or features) can be holes, protrusions, gaps, chamfers, fillets etc. The shape itself is not modified, the new shape is built as the result. More...
#include <BRepAlgoAPI_Defeaturing.hxx>
Public Member Functions | |
Constructors | |
BRepAlgoAPI_Defeaturing () | |
Empty constructor. More... | |
Setting input data for the algorithm | |
void | SetShape (const TopoDS_Shape &theShape) |
Sets the shape for processing. More... | |
const TopoDS_Shape & | InputShape () const |
Returns the input shape. More... | |
void | AddFaceToRemove (const TopoDS_Shape &theFace) |
Adds the features to remove from the input shape. More... | |
void | AddFacesToRemove (const TopTools_ListOfShape &theFaces) |
Adds the faces to remove from the input shape. More... | |
const TopTools_ListOfShape & | FacesToRemove () const |
Returns the list of faces which have been requested for removal from the input shape. More... | |
Performing the operation | |
virtual void | Build () override |
Performs the operation. More... | |
History Methods | |
void | TrackHistory (const Standard_Boolean theFlag) |
Defines whether to track the modification of the shapes or not. More... | |
Standard_Boolean | HasHistory () const |
Returns whether the history was requested or not. More... | |
virtual const TopTools_ListOfShape & | Modified (const TopoDS_Shape &theS) override |
Returns the list of shapes modified from the shape <theS> during the operation. More... | |
virtual const TopTools_ListOfShape & | Generated (const TopoDS_Shape &theS) override |
Returns the list of shapes generated from the shape <theS> during the operation. More... | |
virtual Standard_Boolean | IsDeleted (const TopoDS_Shape &theS) override |
Returns true if the shape <theS> has been deleted during the operation. It means that the shape has no any trace in the result. Otherwise it returns false. More... | |
Handle< BRepTools_History > | GetHistory () |
Returns the History of shapes modifications. More... | |
Public Member Functions inherited from BRepAlgoAPI_Algo | |
virtual const TopoDS_Shape & | Shape () override |
Returns a shape built by the shape construction algorithm. Raises exception StdFail_NotDone if the shape was not built. More... | |
Public Member Functions inherited from BRepBuilderAPI_MakeShape | |
operator TopoDS_Shape () | |
Public Member Functions inherited from BRepBuilderAPI_Command | |
virtual | ~BRepBuilderAPI_Command () |
virtual Standard_Boolean | IsDone () const |
void | Check () const |
Raises NotDone if done is false. More... | |
Protected Member Functions | |
Setting the algorithm into default state | |
virtual void | Clear () override |
Clears all warnings and errors, and any data cached by the algorithm. User defined options are not cleared. More... | |
Protected Member Functions inherited from BRepAlgoAPI_Algo | |
BRepAlgoAPI_Algo () | |
Empty constructor. More... | |
virtual | ~BRepAlgoAPI_Algo () |
Destructor. More... | |
BRepAlgoAPI_Algo (const Handle< NCollection_BaseAllocator > &theAllocator) | |
Empty constructor. More... | |
Protected Member Functions inherited from BRepBuilderAPI_MakeShape | |
BRepBuilderAPI_MakeShape () | |
Protected Member Functions inherited from BRepBuilderAPI_Command | |
BRepBuilderAPI_Command () | |
Set done to False. More... | |
void | Done () |
Set done to true. More... | |
void | NotDone () |
Set done to false. More... | |
Protected Member Functions inherited from BOPAlgo_Options | |
void | UserBreak () const |
Breaks the execution if the break signal is indicated by myProgressIndicator. More... | |
BOPAlgo_Options () | |
Empty constructor. More... | |
BOPAlgo_Options (const Handle< NCollection_BaseAllocator > &theAllocator) | |
Constructor with allocator. More... | |
virtual | ~BOPAlgo_Options () |
Destructor. More... | |
const Handle< NCollection_BaseAllocator > & | Allocator () const |
Returns allocator. More... | |
void | AddError (const Handle< Message_Alert > &theAlert) |
Adds the alert as error (fail) More... | |
void | AddWarning (const Handle< Message_Alert > &theAlert) |
Adds the alert as warning. More... | |
Standard_Boolean | HasErrors () const |
Returns true if algorithm has failed. More... | |
Standard_Boolean | HasError (const Handle< Standard_Type > &theType) const |
Returns true if algorithm has generated error of specified type. More... | |
Standard_Boolean | HasWarnings () const |
Returns true if algorithm has generated some warning alerts. More... | |
Standard_Boolean | HasWarning (const Handle< Standard_Type > &theType) const |
Returns true if algorithm has generated warning of specified type. More... | |
const Handle< Message_Report > & | GetReport () const |
Returns report collecting all errors and warnings. More... | |
void | DumpErrors (Standard_OStream &theOS) const |
Dumps the error status into the given stream. More... | |
void | DumpWarnings (Standard_OStream &theOS) const |
Dumps the warning statuses into the given stream. More... | |
void | ClearWarnings () |
Clears the warnings of the algorithm. More... | |
void | SetFuzzyValue (const Standard_Real theFuzz) |
Sets the additional tolerance. More... | |
Standard_Real | FuzzyValue () const |
Returns the additional tolerance. More... | |
void | SetProgressIndicator (const Handle< Message_ProgressIndicator > &theObj) |
Set the Progress Indicator object. More... | |
void | SetRunParallel (const Standard_Boolean theFlag) |
Set the flag of parallel processing if <theFlag> is true the parallel processing is switched on if <theFlag> is false the parallel processing is switched off. More... | |
Standard_Boolean | RunParallel () const |
Returns the flag of parallel processing. More... | |
void | SetUseOBB (const Standard_Boolean theUseOBB) |
Enables/Disables the usage of OBB. More... | |
Standard_Boolean | UseOBB () const |
Returns the flag defining usage of OBB. More... | |
Protected Attributes | |
Fields | |
TopoDS_Shape | myInputShape |
Input shape to remove the features from. More... | |
TopTools_ListOfShape | myFacesToRemove |
Features to remove from the shape. More... | |
Standard_Boolean | myTrackHistory |
Defines whether to track the history of shapes modifications or not (true by default) More... | |
BOPAlgo_RemoveFeatures | myFeatureRemovalTool |
Tool for the features removal. More... | |
Protected Attributes inherited from BRepBuilderAPI_MakeShape | |
TopoDS_Shape | myShape |
TopTools_ListOfShape | myGenerated |
Protected Attributes inherited from BOPAlgo_Options | |
Handle< NCollection_BaseAllocator > | myAllocator |
Enables/Disables the usage of OBB. More... | |
Handle< Message_Report > | myReport |
Enables/Disables the usage of OBB. More... | |
Standard_Boolean | myRunParallel |
Enables/Disables the usage of OBB. More... | |
Standard_Real | myFuzzyValue |
Enables/Disables the usage of OBB. More... | |
Handle< Message_ProgressIndicator > | myProgressIndicator |
Enables/Disables the usage of OBB. More... | |
Standard_Boolean | myUseOBB |
Enables/Disables the usage of OBB. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from BOPAlgo_Options | |
static Standard_Boolean | GetParallelMode () |
Gets the global parallel mode. More... | |
static void | SetParallelMode (const Standard_Boolean theNewMode) |
Sets the global parallel mode. More... | |
The BRepAlgoAPI_Defeaturing algorithm is the API algorithm intended for removal of the unwanted parts from the shape. The unwanted parts (or features) can be holes, protrusions, gaps, chamfers, fillets etc. The shape itself is not modified, the new shape is built as the result.
The actual removal of the features from the shape is performed by the low-level BOPAlgo_RemoveFeatures tool. So the defeaturing algorithm has the same options, input data requirements, limitations as the low-level algorithm.
Input data
Currently, only the shapes of type SOLID, COMPSOLID, and COMPOUND of Solids are supported. And only the FACEs can be removed from the shape.
On the input the algorithm accepts the shape itself and the features which have to be removed. It does not matter how the features are given. It could be the separate faces or the collections of faces. The faces should belong to the initial shape, and those that do not belong will be ignored.
Options
The algorithm has the following options:
and the options available from base class:
Please note that the other options of the base class are not supported here and will have no effect.
For the details on the available options please refer to the description of BOPAlgo_RemoveFeatures algorithm.
Limitations
The defeaturing algorithm has the same limitations as BOPAlgo_RemoveFeatures algorithm.
Example
Here is the example of usage of the algorithm:
The algorithm preserves the type of the input shape in the result shape. Thus, if the input shape is a COMPSOLID, the resulting solids will also be put into a COMPSOLID.
|
inline |
Empty constructor.
|
inline |
Adds the faces to remove from the input shape.
theFaces | [in] The list of shapes to extract the faces for removal. |
|
inline |
Adds the features to remove from the input shape.
theFace | [in] The shape to extract the faces for removal. |
|
overridevirtual |
Performs the operation.
Reimplemented from BRepBuilderAPI_MakeShape.
|
inlineoverrideprotectedvirtual |
Clears all warnings and errors, and any data cached by the algorithm. User defined options are not cleared.
Reimplemented from BOPAlgo_Options.
|
inline |
Returns the list of faces which have been requested for removal from the input shape.
|
overridevirtual |
Returns the list of shapes generated from the shape <theS> during the operation.
Reimplemented from BRepBuilderAPI_MakeShape.
|
inline |
Returns the History of shapes modifications.
|
inline |
Returns whether the history was requested or not.
|
inline |
Returns the input shape.
|
overridevirtual |
Returns true if the shape <theS> has been deleted during the operation. It means that the shape has no any trace in the result. Otherwise it returns false.
Reimplemented from BRepBuilderAPI_MakeShape.
|
overridevirtual |
Returns the list of shapes modified from the shape <theS> during the operation.
Reimplemented from BRepBuilderAPI_MakeShape.
|
inline |
Sets the shape for processing.
theShape | [in] The shape to remove the features from. It should either be the SOLID, COMPSOLID or COMPOUND of Solids. |
|
inline |
Defines whether to track the modification of the shapes or not.
|
protected |
Features to remove from the shape.
|
protected |
Tool for the features removal.
|
protected |
Input shape to remove the features from.
|
protected |
Defines whether to track the history of shapes modifications or not (true by default)