Open CASCADE Technology 7.8.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. | |
Setting input data for the algorithm | |
void | SetShape (const TopoDS_Shape &theShape) |
Sets the shape for processing. | |
const TopoDS_Shape & | InputShape () const |
Returns the input shape. | |
void | AddFaceToRemove (const TopoDS_Shape &theFace) |
Adds the features to remove from the input shape. | |
void | AddFacesToRemove (const TopTools_ListOfShape &theFaces) |
Adds the faces to remove from the input shape. | |
const TopTools_ListOfShape & | FacesToRemove () const |
Returns the list of faces which have been requested for removal from the input shape. | |
Performing the operation | |
virtual void | Build (const Message_ProgressRange &theRange=Message_ProgressRange()) override |
Performs the operation. | |
History Methods | |
void | SetToFillHistory (const Standard_Boolean theFlag) |
Defines whether to track the modification of the shapes or not. | |
Standard_Boolean | HasHistory () const |
Returns whether the history was requested or not. | |
virtual const TopTools_ListOfShape & | Modified (const TopoDS_Shape &theS) override |
Returns the list of shapes modified from the shape <theS> during the operation. | |
virtual const TopTools_ListOfShape & | Generated (const TopoDS_Shape &theS) override |
Returns the list of shapes generated from the shape <theS> during the operation. | |
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. | |
virtual Standard_Boolean | HasModified () const |
Returns true if any of the input shapes has been modified during operation. | |
virtual Standard_Boolean | HasGenerated () const |
Returns true if any of the input shapes has generated shapes during operation. | |
virtual Standard_Boolean | HasDeleted () const |
Returns true if any of the input shapes has been deleted during operation. | |
Handle< BRepTools_History > | History () |
Returns the History of shapes modifications. | |
Public Member Functions inherited from BRepAlgoAPI_Algo | |
virtual const TopoDS_Shape & | Shape () override |
Returns a shape built by the shape construction algorithm. Does not check if the shape is built. | |
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. | |
Standard_Boolean | RunParallel () const |
Returns the flag of parallel processing. | |
void | SetFuzzyValue (const Standard_Real theFuzz) |
Sets the additional tolerance. | |
Standard_Real | FuzzyValue () const |
Returns the additional tolerance. | |
Standard_Boolean | HasErrors () const |
Returns true if algorithm has failed. | |
Standard_Boolean | HasWarnings () const |
Returns true if algorithm has generated some warning alerts. | |
Standard_Boolean | HasError (const Handle< Standard_Type > &theType) const |
Returns true if algorithm has generated error of specified type. | |
Standard_Boolean | HasWarning (const Handle< Standard_Type > &theType) const |
Returns true if algorithm has generated warning of specified type. | |
void | DumpErrors (Standard_OStream &theOS) const |
Dumps the error status into the given stream. | |
void | DumpWarnings (Standard_OStream &theOS) const |
Dumps the warning statuses into the given stream. | |
void | ClearWarnings () |
Clears the warnings of the algorithm. | |
const Handle< Message_Report > & | GetReport () const |
Returns report collecting all errors and warnings. | |
void | SetUseOBB (const Standard_Boolean theUseOBB) |
Enables/Disables the usage of OBB. | |
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. | |
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. | |
Protected Member Functions inherited from BRepAlgoAPI_Algo | |
BRepAlgoAPI_Algo () | |
Empty constructor. | |
virtual | ~BRepAlgoAPI_Algo () |
Destructor. | |
BRepAlgoAPI_Algo (const Handle< NCollection_BaseAllocator > &theAllocator) | |
Empty constructor. | |
Protected Member Functions inherited from BRepBuilderAPI_MakeShape | |
BRepBuilderAPI_MakeShape () | |
Protected Member Functions inherited from BRepBuilderAPI_Command | |
BRepBuilderAPI_Command () | |
Set done to False. | |
void | Done () |
Set done to true. | |
void | NotDone () |
Set done to false. | |
Protected Member Functions inherited from BOPAlgo_Options | |
Standard_Boolean | UserBreak (const Message_ProgressScope &thePS) |
Adds error to the report if the break signal was caught. Returns true in this case, false otherwise. | |
BOPAlgo_Options () | |
Empty constructor. | |
BOPAlgo_Options (const Handle< NCollection_BaseAllocator > &theAllocator) | |
Constructor with allocator. | |
virtual | ~BOPAlgo_Options () |
Destructor. | |
const Handle< NCollection_BaseAllocator > & | Allocator () const |
Returns allocator. | |
void | AddError (const Handle< Message_Alert > &theAlert) |
Adds the alert as error (fail) | |
void | AddWarning (const Handle< Message_Alert > &theAlert) |
Adds the alert as warning. | |
Standard_Boolean | HasErrors () const |
Returns true if algorithm has failed. | |
Standard_Boolean | HasError (const Handle< Standard_Type > &theType) const |
Returns true if algorithm has generated error of specified type. | |
Standard_Boolean | HasWarnings () const |
Returns true if algorithm has generated some warning alerts. | |
Standard_Boolean | HasWarning (const Handle< Standard_Type > &theType) const |
Returns true if algorithm has generated warning of specified type. | |
const Handle< Message_Report > & | GetReport () const |
Returns report collecting all errors and warnings. | |
void | DumpErrors (Standard_OStream &theOS) const |
Dumps the error status into the given stream. | |
void | DumpWarnings (Standard_OStream &theOS) const |
Dumps the warning statuses into the given stream. | |
void | ClearWarnings () |
Clears the warnings of the algorithm. | |
void | SetFuzzyValue (const Standard_Real theFuzz) |
Sets the additional tolerance. | |
Standard_Real | FuzzyValue () const |
Returns the additional tolerance. | |
void | SetUseOBB (const Standard_Boolean theUseOBB) |
Enables/Disables the usage of OBB. | |
Standard_Boolean | UseOBB () const |
Returns the flag defining usage of OBB. | |
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. | |
Standard_Boolean | RunParallel () const |
Returns the flag of parallel processing. | |
Protected Attributes | |
Fields | |
TopoDS_Shape | myInputShape |
Input shape to remove the features from. | |
TopTools_ListOfShape | myFacesToRemove |
Features to remove from the shape. | |
Standard_Boolean | myFillHistory |
Defines whether to track the history of shapes modifications or not (true by default) | |
BOPAlgo_RemoveFeatures | myFeatureRemovalTool |
Tool for the features removal. | |
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. | |
Handle< Message_Report > | myReport |
Enables/Disables the usage of OBB. | |
Standard_Boolean | myRunParallel |
Enables/Disables the usage of OBB. | |
Standard_Real | myFuzzyValue |
Enables/Disables the usage of OBB. | |
Standard_Boolean | myUseOBB |
Enables/Disables the usage of OBB. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from BOPAlgo_Options | |
static Standard_Boolean | GetParallelMode () |
Gets the global parallel mode. | |
static void | SetParallelMode (const Standard_Boolean theNewMode) |
Sets the global parallel mode. | |
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 BRepAlgoAPI_Algo.
|
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.
|
virtual |
Returns true if any of the input shapes has been deleted during operation.
|
virtual |
Returns true if any of the input shapes has generated shapes during operation.
|
inline |
Returns whether the history was requested or not.
|
virtual |
Returns true if any of the input shapes has been modified during operation.
|
inline |
Returns the History of shapes modifications.
|
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 |
Defines whether to track the history of shapes modifications or not (true by default)
|
protected |
Input shape to remove the features from.