BRepAlgoAPI
OCCT package BRepAlgoAPI: BRepAlgoAPI_Algo, BRepAlgoAPI_BooleanOperation, BRepAlgoAPI_BuilderAlgo, BRepAlgoAPI_Check, and 6 more bound classes.
BRepAlgoAPI_Algo
Provides the root interface for the API algorithms.
Instance methods(13)
Returns a shape built by the shape construction algorithm. Does not check if the shape is built.
- Clear(): void
Clears all warnings and errors, and any data cached by the algorithm. User defined options are not cleared.
- ClearWarnings(): void
- FuzzyValue(): number
- HasError(theType: Standard_Type): booleanParameters (1)
theType
- HasErrors(): boolean
- HasWarning(theType: Standard_Type): booleanParameters (1)
theType
- HasWarnings(): boolean
- RunParallel(): boolean
- SetFuzzyValue(theFuzz: number): voidParameters (1)
theFuzz
- SetRunParallel(theFlag: boolean): voidParameters (1)
theFlag
- SetUseOBB(theUseOBB: boolean): voidParameters (1)
theUseOBB
BRepAlgoAPI_BooleanOperation
The root API class for performing Boolean Operations on arbitrary shapes.
The arguments of the operation are divided in two groups - Objects and Tools. Each group can contain any number of shapes, but each shape should be valid in terms of BRepCheck_Analyzer and BOPAlgo_ArgumentAnalyzer. The algorithm builds the splits of the given arguments using the intersection results and combines the result of Boolean Operation of given type:
- FUSE - union of two groups of objects;
- COMMON - intersection of two groups of objects;
- CUT - subtraction of one group from the other;
- SECTION - section edges and vertices of all arguments;
The rules for the arguments and type of the operation are the following: - For Boolean operation FUSE all arguments should have equal dimensions;
- For Boolean operation CUT the minimal dimension of Tools should not be less than the maximal dimension of Objects;
- For Boolean operation COMMON the arguments can have any dimension.
- For Boolean operation SECTION the arguments can be of any type.
Additionally to the errors of the base class the algorithm returns the following Errors: - BOPAlgo_AlertBOPNotSet - in case the type of Boolean Operation is not set.
Constructors(1)
Instance methods(6)
- SetTools(theLS: NCollection_List_TopoDS_Shape): voidParameters (1)
theLS
- SetOperation(theBOP: BOPAlgo_Operation): voidParameters (1)
theBOP
- Build(theRange?: Message_ProgressRange): voidParameters (1)
theRange
BRepAlgoAPI_BuilderAlgo
The class contains API level of the General Fuse algorithm.
Additionally to the options defined in the base class, the algorithm has the following options:
- Safe processing mode - allows to avoid modification of the input shapes during the operation (by default it is off);
- Gluing options - allows to speed up the calculation of the intersections on the special cases, in which some sub-shapes are coinciding.
- Disabling the check for inverted solids - Disables/Enables the check of the input solids for inverted status (holes in the space). The default value is TRUE, i.e. the check is performed. Setting this flag to FALSE for inverted solids, most likely will lead to incorrect results.
- Disabling history collection - allows disabling the collection of the history of shapes modifications during the operation.
It returns the following Error statuses: - 0 - in case of success;
- BOPAlgo_AlertTooFewArguments - in case there are no enough arguments to perform the operation;
- BOPAlgo_AlertIntersectionFailed - in case the intersection of the arguments has failed;
- BOPAlgo_AlertBuilderFailed - in case building of the result shape has failed.
Warnings statuses from underlying DS Filler and Builder algorithms are collected in the report.
The class provides possibility to simplify the resulting shape by unification of the tangential edges and faces. It is performed by the method SimplifyResult. See description of this method for more details.
Constructors(1)
Instance methods(20)
- SetNonDestructive(theFlag: boolean): voidParameters (1)
theFlag
- NonDestructive(): boolean
- SetGlue(theGlue: BOPAlgo_GlueEnum): voidParameters (1)
theGlue
- SetCheckInverted(theCheck: boolean): voidParameters (1)
theCheck
- CheckInverted(): boolean
- Build(theRange?: Message_ProgressRange): voidParameters (1)
theRange
- SimplifyResult(theUnifyEdges?: boolean, theUnifyFaces?: boolean, theAngularTol?: number): voidParameters (3)
theUnifyEdgestheUnifyFacestheAngularTol
- Parameters (1)
S
- Parameters (1)
S
- IsDeleted(S: TopoDS_Shape): booleanParameters (1)
S
- HasModified(): boolean
- HasGenerated(): boolean
- HasDeleted(): boolean
- SetToFillHistory(theHistFlag: boolean): voidParameters (1)
theHistFlag
- HasHistory(): boolean
BRepAlgoAPI_Check
The class Check provides a diagnostic tool for checking the validity of the single shape or couple of shapes. The shapes are checked on:
- Topological validity;
- Small edges;
- Self-interference;
- Validity for Boolean operation of certain type (for couple of shapes only).
The class provides two ways of checking shape(-s)
- Constructors
BRepAlgoAPI_CheckaCh(theS); bool isValid = aCh.IsValid(); - Methods SetData and Perform
BRepAlgoAPI_CheckaCh; aCh.SetData(theS1, theS2, BOPAlgo_FUSE, false); aCh.Perform(); bool isValid = aCh.IsValid();
Constructors(3)
- constructor(theS: TopoDS_Shape, bTestSE?: boolean, bTestSI?: boolean, theRange?: Message_ProgressRange): BRepAlgoAPI_CheckParameters (4)
theSbTestSEbTestSItheRange
- constructor(theS1: TopoDS_Shape, theS2: TopoDS_Shape, theOp?: BOPAlgo_Operation, bTestSE?: boolean, bTestSI?: boolean, theRange?: Message_ProgressRange): BRepAlgoAPI_CheckParameters (6)
theS1theS2theOpbTestSEbTestSItheRange
Instance methods(5)
- SetData(theS: TopoDS_Shape, bTestSE: boolean, bTestSI: boolean): voidParameters (3)
theSbTestSEbTestSI
- SetData(theS1: TopoDS_Shape, theS2: TopoDS_Shape, theOp: BOPAlgo_Operation, bTestSE: boolean, bTestSI: boolean): voidParameters (5)
theS1theS2theOpbTestSEbTestSI
- Perform(theRange?: Message_ProgressRange): voidParameters (1)
theRange
- IsValid(): boolean
BRepAlgoAPI_Common
The class provides Boolean common operation between arguments and tools (Boolean Intersection).
Constructors(2)
Empty constructor.
- constructor(S1: TopoDS_Shape, S2: TopoDS_Shape, theRange?: Message_ProgressRange): BRepAlgoAPI_Common
Constructor with two shapes <S1> -argument <S2> -tool <anOperation> - the type of the operation Obsolete.
Parameters (3)S1S2theRange
BRepAlgoAPI_Cut
The class Cut provides Boolean cut operation between arguments and tools (Boolean Subtraction).
Constructors(2)
Empty constructor.
- constructor(S1: TopoDS_Shape, S2: TopoDS_Shape, theRange?: Message_ProgressRange): BRepAlgoAPI_Cut
Constructor with two shapes <S1> -argument <S2> -tool <anOperation> - the type of the operation Obsolete.
Parameters (3)S1S2theRange
BRepAlgoAPI_Defeaturing
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:
- History support;
and the options available from base class: - Error/Warning reporting system;
- Parallel processing mode.
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 ofBOPAlgo_RemoveFeaturesalgorithm.
Limitations
The defeaturing algorithm has the same limitations asBOPAlgo_RemoveFeaturesalgorithm.
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.
Constructors(1)
Instance methods(15)
- SetShape(theShape: TopoDS_Shape): voidParameters (1)
theShape
- AddFaceToRemove(theFace: TopoDS_Shape): voidParameters (1)
theFace
- AddFacesToRemove(theFaces: NCollection_List_TopoDS_Shape): voidParameters (1)
theFaces
- Build(theRange?: Message_ProgressRange): voidParameters (1)
theRange
- SetToFillHistory(theFlag: boolean): voidParameters (1)
theFlag
- HasHistory(): boolean
- Parameters (1)
S
- Parameters (1)
S
- IsDeleted(S: TopoDS_Shape): booleanParameters (1)
S
- HasModified(): boolean
- HasGenerated(): boolean
- HasDeleted(): boolean
BRepAlgoAPI_Fuse
The class provides Boolean fusion operation between arguments and tools (Boolean Union).
Constructors(2)
Empty constructor.
- constructor(S1: TopoDS_Shape, S2: TopoDS_Shape, theRange?: Message_ProgressRange): BRepAlgoAPI_Fuse
Constructor with two shapes <S1> -argument <S2> -tool <anOperation> - the type of the operation Obsolete.
Parameters (3)S1S2theRange
BRepAlgoAPI_Section
The algorithm is to build a Section operation between arguments and tools. The result of Section operation consists of vertices and edges. The result of Section operation contains:
- new vertices that are subjects of V/V, E/E, E/F, F/F interferences
- vertices that are subjects of V/E, V/F interferences
- new edges that are subjects of F/F interferences
- edges that are Common Blocks
Constructors(6)
Empty constructor.
- constructor(S1: TopoDS_Shape, S2: TopoDS_Shape, PerformNow?: boolean): BRepAlgoAPI_Section
Constructor with two shapes <S1> -argument <S2> -tool <PerformNow> - the flag: if <PerformNow>=True - the algorithm is performed immediately Obsolete.
Parameters (3)S1S2PerformNow
- constructor(S1: TopoDS_Shape, Pl: gp_Pln, PerformNow?: boolean): BRepAlgoAPI_Section
Constructor with two shapes <S1> - argument <Pl> - tool <PerformNow> - the flag: if <PerformNow>=True - the algorithm is performed immediately Obsolete.
Parameters (3)S1PlPerformNow
- constructor(S1: TopoDS_Shape, Sf: Geom_Surface, PerformNow?: boolean): BRepAlgoAPI_Section
Constructor with two shapes <S1> - argument <Sf> - tool <PerformNow> - the flag: if <PerformNow>=True - the algorithm is performed immediately Obsolete.
Parameters (3)S1SfPerformNow
- constructor(Sf: Geom_Surface, S2: TopoDS_Shape, PerformNow?: boolean): BRepAlgoAPI_Section
Constructor with two shapes <Sf> - argument <S2> - tool <PerformNow> - the flag: if <PerformNow>=True - the algorithm is performed immediately Obsolete.
Parameters (3)SfS2PerformNow
- constructor(Sf1: Geom_Surface, Sf2: Geom_Surface, PerformNow?: boolean): BRepAlgoAPI_Section
Constructor with two shapes <Sf1> - argument <Sf2> - tool <PerformNow> - the flag: if <PerformNow>=True - the algorithm is performed immediately Obsolete.
Parameters (3)Sf1Sf2PerformNow
Instance methods(11)
initialize the argument <Pl> - argument Obsolete
Parameters (1)Pl
- Init1(Sf: Geom_Surface): void
initialize the argument <Sf> - argument Obsolete
Parameters (1)Sf
- Init2(S2: TopoDS_Shape): void
initialize the tool <S2> - tool Obsolete
Parameters (1)S2
initialize the tool <Pl> - tool Obsolete
Parameters (1)Pl
- Init2(Sf: Geom_Surface): void
initialize the tool <Sf> - tool Obsolete
Parameters (1)Sf
- Approximation(B: boolean): voidParameters (1)
B
- ComputePCurveOn1(B: boolean): void
Indicates whether the P-Curve should be (or not) performed on the argument. By default, no parametric 2D curve (pcurve) is defined for the edges of the result. If ComputePCurve1 equals true, further computations performed to attach an P-Curve in the parametric space of the argument to the constructed edges. Obsolete.
Parameters (1)B
- ComputePCurveOn2(B: boolean): void
Indicates whether the P-Curve should be (or not) performed on the tool. By default, no parametric 2D curve (pcurve) is defined for the edges of the result. If ComputePCurve1 equals true, further computations performed to attach an P-Curve in the parametric space of the tool to the constructed edges. Obsolete.
Parameters (1)B
- Build(theRange?: Message_ProgressRange): void
Performs the algorithm Filling interference Data Structure (if it is necessary) Building the result of the operation.
Parameters (1)theRange
- HasAncestorFaceOn1(E: TopoDS_Shape, F: TopoDS_Shape): boolean
get the face of the first part giving section edge <E>. Returns True on the 3 following conditions : 1/ <E> is an edge returned by the
Shape()metwod. 2/ First part of section performed is a shape. 3/ <E> is built on a intersection curve (i.e <E> is not the result of common edges) When False, F remains untouched. ObsoleteParameters (2)EF—Mutated in place; read the updated value from this argument after the call.
- HasAncestorFaceOn2(E: TopoDS_Shape, F: TopoDS_Shape): boolean
Identifies the ancestor faces of the intersection edge E resulting from the last computation performed in this framework, that is, the faces of the two original shapes on which the edge E lies:
- HasAncestorFaceOn1 gives the ancestor face in the first shape, and
- HasAncestorFaceOn2 gives the ancestor face in the second shape. These functions return true if an ancestor face F is found, or false if not. An ancestor face is identifiable for the edge E if the following conditions are satisfied:
- the first part on which this algorithm performed its last computation is a shape, that is, it was not given as a surface or a plane at the time of construction of this algorithm or at a later time by the Init1 function,
- E is one of the elementary edges built by the last computation of this section algorithm. To use these functions properly, you have to test the returned Boolean value before using the ancestor face: F is significant only if the returned Boolean value equals true. Obsolete
Parameters (2)EF—Mutated in place; read the updated value from this argument after the call.
BRepAlgoAPI_Splitter
The class contains API level of the Splitter algorithm, which allows splitting a group of arbitrary shapes by the other group of arbitrary shapes. The arguments of the operation are divided on two groups: Objects - shapes that will be split; Tools - shapes by which the Objects will be split. The result of the operation contains only the split parts of the shapes from the group of Objects. The split parts of the shapes from the group of Tools are excluded from the result. The shapes can be split by the other shapes from the same group (in case these shapes are interfering).
The class is a General Fuse based algorithm. Thus, all options of the General Fuse algorithm such as Fuzzy mode, safe processing mode, parallel processing mode, gluing mode and history support are also available in this algorithm. There is no requirement on the existence of the Tools shapes. And if there are no Tools shapes, the result of the splitting operation will be equivalent to the General Fuse result.
The algorithm returns the following Error statuses:
- 0 - in case of success;
- BOPAlgo_AlertTooFewArguments - in case there is no enough arguments for the operation;
- BOPAlgo_AlertIntersectionFailed - in case the Intersection of the arguments has failed;
- BOPAlgo_AlertBuilderFailed - in case the Building of the result has failed.
Constructors(1)
Instance methods(2)
- Build(theRange?: Message_ProgressRange): voidParameters (1)
theRange