OCC.BRepAlgo module

The BRepAlgo package provides a full range ofservices to perform Old Boolean Operations in Open CASCADE.Attention:The New Boolean Operation has replaced the OldBoolean Operations algorithm in the BrepAlgoAPIpackage in Open CASCADE.

class BRepAlgo_AsDes(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Creates an empty AsDes.
Return type:None
Add()
  • Stores <SS> as a futur subshape of <S>.
Parameters:
  • S (TopoDS_Shape &) –
  • SS (TopoDS_Shape &) –
Return type:

None

  • Stores <SS> as futurs SubShapes of <S>.
Parameters:
  • S (TopoDS_Shape &) –
  • SS (TopTools_ListOfShape &) –
Return type:

None

Ascendant()
  • Returns the Shape containing <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
ChangeDescendant()
  • Returns futur subhapes of <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
Clear()
Return type:None
Descendant()
  • Returns futur subhapes of <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
GetHandle()
HasAscendant()
Parameters:S (TopoDS_Shape &) –
Return type:bool
HasCommonDescendant()
  • Returns True if (S1> and <S2> has common Descendants. Stores in <LC> the Commons Descendants.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
  • LC (TopTools_ListOfShape &) –
Return type:

bool

HasDescendant()
Parameters:S (TopoDS_Shape &) –
Return type:bool
Remove()
  • Remove <S> from me.
Parameters:S (TopoDS_Shape &) –
Return type:None
Replace()
  • Replace <OldS> by <NewS>. <OldS> disapear from <self>.
Parameters:
  • OldS (TopoDS_Shape &) –
  • NewS (TopoDS_Shape &) –
Return type:

None

thisown

The membership flag

class BRepAlgo_BooleanOperation(*args, **kwargs)

Bases: OCC.BRepBuilderAPI.BRepBuilderAPI_MakeShape

Builder()
Return type:Handle_TopOpeBRepBuild_HBuilder
Perform()
Parameters:
  • St1 (TopAbs_State) –
  • St2 (TopAbs_State) –
Return type:

None

PerformDS()
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 BRepAlgo_BooleanOperations(*args)

Bases: object

Return type:None
Builder()
Return type:Handle_TopOpeBRepBuild_HBuilder
ChangeBuilder()
Return type:Handle_TopOpeBRepBuild_HBuilder
ChangeDataStructure()
Return type:Handle_TopOpeBRepDS_HDataStructure
Common()
  • returns the common part of the shapes.
Return type:TopoDS_Shape
Cut()
  • returns the cut part of the shapes.
Return type:TopoDS_Shape
DataStructure()
Return type:Handle_TopOpeBRepDS_HDataStructure
DataStructureAccess()
  • returns the member myDSA. It is useful to then access the method GetSectionEdgeSet (wich is a member of DSAccess)
Return type:BRepAlgo_DSAccess
Define()
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
  • HDS (Handle_TopOpeBRepDS_HDataStructure &) –
Return type:

None

Fus()
  • returns the fuse part of the shapes.
Return type:TopoDS_Shape
IsDeleted()
  • Returns the fact that the shape <S> has been deleted or not by the boolean operation.
Parameters:S (TopoDS_Shape &) –
Return type:bool
Modified()
  • Returns the list of the descendant shapes of the shape <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
Section()
  • returns the intersection of the shapes.
Return type:TopoDS_Shape
SetApproxParameters()
  • Sets different parameters for the curve approximations : NbPntMax : Maximum number of points to be approximated at the same time in one curve. Tol3D, Tol2D : Tolerances to be reached by the approximation. RelativeTol : The given tolerances are relative.
Parameters:
Return type:

None

Shape()
  • returns the result of the boolean operation.
Return type:TopoDS_Shape
ShapeFrom()
  • Returns the shape(s) resulting of the boolean operation issued from the shape <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopoDS_Shape
Shapes()
  • Defines the arguments.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

Shapes2d()
  • S1 is a Shell with ALL faces supported by the SAME S2 is an Edge INCLUDED in that surface with pcurve. this avoids a time-consuming 3D operation, compared to Shapes.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

thisown

The membership flag

class BRepAlgo_Common(*args)

Bases: OCC.BRepAlgo.BRepAlgo_BooleanOperation

  • Constructs the common part of shapes S1 and S2.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

thisown

The membership flag

class BRepAlgo_Cut(*args)

Bases: OCC.BRepAlgo.BRepAlgo_BooleanOperation

  • Cuts the shape S2 from the shape S1.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

thisown

The membership flag

class BRepAlgo_DSAccess(*args)

Bases: object

Return type:None
Builder()
Return type:Handle_TopOpeBRepBuild_HBuilder
ChangeBuilder()
Return type:Handle_TopOpeBRepBuild_HBuilder
ChangeDS()
Return type:Handle_TopOpeBRepDS_HDataStructure
ChangeEdgeSet()
  • Modifies a line of section. <New> – should be a Group of Edges connected by Vertex. – Can be a Wire. Can be a group of connected Edges that do not form a standard Wire. <New> should be sub-groupn of <Old>
Parameters:
  • Old (TopoDS_Shape &) –
  • New (TopoDS_Shape &) –
Return type:

None

Check()
  • NYI coherence of the internal Data Structure.
Return type:BRepAlgo_CheckStatus
DS()
Return type:Handle_TopOpeBRepDS_HDataStructure
GetSectionEdgeSet()
  • returns compounds of Edge connected with section, which contains sections between faces contained in S1 and S2. returns an empty list of Shape if S1 or S2 do not contain face. calls GetSectionEdgeSet() if it has not already been done
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

TopTools_ListOfShape

  • returns all compounds of edges connected with section contained in the DS
Return type:TopTools_ListOfShape
Init()
  • Clears the internal data structure, including the
Return type:None
Intersect()
  • Intersects two shapes at input and loads the DS with their intersection. Clears the TopOpeBRepBuild_HBuilder if necessary
Return type:None
  • Intersects the faces contained in two given shapes and loads them in the DS. Clears the TopOpeBRepBuild_HBuilder if necessary
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

IsWire()
  • NYI
Parameters:Compound (TopoDS_Shape &) –
Return type:bool
Load()
  • Loads the shape in DS.
Parameters:S (TopoDS_Shape &) –
Return type:None
  • Loads two shapes in the DS without intersecting them.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

Merge()
Parameters:
  • state1 (TopAbs_State) –
  • state2 (TopAbs_State) –
  • state1
Return type:

TopoDS_Shape

Return type:

TopoDS_Shape

Modified()
  • Returns the list of the descendant shapes of the shape <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
Propagate()
  • NYI Propagation of a state starting from the shape FromShape = edge or vertex of section, face or Coumpound de section. LoadShape is either S1, or S2 (see the method Load). Propagation from FromShape, on the states <what> of LoadShape. Return a Wire in 2d, a Shell in 3d. Specifications are incomplete, to be redefined for the typologies correpsonding to <FromShape> and the result : exemple : FromShape resultat vertex wire (or edge) edge of section face (or shell) compound of section shell … …
Parameters:
  • what (TopAbs_State) –
  • FromShape (TopoDS_Shape &) –
  • LoadShape (TopoDS_Shape &) –
Return type:

TopoDS_Shape

PropagateFromSection()
  • SectionShape est soit un Vertex de section(NYI), soit une Edge de section. Propagation des shapes de section en partant de SectionShape. return un Compound de section.
Parameters:SectionShape (TopoDS_Shape &) –
Return type:TopoDS_Shape
SameDomain()
  • This method does the same thing as the previous, but faster. There is no intersection face/face 3D. The faces have the same support(surface). No test of tangency (that is why it is faster). Intersects in 2d the faces tangent F1 anf F2.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

SectionVertex()
  • NYI returns the vertex of section, which contains the section between face S1 and edge S2 (returns an empty Shape if S1 is not a face or if S2 is not an edge)
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

TopTools_ListOfShape

SuppressEdgeSet()
  • Invalidates a complete line of section. All Edges connected by Vertex or a Wire. Can be a group of connected Edges, which do not form a standard Wire.
Parameters:Compound (TopoDS_Shape &) –
Return type:None
SuppressSectionVertex()
  • NYI Make invalid a Vertex of section. The Vertex shoud be reconstructed from a point.
Parameters:V (TopoDS_Vertex &) –
Return type:None
Wire()
  • NYI
Parameters:Compound (TopoDS_Shape &) –
Return type:TopoDS_Shape
thisown

The membership flag

class BRepAlgo_DataMapIteratorOfDataMapOfShapeBoolean(*args)

Bases: OCC.TCollection.TCollection_BasicMapIterator

Return type:None
Parameters:aMap (BRepAlgo_DataMapOfShapeBoolean &) –
Return type:None
Initialize()
Parameters:aMap (BRepAlgo_DataMapOfShapeBoolean &) –
Return type:None
Key()
Return type:TopoDS_Shape
Value()
Return type:bool
thisown

The membership flag

class BRepAlgo_DataMapIteratorOfDataMapOfShapeInterference(*args)

Bases: OCC.TCollection.TCollection_BasicMapIterator

Return type:None
Parameters:aMap (BRepAlgo_DataMapOfShapeInterference &) –
Return type:None
Initialize()
Parameters:aMap (BRepAlgo_DataMapOfShapeInterference &) –
Return type:None
Key()
Return type:TopoDS_Shape
Value()
Return type:Handle_TopOpeBRepDS_Interference
thisown

The membership flag

class BRepAlgo_DataMapNodeOfDataMapOfShapeBoolean(*args)

Bases: OCC.TCollection.TCollection_MapNode

Parameters:
  • K (TopoDS_Shape &) –
  • I (bool) –
  • n (TCollection_MapNodePtr &) –
Return type:

None

GetHandle()
GetValue()

BRepAlgo_DataMapNodeOfDataMapOfShapeBoolean_GetValue(BRepAlgo_DataMapNodeOfDataMapOfShapeBoolean self) -> Standard_Boolean

Key()
Return type:TopoDS_Shape
SetValue()

BRepAlgo_DataMapNodeOfDataMapOfShapeBoolean_SetValue(BRepAlgo_DataMapNodeOfDataMapOfShapeBoolean self, Standard_Boolean value)

thisown

The membership flag

class BRepAlgo_DataMapNodeOfDataMapOfShapeInterference(*args)

Bases: OCC.TCollection.TCollection_MapNode

Parameters:
  • K (TopoDS_Shape &) –
  • I (Handle_TopOpeBRepDS_Interference &) –
  • n (TCollection_MapNodePtr &) –
Return type:

None

GetHandle()
Key()
Return type:TopoDS_Shape
Value()
Return type:Handle_TopOpeBRepDS_Interference
thisown

The membership flag

class BRepAlgo_DataMapOfShapeBoolean(*args)

Bases: OCC.TCollection.TCollection_BasicMap

Parameters:NbBuckets (int) – default value is 1
Return type:None
Assign()
Parameters:Other (BRepAlgo_DataMapOfShapeBoolean &) –
Return type:BRepAlgo_DataMapOfShapeBoolean
Bind()
Parameters:
  • K (TopoDS_Shape &) –
  • I (bool) –
Return type:

bool

ChangeFind()
Parameters:K (TopoDS_Shape &) –
Return type:bool
ChangeFind1()
Parameters:K (TopoDS_Shape &) –
Return type:Standard_Address
Clear()
Return type:None
Find()
Parameters:K (TopoDS_Shape &) –
Return type:bool
Find1()
Parameters:K (TopoDS_Shape &) –
Return type:Standard_Address
IsBound()
Parameters:K (TopoDS_Shape &) –
Return type:bool
ReSize()
Parameters:NbBuckets (int) –
Return type:None
Set()
Parameters:Other (BRepAlgo_DataMapOfShapeBoolean &) –
Return type:BRepAlgo_DataMapOfShapeBoolean
UnBind()
Parameters:K (TopoDS_Shape &) –
Return type:bool
thisown

The membership flag

class BRepAlgo_DataMapOfShapeInterference(*args)

Bases: OCC.TCollection.TCollection_BasicMap

Parameters:NbBuckets (int) – default value is 1
Return type:None
Assign()
Parameters:Other (BRepAlgo_DataMapOfShapeInterference &) –
Return type:BRepAlgo_DataMapOfShapeInterference
Bind()
Parameters:
  • K (TopoDS_Shape &) –
  • I (Handle_TopOpeBRepDS_Interference &) –
Return type:

bool

ChangeFind()
Parameters:K (TopoDS_Shape &) –
Return type:Handle_TopOpeBRepDS_Interference
ChangeFind1()
Parameters:K (TopoDS_Shape &) –
Return type:Standard_Address
Clear()
Return type:None
Find()
Parameters:K (TopoDS_Shape &) –
Return type:Handle_TopOpeBRepDS_Interference
Find1()
Parameters:K (TopoDS_Shape &) –
Return type:Standard_Address
IsBound()
Parameters:K (TopoDS_Shape &) –
Return type:bool
ReSize()
Parameters:NbBuckets (int) –
Return type:None
Set()
Parameters:Other (BRepAlgo_DataMapOfShapeInterference &) –
Return type:BRepAlgo_DataMapOfShapeInterference
UnBind()
Parameters:K (TopoDS_Shape &) –
Return type:bool
thisown

The membership flag

class BRepAlgo_EdgeConnector(*args)

Bases: OCC.MMgt.MMgt_TShared

Return type:None
Add()
Parameters:
  • e (TopoDS_Edge &) –
  • LOEdge (TopTools_ListOfShape &) –
Return type:

None

Return type:

None

AddStart()
Parameters:
  • e (TopoDS_Shape &) –
  • LOEdge (TopTools_ListOfShape &) –
Return type:

None

Return type:

None

ClearStartElement()
Return type:None
Done()
Return type:None
GetHandle()
IsDone()
  • NYI returns true if proceeded to MakeBlock()
Return type:bool
IsWire()
  • NYI returns true if W is a Wire standard. W must belong to the list returned by MakeBlock.
Parameters:W (TopoDS_Shape &) –
Return type:bool
MakeBlock()
  • returns a list of wire non standard
Return type:TopTools_ListOfShape
thisown

The membership flag

class BRepAlgo_FaceRestrictor(*args)

Bases: object

Return type:None
Add()
  • Add the wire <W> to the set of wires. //! Warning: The Wires must be closed. //! The edges of <W> can be modified if they have not pcurves on the surface <S> of <F>. In this case if <Proj> is false the first pcurve of the edge is positionned on <S>. if <Proj> is True ,the Pcurve On <S> is the projection of the curve 3d on <F>.
Parameters:W (TopoDS_Wire &) –
Return type:None
Clear()
  • Removes all the Wires
Return type:None
Current()
Return type:TopoDS_Face
Init()
  • the surface of <F> will be the the surface of each new faces built. <Proj> is used to update pcurves on edges if necessary. See Add().
Parameters:
  • F (TopoDS_Face &) –
  • Proj (bool) – default value is Standard_False
  • ControlOrientation (bool) – default value is Standard_False
Return type:

None

IsDone()
Return type:bool
More()
Return type:bool
Next()
Return type:None
Perform()
  • Evaluate all the faces limited by the set of Wires.
Return type:None
thisown

The membership flag

class BRepAlgo_Fuse(*args)

Bases: OCC.BRepAlgo.BRepAlgo_BooleanOperation

  • Fuse S1 and S2.
Parameters:
  • S1 (TopoDS_Shape &) –
  • S2 (TopoDS_Shape &) –
Return type:

None

thisown

The membership flag

class BRepAlgo_Image(*args)

Bases: object

Return type:None
Add()
  • Add <NewS> to the image of <OldS>.
Parameters:
  • OldS (TopoDS_Shape &) –
  • NewS (TopoDS_Shape &) –
Return type:

None

  • Add <NewS> to the image of <OldS>.
Parameters:
  • OldS (TopoDS_Shape &) –
  • NewS (TopTools_ListOfShape &) –
Return type:

None

Bind()
  • Links <NewS> as image of <OldS>.
Parameters:
  • OldS (TopoDS_Shape &) –
  • NewS (TopoDS_Shape &) –
Return type:

None

  • Links <NewS> as image of <OldS>.
Parameters:
  • OldS (TopoDS_Shape &) –
  • NewS (TopTools_ListOfShape &) –
Return type:

None

Clear()
Return type:None
Compact()
  • Keeps only the link between roots and lastimage.
Return type:None
Filter()
  • Deletes in the images the shape of type <ShapeType> which are not in <S>. Warning: Compact() must be call before.
Parameters:
  • S (TopoDS_Shape &) –
  • ShapeType (TopAbs_ShapeEnum) –
Return type:

None

HasImage()
Parameters:S (TopoDS_Shape &) –
Return type:bool
Image()
  • Returns the Image of <S>. Returns <S> in the list if HasImage(S) is false.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
ImageFrom()
  • Returns the generator of <S>
Parameters:S (TopoDS_Shape &) –
Return type:TopoDS_Shape
IsImage()
Parameters:S (TopoDS_Shape &) –
Return type:bool
LastImage()
  • Stores in <L> the images of images of…images of <S>. <L> contains only <S> if HasImage(S) is false.
Parameters:
  • S (TopoDS_Shape &) –
  • L (TopTools_ListOfShape &) –
Return type:

None

Remove()
  • Remove <S> to set of images.
Parameters:S (TopoDS_Shape &) –
Return type:None
Root()
  • Returns the upper generator of <S>
Parameters:S (TopoDS_Shape &) –
Return type:TopoDS_Shape
Roots()
Return type:TopTools_ListOfShape
SetRoot()
Parameters:S (TopoDS_Shape &) –
Return type:None
thisown

The membership flag

class BRepAlgo_Loop(*args)

Bases: object

Return type:None
AddConstEdge()
  • Add <E> as const edge, E can be in the result.
Parameters:E (TopoDS_Edge &) –
Return type:None
AddConstEdges()
  • Add <LE> as a set of const edges.
Parameters:LE (TopTools_ListOfShape &) –
Return type:None
AddEdge()
  • Add E with <LV>. <E> will be copied and trim by vertices in <LV>.
Parameters:
  • E (TopoDS_Edge &) –
  • LV (TopTools_ListOfShape &) –
Return type:

None

CutEdge()
  • Cut the edge <E> in several edges <NE> on the vertices<VonE>.
Parameters:
  • E (TopoDS_Edge &) –
  • VonE (TopTools_ListOfShape &) –
  • NE (TopTools_ListOfShape &) –
Return type:

None

GetVerticesForSubstitute()
  • Returns the datamap of vertices with their substitutes.
Parameters:VerVerMap (TopTools_DataMapOfShapeShape &) –
Return type:None
Init()
  • Init with <F> the set of edges must have pcurves on <F>.
Parameters:F (TopoDS_Face &) –
Return type:None
NewEdges()
  • Returns the list of new edges built from an edge <E> it can be an empty list.
Parameters:E (TopoDS_Edge &) –
Return type:TopTools_ListOfShape
NewFaces()
  • Returns the list of faces. Warning: The method <WiresToFaces> as to be called before. can be an empty list.
Return type:TopTools_ListOfShape
NewWires()
  • Returns the list of wires performed. can be an empty list.
Return type:TopTools_ListOfShape
Perform()
  • Make loops.
Return type:None
VerticesForSubstitute()
Parameters:VerVerMap (TopTools_DataMapOfShapeShape &) –
Return type:None
WiresToFaces()
  • Build faces from the wires result.
Return type:None
thisown

The membership flag

class BRepAlgo_NormalProjection(*args)

Bases: object

Return type:None
Parameters:S (TopoDS_Shape &) –
Return type:None
Add()
  • Add an edge or a wire to the list of shape to project
Parameters:ToProj (TopoDS_Shape &) –
Return type:None
Ancestor()
  • For a resulting edge, returns the corresponding initial edge.
Parameters:E (TopoDS_Edge &) –
Return type:TopoDS_Shape
Build()
  • Builds the result as a compound.
Return type:None
BuildWire()
  • build the result as a list of wire if possible in – a first returns a wire only if there is only a wire.
Parameters:Liste (TopTools_ListOfShape &) –
Return type:bool
Compute3d()
  • if With3d = Standard_False the 3dcurve is not computed the initial 3dcurve is kept to build the resulting edges.
Parameters:With3d (bool) – default value is Standard_True
Return type:None
Couple()
  • For a projected edge, returns the corresponding initial face.
Parameters:E (TopoDS_Edge &) –
Return type:TopoDS_Shape
Generated()
  • Returns the list of shapes generated from the shape <S>.
Parameters:S (TopoDS_Shape &) –
Return type:TopTools_ListOfShape
Init()
Parameters:S (TopoDS_Shape &) –
Return type:None
IsDone()
Return type:bool
IsElementary()
Parameters:C (Adaptor3d_Curve &) –
Return type:bool
Projection()
  • returns the result
Return type:TopoDS_Shape
SetDefaultParams()
  • Set the parameters used for computation in their default values
Return type:None
SetLimit()
  • Manage limitation of projected edges.
Parameters:FaceBoundaries (bool) – default value is Standard_True
Return type:None
SetMaxDistance()
  • Sets the maximum distance between target shape and shape to project. If this condition is not satisfied then corresponding part of solution is discarded. if MaxDist < 0 then this method does not affect the algorithm
Parameters:MaxDist (float) –
Return type:None
SetParams()
  • Set the parameters used for computation Tol3d is the requiered tolerance between the 3d projected curve and its 2d representation InternalContinuity is the order of constraints used for approximation. MaxDeg and MaxSeg are the maximum degree and the maximum number of segment for BSpline resulting of an approximation.
Parameters:
  • Tol3D (float) –
  • Tol2D (float) –
  • InternalContinuity (GeomAbs_Shape) –
  • MaxDegree (int) –
  • MaxSeg (int) –
Return type:

None

thisown

The membership flag

class BRepAlgo_Section(*args)

Bases: OCC.BRepAlgo.BRepAlgo_BooleanOperation

Parameters:
  • Sh1 (TopoDS_Shape &) –
  • Sh2 (TopoDS_Shape &) –
  • PerformNow (bool) – default value is Standard_True
  • Sh (TopoDS_Shape &) –
  • Pl (gp_Pln) –
  • PerformNow – default value is Standard_True
  • Sh
  • Sf (Handle_Geom_Surface &) –
  • PerformNow – default value is Standard_True
  • Sf
  • Sh
  • PerformNow – default value is Standard_True
Return type:

None

Return type:

None

Return type:

None

Return type:

None

  • This and the above algorithms construct a framework for computing the section lines of - the two shapes Sh1 and Sh2, or - the shape Sh and the plane Pl, or - the shape Sh and the surface Sf, or - the surface Sf and the shape Sh, or - the two surfaces Sf1 and Sf2, and builds the result if PerformNow equals true, its default value. If PerformNow equals false, the intersection will be computed later by the function Build. The constructed shape will be returned by the function Shape. This is a compound object composed of edges. These intersection edges may be built: - on new intersection lines, or - on coincident portions of edges in the two intersected shapes. These intersection edges are independent: they are not chained or grouped in wires. If no intersection edge exists, the result is an empty compound object. Note that other objects than TopoDS_Shape shapes involved in these syntaxes are converted into faces or shells before performing the computation of the intersection. A shape resulting from this conversion can be retrieved with the function Shape1 or Shape2. Parametric 2D curves on intersection edges No parametric 2D curve (pcurve) is defined for each elementary edge of the result. To attach such parametric curves to the constructed edges you may use a constructor with the PerformNow flag equal to false; then you use: - the function ComputePCurveOn1 to ask for the additional computation of a pcurve in the parametric space of the first shape, - the function ComputePCurveOn2 to ask for the additional computation of a pcurve in the parametric space of the second shape, - in the end, the function Build to construct the result. Note that as a result, pcurves will only be added on edges built on new intersection lines. Approximation of intersection edges The underlying 3D geometry attached to each elementary edge of the result 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 you prefer to have an attached 3D geometry which is a BSpline approximation of the computed set of points on computed elementary intersection edges whose underlying geometry is not analytic, you may use a constructor with the PerformNow flag equal to false. Then you use: - the function Approximation to ask for this computation option, and - the function Build to construct the result. Note that as a result, approximations will only be computed on edges built on new intersection lines. Example You may also combine these computation options. In the following example: - each elementary edge of the computed intersection, built on a new intersection line, which does not correspond to an analytic Geom curve, will be approximated by a BSpline curve whose degree is not greater than 8. - each elementary edge built on a new intersection line, will have: - a pcurve in the parametric space of the shape S1, - no pcurve in the parametric space of the shape S2. // TopoDS_Shape S1 = … , S2 = … ; Standard_Boolean PerformNow = Standard_False; BRepAlgo_Section S ( S1, S2, PerformNow ); S.ComputePCurveOn1 (Standard_True); S.Approximation (Standard_True); S.Build(); TopoDS_Shape R = S.Shape();
Parameters:
  • Sf1 (Handle_Geom_Surface &) –
  • Sf2 (Handle_Geom_Surface &) –
  • PerformNow (bool) – default value is Standard_True
Return type:

None

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. Note that as a result, pcurves will only be added onto edges built on new intersection lines.
Parameters:B (bool) –
Return type:None
HasAncestorFaceOn1()
  • Identifies the ancestor faces of the new 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 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 three 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, - the edge E is built on an intersection curve. In other words, E is a new edge built on the intersection curve, not on edges belonging to the intersecting shapes. 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

HasAncestorFaceOn2()
  • Identifies the ancestor faces of the new 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: - 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 three 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, - the edge E is built on an intersection curve. In other words, E is a new edge built on the intersection curve, not on edges belonging to the intersecting shapes. 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()
  • Initializes the first part
Parameters:S1 (TopoDS_Shape &) –
Return type:None
  • Initializes the first part
Parameters:Pl (gp_Pln) –
Return type:None
  • Initializes the first part
Parameters:Sf (Handle_Geom_Surface &) –
Return type:None
Init2()
  • initialize second part
Parameters:S2 (TopoDS_Shape &) –
Return type:None
  • Initializes the second part
Parameters:Pl (gp_Pln) –
Return type:None
  • This and the above algorithms reinitialize 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 BRepAlgo_SequenceNodeOfSequenceOfSequenceOfInteger(*args)

Bases: OCC.TCollection.TCollection_SeqNode

Parameters:
  • I (TColStd_SequenceOfInteger &) –
  • n (TCollection_SeqNodePtr &) –
  • p (TCollection_SeqNodePtr &) –
Return type:

None

GetHandle()
Value()
Return type:TColStd_SequenceOfInteger
thisown

The membership flag

class BRepAlgo_SequenceOfSequenceOfInteger(*args)

Bases: OCC.TCollection.TCollection_BaseSequence

Return type:None
Parameters:Other (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:None
Append()
Parameters:
  • T (TColStd_SequenceOfInteger &) –
  • S (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:

None

Return type:

None

Assign()
Parameters:Other (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:BRepAlgo_SequenceOfSequenceOfInteger
ChangeValue()
Parameters:Index (int) –
Return type:TColStd_SequenceOfInteger
Clear()
Return type:None
First()
Return type:TColStd_SequenceOfInteger
InsertAfter()
Parameters:
  • Index (int) –
  • T (TColStd_SequenceOfInteger &) –
  • Index
  • S (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (int) –
  • T (TColStd_SequenceOfInteger &) –
  • Index
  • S (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:

None

Return type:

None

Last()
Return type:TColStd_SequenceOfInteger
Prepend()
Parameters:
  • T (TColStd_SequenceOfInteger &) –
  • S (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • Index (int) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

None

Return type:

None

Set()
Parameters:Other (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:BRepAlgo_SequenceOfSequenceOfInteger
SetValue()
Parameters:
  • Index (int) –
  • I (TColStd_SequenceOfInteger &) –
Return type:

None

Split()
Parameters:
  • Index (int) –
  • Sub (BRepAlgo_SequenceOfSequenceOfInteger &) –
Return type:

None

Value()
Parameters:Index (int) –
Return type:TColStd_SequenceOfInteger
thisown

The membership flag

class BRepAlgo_Tool

Bases: object

static Deboucle3D()
  • Remove the non valid part of an offsetshape 1 - Remove all the free boundary and the faces connex to such edges. 2 - Remove all the shapes not valid in the result (according to the side of offseting) in this verion only the first point is implemented.
Parameters:
  • S (TopoDS_Shape &) –
  • Boundary (TopTools_MapOfShape &) –
Return type:

TopoDS_Shape

thisown

The membership flag

BRepAlgo_Tool_Deboucle3D()
  • Remove the non valid part of an offsetshape 1 - Remove all the free boundary and the faces connex to such edges. 2 - Remove all the shapes not valid in the result (according to the side of offseting) in this verion only the first point is implemented.
Parameters:
  • S (TopoDS_Shape &) –
  • Boundary (TopTools_MapOfShape &) –
Return type:

TopoDS_Shape

class Handle_BRepAlgo_AsDes(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_BRepAlgo_DataMapNodeOfDataMapOfShapeBoolean(*args)

Bases: OCC.TCollection.Handle_TCollection_MapNode

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_BRepAlgo_DataMapNodeOfDataMapOfShapeInterference(*args)

Bases: OCC.TCollection.Handle_TCollection_MapNode

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_BRepAlgo_EdgeConnector(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_BRepAlgo_SequenceNodeOfSequenceOfSequenceOfInteger(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
thisown

The membership flag

value()
class brepalgo

Bases: object

static ConcatenateWire()
  • this method makes a wire whose edges are C1 from a Wire whose edges could be G1. It removes a vertex between G1 edges. Option can be G1 or C1.
Parameters:
  • Wire (TopoDS_Wire &) –
  • Option (GeomAbs_Shape) –
  • AngularTolerance (float) – default value is 1.0e-4
Return type:

TopoDS_Wire

static ConcatenateWireC0()
  • this method makes an edge from a wire. Junction points between edges of wire may be sharp, resulting curve of the resulting edge may be C0.
Parameters:Wire (TopoDS_Wire &) –
Return type:TopoDS_Edge
static IsTopologicallyValid()
  • Checks if the shape is ‘correct’. If not, returns <Standard_False>, else returns <Standard_True>. This method differs from the previous one in the fact that no geometric contols (intersection of wires, pcurve validity) are performed.
Parameters:S (TopoDS_Shape &) –
Return type:bool
static IsValid()
  • Checks if the shape is ‘correct’. If not, returns <Standard_False>, else returns <Standard_True>.
Parameters:S (TopoDS_Shape &) –
Return type:bool
  • Checks if the Generated and Modified Faces from the shapes <arguments> in the shape <result> are ‘correct’. The args may be empty, then all faces will be checked. If <Closed> is True, only closed shape are valid. If <GeomCtrl> is False the geometry of new vertices and edges are not verified and the auto-intersection of new wires are not searched.
Parameters:
  • theArgs (TopTools_ListOfShape &) –
  • theResult (TopoDS_Shape &) –
  • closedSolid (bool) – default value is Standard_False
  • GeomCtrl (bool) – default value is Standard_True
Return type:

bool

thisown

The membership flag

brepalgo_ConcatenateWire()
  • this method makes a wire whose edges are C1 from a Wire whose edges could be G1. It removes a vertex between G1 edges. Option can be G1 or C1.
Parameters:
  • Wire (TopoDS_Wire &) –
  • Option (GeomAbs_Shape) –
  • AngularTolerance (float) – default value is 1.0e-4
Return type:

TopoDS_Wire

brepalgo_ConcatenateWireC0()
  • this method makes an edge from a wire. Junction points between edges of wire may be sharp, resulting curve of the resulting edge may be C0.
Parameters:Wire (TopoDS_Wire &) –
Return type:TopoDS_Edge
brepalgo_IsTopologicallyValid()
  • Checks if the shape is ‘correct’. If not, returns <Standard_False>, else returns <Standard_True>. This method differs from the previous one in the fact that no geometric contols (intersection of wires, pcurve validity) are performed.
Parameters:S (TopoDS_Shape &) –
Return type:bool
brepalgo_IsValid()
  • Checks if the shape is ‘correct’. If not, returns <Standard_False>, else returns <Standard_True>.
Parameters:S (TopoDS_Shape &) –
Return type:bool
  • Checks if the Generated and Modified Faces from the shapes <arguments> in the shape <result> are ‘correct’. The args may be empty, then all faces will be checked. If <Closed> is True, only closed shape are valid. If <GeomCtrl> is False the geometry of new vertices and edges are not verified and the auto-intersection of new wires are not searched.
Parameters:
  • theArgs (TopTools_ListOfShape &) –
  • theResult (TopoDS_Shape &) –
  • closedSolid (bool) – default value is Standard_False
  • GeomCtrl (bool) – default value is Standard_True
Return type:

bool

new_instancemethod(func, inst, cls)
register_handle(handle, base_object)

Inserts the handle into the base object to prevent memory corruption in certain cases