OCC.Core.BRepAlgo module¶
BRepAlgo module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_brepalgo.html
-
class
BRepAlgo_AsDes
(*args)¶ Bases:
OCC.Core.Standard.Standard_Transient
- Creates an empty AsDes.
- rtype
None
-
Add
()¶ - Stores <SS> as a futur subshape of <S>.
- param S
- type S
TopoDS_Shape
- param SS
- type SS
TopoDS_Shape
- rtype
None* Stores <SS> as futurs SubShapes of <S>.
- param S
- type S
TopoDS_Shape
- param SS
- type SS
TopTools_ListOfShape
- rtype
None
-
Ascendant
()¶ - Returns the Shape containing <S>.
- param S
- type S
TopoDS_Shape
- rtype
TopTools_ListOfShape
-
ChangeDescendant
()¶ - Returns futur subhapes of <S>.
- param S
- type S
TopoDS_Shape
- rtype
TopTools_ListOfShape
-
Descendant
()¶ - Returns futur subhapes of <S>.
- param S
- type S
TopoDS_Shape
- rtype
TopTools_ListOfShape
-
static
DownCast
(t)¶
-
HasAscendant
()¶ - Parameters
S –
- type S
TopoDS_Shape
- rtype
bool
-
HasCommonDescendant
()¶ - Returns True if (S1> and <S2> has common Descendants. Stores in <LC> the Commons Descendants.
- param S1
- type S1
TopoDS_Shape
- param S2
- type S2
TopoDS_Shape
- param LC
- type LC
TopTools_ListOfShape
- rtype
bool
-
HasDescendant
()¶ - Parameters
S –
- type S
TopoDS_Shape
- rtype
bool
-
Remove
()¶ - Remove <S> from me.
- param S
- type S
TopoDS_Shape
- rtype
None
-
Replace
()¶ - Replace <OldS> by <NewS>. <OldS> disapear from <self>.
- param OldS
- type OldS
TopoDS_Shape
- param NewS
- type NewS
TopoDS_Shape
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_BooleanOperation
(*args, **kwargs)¶ Bases:
OCC.Core.BRepBuilderAPI.BRepBuilderAPI_MakeShape
-
Builder
()¶ - Return type
opencascade::handle<TopOpeBRepBuild_HBuilder>
-
Perform
()¶ - Parameters
St1 –
- type St1
TopAbs_State
- param St2
- type St2
TopAbs_State
- rtype
None
-
Shape1
()¶ - Returns the first shape involved in this Boolean operation.
- rtype
TopoDS_Shape
-
Shape2
()¶ - Returns the second shape involved in this Boolean operation.
- rtype
TopoDS_Shape
-
property
thisown
¶ The membership flag
-
-
class
BRepAlgo_Common
(*args)¶ Bases:
OCC.Core.BRepAlgo.BRepAlgo_BooleanOperation
- Constructs the common part of shapes S1 and S2.
- param S1
- type S1
TopoDS_Shape
- param S2
- type S2
TopoDS_Shape
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_Cut
(*args)¶ Bases:
OCC.Core.BRepAlgo.BRepAlgo_BooleanOperation
- Cuts the shape S2 from the shape S1.
- param S1
- type S1
TopoDS_Shape
- param S2
- type S2
TopoDS_Shape
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_FaceRestrictor
(*args)¶ Bases:
object
- Return type
-
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>.
- param W
- type W
TopoDS_Wire
- rtype
None
-
Clear
()¶ - Removes all the Wires
- rtype
None
-
Current
()¶ - Return type
-
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().
- param F
- type F
TopoDS_Face
- param Proj
default value is Standard_False
- type Proj
bool
- param ControlOrientation
default value is Standard_False
- type ControlOrientation
bool
- rtype
None
-
Perform
()¶ - Evaluate all the faces limited by the set of Wires.
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_Fuse
(*args)¶ Bases:
OCC.Core.BRepAlgo.BRepAlgo_BooleanOperation
- Fuse S1 and S2.
- param S1
- type S1
TopoDS_Shape
- param S2
- type S2
TopoDS_Shape
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_Image
(*args)¶ Bases:
object
- Return type
-
Add
()¶ - Add <NewS> to the image of <OldS>.
- param OldS
- type OldS
TopoDS_Shape
- param NewS
- type NewS
TopoDS_Shape
- rtype
None* Add <NewS> to the image of <OldS>.
- param OldS
- type OldS
TopoDS_Shape
- param NewS
- type NewS
TopTools_ListOfShape
- rtype
None
-
Bind
()¶ - Links <NewS> as image of <OldS>.
- param OldS
- type OldS
TopoDS_Shape
- param NewS
- type NewS
TopoDS_Shape
- rtype
None* Links <NewS> as image of <OldS>.
- param OldS
- type OldS
TopoDS_Shape
- param NewS
- type NewS
TopTools_ListOfShape
- rtype
None
-
Compact
()¶ - Keeps only the link between roots and lastimage.
- rtype
None
-
Filter
()¶ - Deletes in the images the shape of type <ShapeType> which are not in <S>. Warning: Compact() must be call before.
- param S
- type S
TopoDS_Shape
- param ShapeType
- type ShapeType
TopAbs_ShapeEnum
- rtype
None
-
HasImage
()¶ - Parameters
S –
- type S
TopoDS_Shape
- rtype
bool
-
Image
()¶ - Returns the Image of <S>. Returns <S> in the list if HasImage(S) is false.
- param S
- type S
TopoDS_Shape
- rtype
TopTools_ListOfShape
-
ImageFrom
()¶ - Returns the generator of <S>
- param S
- type S
TopoDS_Shape
- rtype
TopoDS_Shape
-
IsImage
()¶ - Parameters
S –
- type S
TopoDS_Shape
- rtype
bool
-
LastImage
()¶ - Stores in <L> the images of images of…images of <S>. <L> contains only <S> if HasImage(S) is false.
- param S
- type S
TopoDS_Shape
- param L
- type L
TopTools_ListOfShape
- rtype
None
-
Remove
()¶ - Remove <S> to set of images.
- param S
- type S
TopoDS_Shape
- rtype
None
-
Root
()¶ - Returns the upper generator of <S>
- param S
- type S
TopoDS_Shape
- rtype
TopoDS_Shape
-
Roots
()¶ - Return type
-
SetRoot
()¶ - Parameters
S –
- type S
TopoDS_Shape
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_Loop
(*args)¶ Bases:
object
- Return type
-
AddConstEdge
()¶ - Add <E> as const edge, E can be in the result.
- param E
- type E
TopoDS_Edge
- rtype
None
-
AddConstEdges
()¶ - Add <LE> as a set of const edges.
- param LE
- type LE
TopTools_ListOfShape
- rtype
None
-
AddEdge
()¶ - Add E with <LV>. <E> will be copied and trim by vertices in <LV>.
- param E
- type E
TopoDS_Edge
- param LV
- type LV
TopTools_ListOfShape
- rtype
None
-
CutEdge
()¶ - Cut the edge <E> in several edges <NE> on the vertices<VonE>.
- param E
- type E
TopoDS_Edge
- param VonE
- type VonE
TopTools_ListOfShape
- param NE
- type NE
TopTools_ListOfShape
- rtype
None
-
GetVerticesForSubstitute
()¶ - Returns the datamap of vertices with their substitutes.
- param VerVerMap
- type VerVerMap
TopTools_DataMapOfShapeShape
- rtype
None
-
Init
()¶ - Init with <F> the set of edges must have pcurves on <F>.
- param F
- type F
TopoDS_Face
- rtype
None
-
NewEdges
()¶ - Returns the list of new edges built from an edge <E> it can be an empty list.
- param E
- type E
TopoDS_Edge
- rtype
TopTools_ListOfShape
-
NewFaces
()¶ - Returns the list of faces. Warning: The method <WiresToFaces> as to be called before. can be an empty list.
- rtype
TopTools_ListOfShape
-
NewWires
()¶ - Returns the list of wires performed. can be an empty list.
- rtype
TopTools_ListOfShape
-
Perform
()¶ - Make loops.
- rtype
None
-
VerticesForSubstitute
()¶ - Parameters
VerVerMap –
- type VerVerMap
TopTools_DataMapOfShapeShape
- rtype
None
-
WiresToFaces
()¶ - Build faces from the wires result.
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_NormalProjection
(*args)¶ Bases:
object
- Return type
None:param S: :type S: TopoDS_Shape :rtype: None
-
Add
()¶ - Add an edge or a wire to the list of shape to project
- param ToProj
- type ToProj
TopoDS_Shape
- rtype
None
-
Ancestor
()¶ - For a resulting edge, returns the corresponding initial edge.
- param E
- type E
TopoDS_Edge
- rtype
TopoDS_Shape
-
Build
()¶ - Builds the result as a compound.
- rtype
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.
- param Liste
- type Liste
TopTools_ListOfShape
- rtype
bool
-
Compute3d
()¶ - if With3d = Standard_False the 3dcurve is not computed the initial 3dcurve is kept to build the resulting edges.
- param With3d
default value is Standard_True
- type With3d
bool
- rtype
None
-
Couple
()¶ - For a projected edge, returns the corresponding initial face.
- param E
- type E
TopoDS_Edge
- rtype
TopoDS_Shape
-
Generated
()¶ - Returns the list of shapes generated from the shape <S>.
- param S
- type S
TopoDS_Shape
- rtype
TopTools_ListOfShape
-
Init
()¶ - Parameters
S –
- type S
TopoDS_Shape
- rtype
None
-
IsElementary
()¶ - Parameters
C –
- type C
Adaptor3d_Curve
- rtype
bool
-
Projection
()¶ - returns the result
- rtype
TopoDS_Shape
-
SetDefaultParams
()¶ - Set the parameters used for computation in their default values
- rtype
None
-
SetLimit
()¶ - Manage limitation of projected edges.
- param FaceBoundaries
default value is Standard_True
- type FaceBoundaries
bool
- rtype
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
- param MaxDist
- type MaxDist
float
- rtype
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.
- param Tol3D
- type Tol3D
float
- param Tol2D
- type Tol2D
float
- param InternalContinuity
- type InternalContinuity
GeomAbs_Shape
- param MaxDegree
- type MaxDegree
int
- param MaxSeg
- type MaxSeg
int
- rtype
None
-
property
thisown
¶ The membership flag
-
class
BRepAlgo_Section
(*args)¶ Bases:
OCC.Core.BRepAlgo.BRepAlgo_BooleanOperation
- Parameters
Sh1 –
- type Sh1
TopoDS_Shape
- param Sh2
- type Sh2
TopoDS_Shape
- param PerformNow
default value is Standard_True
- type PerformNow
bool
- rtype
None:param Sh:
- type Sh
TopoDS_Shape
- param Pl
- type Pl
gp_Pln
- param PerformNow
default value is Standard_True
- type PerformNow
bool
- rtype
None:param Sh:
- type Sh
TopoDS_Shape
- param Sf
- type Sf
Geom_Surface
- param PerformNow
default value is Standard_True
- type PerformNow
bool
- rtype
None:param Sf:
- type Sf
Geom_Surface
- param Sh
- type Sh
TopoDS_Shape
- param PerformNow
default value is Standard_True
- type PerformNow
bool
- rtype
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();
- param Sf1
- type Sf1
Geom_Surface
- param Sf2
- type Sf2
Geom_Surface
- param PerformNow
default value is Standard_True
- type PerformNow
bool
- rtype
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.
- param B
- type B
bool
- rtype
None
-
ComputePCurveOn1
()¶ - Indicates if the Pcurve must be (or not) performed on first part.
- param B
- type B
bool
- rtype
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.
- param B
- type B
bool
- rtype
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.
- param E
- type E
TopoDS_Shape
- param F
- type F
TopoDS_Shape
- rtype
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.
- param E
- type E
TopoDS_Shape
- param F
- type F
TopoDS_Shape
- rtype
bool
-
Init1
()¶ - Initializes the first part
- param S1
- type S1
TopoDS_Shape
- rtype
None* Initializes the first part
- param Pl
- type Pl
gp_Pln
- rtype
None* Initializes the first part
- param Sf
- type Sf
Geom_Surface
- rtype
None
-
Init2
()¶ - initialize second part
- param S2
- type S2
TopoDS_Shape
- rtype
None* Initializes the second part
- param Pl
- type Pl
gp_Pln
- rtype
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.
- param Sf
- type Sf
Geom_Surface
- rtype
None
-
property
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.
- param S
- type S
TopoDS_Shape
- param Boundary
- type Boundary
TopTools_MapOfShape
- rtype
TopoDS_Shape
-
property
thisown
¶ The membership flag
-
static
-
class
SwigPyIterator
(*args, **kwargs)¶ Bases:
object
-
advance
()¶
-
copy
()¶
-
decr
()¶
-
distance
()¶
-
equal
()¶
-
incr
()¶
-
next
()¶
-
previous
()¶
-
property
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.
- param Wire
- type Wire
TopoDS_Wire
- param Option
- type Option
GeomAbs_Shape
- param AngularTolerance
default value is 1.0e-4
- type AngularTolerance
float
- rtype
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.
- param Wire
- type Wire
TopoDS_Wire
- rtype
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.
- param S
- type S
TopoDS_Shape
- rtype
bool
-
static
IsValid
()¶ - Checks if the shape is ‘correct’. If not, returns <Standard_False>, else returns <Standard_True>.
- param S
- type S
TopoDS_Shape
- rtype
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.
- param theArgs
- type theArgs
TopTools_ListOfShape
- param theResult
- type theResult
TopoDS_Shape
- param closedSolid
default value is Standard_False
- type closedSolid
bool
- param GeomCtrl
default value is Standard_True
- type GeomCtrl
bool
- rtype
bool
-
property
thisown
¶ The membership flag
-
static