OCC.BRepAlgoAPI module¶

class
OCC.BRepAlgoAPI.
BRepAlgoAPI_BooleanOperation
(*args, **kwargs)¶ Bases:
OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

BuilderCanWork
()¶ Return type: bool

Destroy
()¶ Return type: None

ErrorStatus
()¶  Returns the error status of operation. 0  Ok 1  The Object is created but Nothing is Done 2  Null source shapes is not allowed 3  Check types of the arguments 4  Can not allocate memory for the DSFiller 5  The Builder can not work with such types of arguments 6  Unknown operation is not allowed 7  Can not allocate memory for the Builder > 100  See the Builder’s ErrorStatus
Return type: int

FuseEdges
()¶  Returns the flag of edge refining
Return type: bool

HasDeleted
()¶  Returns true if there is at least one deleted shape. For use in BRepNaming.
Return type: bool

HasGenerated
()¶  Returns true if there is at least one generated shape. For use in BRepNaming.
Return type: bool

HasModified
()¶  Returns true if there is at least one modified shape. For use in BRepNaming.
Return type: bool

Operation
()¶  Returns the type of Boolean Operation that has been performed.
Return type: BOPAlgo_Operation

RefineEdges
()¶  Fuse C1 edges
Return type: None

SectionEdges
()¶  Returns a list of section edges. The edges represent the result of intersection between arguments of Boolean Operation. They are computed during operation execution.
Return type: TopTools_ListOfShape

SetOperation
()¶  Sets the type of Boolean operation to perform It can be BOPAlgo_SECTION BOPAlgo_COMMON BOPAlgo_FUSE BOPAlgo_CUT BOPAlgo_CUT21
Parameters: anOp (BOPAlgo_Operation) – Return type: None

Shape1
()¶  Returns the first shape involved in this Boolean operation.
Return type: TopoDS_Shape

Shape2
()¶  Returns the second shape involved in this Boolean operation.
Return type: TopoDS_Shape

thisown
¶ The membership flag


class
OCC.BRepAlgoAPI.
BRepAlgoAPI_Check
(*args)¶ Bases:
object

IsValid
()¶  Shows whether shape(s) valid or not.
Return type: bool

Perform
()¶  Performs the check.
Return type: None

Result
()¶  Returns faulty shapes.
Return type: BOPAlgo_ListOfCheckResult

SetData
()¶  Sets data for check by Init method. The method provides alternative way for checking single shape.
Parameters:  theS (TopoDS_Shape &) –
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None
 Sets data for check by Init method. The method provides alternative way for checking single shape.
Parameters:  theS (TopoDS_Shape &) –
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None
 Sets data for check by Init method. The method provides alternative way for checking single shape.
Parameters:  theS (TopoDS_Shape &) –
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None
 Sets data for check by Init method. The method provides alternative way for checking couple of shapes.
Parameters:  theS1 (TopoDS_Shape &) –
 theS2 (TopoDS_Shape &) –
 theOp (BOPAlgo_Operation) – default value is BOPAlgo_UNKNOWN
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None
 Sets data for check by Init method. The method provides alternative way for checking couple of shapes.
Parameters:  theS1 (TopoDS_Shape &) –
 theS2 (TopoDS_Shape &) –
 theOp (BOPAlgo_Operation) – default value is BOPAlgo_UNKNOWN
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None
 Sets data for check by Init method. The method provides alternative way for checking couple of shapes.
Parameters:  theS1 (TopoDS_Shape &) –
 theS2 (TopoDS_Shape &) –
 theOp (BOPAlgo_Operation) – default value is BOPAlgo_UNKNOWN
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None
 Sets data for check by Init method. The method provides alternative way for checking couple of shapes.
Parameters:  theS1 (TopoDS_Shape &) –
 theS2 (TopoDS_Shape &) –
 theOp (BOPAlgo_Operation) – default value is BOPAlgo_UNKNOWN
 bTestSE (bool) – default value is Standard_True
 bTestSI (bool) – default value is Standard_True
Return type: None

thisown
¶ The membership flag


class
OCC.BRepAlgoAPI.
BRepAlgoAPI_Common
(*args)¶ Bases:
OCC.BRepAlgoAPI.BRepAlgoAPI_BooleanOperation

thisown
¶ The membership flag


class
OCC.BRepAlgoAPI.
BRepAlgoAPI_Cut
(*args)¶ Bases:
OCC.BRepAlgoAPI.BRepAlgoAPI_BooleanOperation

thisown
¶ The membership flag


class
OCC.BRepAlgoAPI.
BRepAlgoAPI_Fuse
(*args)¶ Bases:
OCC.BRepAlgoAPI.BRepAlgoAPI_BooleanOperation

thisown
¶ The membership flag


class
OCC.BRepAlgoAPI.
BRepAlgoAPI_Section
(*args)¶ Bases:
OCC.BRepAlgoAPI.BRepAlgoAPI_BooleanOperation

Approximation
()¶  Defines an option for computation of further intersections. This computation will be performed by the function Build in this framework. By default, the underlying 3D geometry attached to each elementary edge of the result of a computed intersection is:  analytic where possible, provided the corresponding geometry corresponds to a type of analytic curve defined in the Geom package; for example the intersection of a cylindrical shape with a plane gives an ellipse or a circle;  or elsewhere, given as a succession of points grouped together in a BSpline curve of degree 1. If Approx equals true, when further computations are performed in this framework with the function Build, these edges will have an attached 3D geometry which is a BSpline approximation of the computed set of points. Note that as a result, approximations will be computed on edges built only on new intersection lines.
Parameters: B (bool) – Return type: None

ComputePCurveOn1
()¶  Indicates if the Pcurve must be (or not) performed on first part.
Parameters: B (bool) – Return type: None

ComputePCurveOn2
()¶  Define options for the computation of further intersections, which will be performed by the function Build in this framework. By default, no parametric 2D curve (pcurve) is defined for the elementary edges of the result. If ComputePCurve1 equals true, further computations performed in this framework with the function Build will attach an additional pcurve in the parametric space of the first shape to the constructed edges. If ComputePCurve2 equals true, the additional pcurve will be attached to the constructed edges in the parametric space of the second shape. These two functions may be used together.
Parameters: B (bool) – Return type: None

HasAncestorFaceOn1
()¶  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() method. 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.
Parameters:  E (TopoDS_Shape &) –
 F (TopoDS_Shape &) –
Return type: bool

HasAncestorFaceOn2
()¶  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.
Parameters:  E (TopoDS_Shape &) –
 F (TopoDS_Shape &) –
Return type: bool

Init1
()¶  initialize first part
Parameters: S1 (TopoDS_Shape &) – Return type: None  initialize first part
Parameters: Pl (gp_Pln) – Return type: None  initialize first part
Parameters: Sf (Handle_Geom_Surface &) – Return type: None

Init2
()¶  initialize second part
Parameters: S2 (TopoDS_Shape &) – Return type: None  initialize second part
Parameters: Pl (gp_Pln) – Return type: None  Reinitializes the first and the second parts on which this algorithm is going to perform the intersection computation. This is done with either: the surface Sf, the plane Pl or the shape Sh. You use the function Build to construct the result.
Parameters: Sf (Handle_Geom_Surface &) – Return type: None

thisown
¶ The membership flag


class
OCC.BRepAlgoAPI.
SwigPyIterator
(*args, **kwargs)¶ Bases:
object

advance
()¶

copy
()¶

decr
()¶

distance
()¶

equal
()¶

incr
()¶

next
()¶

previous
()¶

thisown
¶ The membership flag

value
()¶


class
OCC.BRepAlgoAPI.
brepalgoapi
(*args, **kwargs)¶ Bases:
object

static
DumpOper
(*args)¶  Check shapes on validity for boolean operation. Dump arguments and result of boolean operation in the file specified by path.
Parameters:  theFilePath (char *) –
 theShape1 (TopoDS_Shape &) –
 theShape2 (TopoDS_Shape &) –
 theResult (TopoDS_Shape &) –
 theOperation (BOPAlgo_Operation) –
 isNonValidArgs (bool) –
Return type: void

thisown
¶ The membership flag

static

OCC.BRepAlgoAPI.
brepalgoapi_DumpOper
(*args)¶  Check shapes on validity for boolean operation. Dump arguments and result of boolean operation in the file specified by path.
Parameters:  theFilePath (char *) –
 theShape1 (TopoDS_Shape &) –
 theShape2 (TopoDS_Shape &) –
 theResult (TopoDS_Shape &) –
 theOperation (BOPAlgo_Operation) –
 isNonValidArgs (bool) –
Return type: void