OCC.Core.BRepExtrema module

BRepExtrema module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_brepextrema.html

class BRepExtrema_DistShapeShape(*args)

Bases: object

  • create empty tool
    rtype

    None* computation of the minimum distance (value and pair of points) using default deflection Default value is Precision::Confusion().

    param Shape1

    type Shape1

    TopoDS_Shape

    param Shape2

    type Shape2

    TopoDS_Shape

    param F

    default value is Extrema_ExtFlag_MINMAX

    type F

    Extrema_ExtFlag

    param A

    default value is Extrema_ExtAlgo_Grad

    type A

    Extrema_ExtAlgo

    rtype

    None* create tool and load both shapes into it

    param Shape1

    type Shape1

    TopoDS_Shape

    param Shape2

    type Shape2

    TopoDS_Shape

    param theDeflection

    type theDeflection

    float

    param F

    default value is Extrema_ExtFlag_MINMAX

    type F

    Extrema_ExtFlag

    param A

    default value is Extrema_ExtAlgo_Grad

    type A

    Extrema_ExtAlgo

    rtype

    None

DumpToString(BRepExtrema_DistShapeShape self) → std::string
InnerSolution()
  • True if one of the shapes is a solid and the other shape is completely or partially inside the solid.
    rtype

    bool

IsDone()
  • True if the minimum distance is found.
    rtype

    bool

LoadS1()
  • load first shape into extrema
    param Shape1

    type Shape1

    TopoDS_Shape

    rtype

    None

LoadS2()
  • load second shape into extrema
    param Shape1

    type Shape1

    TopoDS_Shape

    rtype

    None

NbSolution()
  • Returns the number of solutions satisfying the minimum distance.
    rtype

    int

ParOnEdgeS1()
  • gives the corresponding parameter t if the Nth solution is situated on an Egde of the first shape
    param N

    type N

    int

    param t

    type t

    float

    rtype

    None

ParOnEdgeS2()
  • gives the corresponding parameter t if the Nth solution is situated on an Egde of the first shape
    param N

    type N

    int

    param t

    type t

    float

    rtype

    None

ParOnFaceS1()
  • gives the corresponding parameters (U,V) if the Nth solution is situated on an face of the first shape
    param N

    type N

    int

    param u

    type u

    float

    param v

    type v

    float

    rtype

    None

ParOnFaceS2()
  • gives the corresponding parameters (U,V) if the Nth solution is situated on an Face of the second shape
    param N

    type N

    int

    param u

    type u

    float

    param v

    type v

    float

    rtype

    None

Perform()
  • computation of the minimum distance (value and couple of points). Parameter theDeflection is used to specify a maximum deviation of extreme distances from the minimum one. Returns IsDone status.
    rtype

    bool

PointOnShape1()
  • Returns the Point corresponding to the <N>th solution on the first Shape
    param N

    type N

    int

    rtype

    gp_Pnt

PointOnShape2()
  • Returns the Point corresponding to the <N>th solution on the second Shape
    param N

    type N

    int

    rtype

    gp_Pnt

SetAlgo()
Parameters

A

type A

Extrema_ExtAlgo

rtype

None

SetDeflection()
Parameters

theDeflection

type theDeflection

float

rtype

None

SetFlag()
Parameters

F

type F

Extrema_ExtFlag

rtype

None

SupportOnShape1()
  • gives the support where the Nth solution on the first shape is situated. This support can be a Vertex, an Edge or a Face.
    param N

    type N

    int

    rtype

    TopoDS_Shape

SupportOnShape2()
  • gives the support where the Nth solution on the second shape is situated. This support can be a Vertex, an Edge or a Face.
    param N

    type N

    int

    rtype

    TopoDS_Shape

SupportTypeShape1()
  • gives the type of the support where the Nth solution on the first shape is situated: IsVertex => the Nth solution on the first shape is a Vertex IsOnEdge => the Nth soluion on the first shape is on a Edge IsInFace => the Nth solution on the first shape is inside a face the corresponding support is obtained by the method SupportOnShape1
    param N

    type N

    int

    rtype

    BRepExtrema_SupportType

SupportTypeShape2()
  • gives the type of the support where the Nth solution on the second shape is situated: IsVertex => the Nth solution on the second shape is a Vertex IsOnEdge => the Nth soluion on the secondt shape is on a Edge IsInFace => the Nth solution on the second shape is inside a face the corresponding support is obtained by the method SupportOnShape2
    param N

    type N

    int

    rtype

    BRepExtrema_SupportType

Value()
  • Returns the value of the minimum distance.
    rtype

    float

property thisown

The membership flag

class BRepExtrema_DistanceSS(*args)

Bases: object

  • computes the distance between two Shapes ( face edge vertex).
    param S1

    type S1

    TopoDS_Shape

    param S2

    type S2

    TopoDS_Shape

    param B1

    type B1

    Bnd_Box

    param B2

    type B2

    Bnd_Box

    param DstRef

    type DstRef

    float

    param F

    default value is Extrema_ExtFlag_MINMAX

    type F

    Extrema_ExtFlag

    param A

    default value is Extrema_ExtAlgo_Grad

    type A

    Extrema_ExtAlgo

    rtype

    None* computes the distance between two Shapes ( face edge vertex). Parameter theDeflection is used to specify a maximum deviation of extreme distances from the minimum one. Default value is Precision::Confusion().

    param S1

    type S1

    TopoDS_Shape

    param S2

    type S2

    TopoDS_Shape

    param B1

    type B1

    Bnd_Box

    param B2

    type B2

    Bnd_Box

    param DstRef

    type DstRef

    float

    param aDeflection

    type aDeflection

    float

    param F

    default value is Extrema_ExtFlag_MINMAX

    type F

    Extrema_ExtFlag

    param A

    default value is Extrema_ExtAlgo_Grad

    type A

    Extrema_ExtAlgo

    rtype

    None

DistValue()
  • returns the distance value
    rtype

    float

IsDone()
  • True if the distance has been computed
    rtype

    bool

Seq1Value()
  • returns the list of solutions on the first shape
    rtype

    BRepExtrema_SeqOfSolution

Seq2Value()
  • returns the list of solutions on the second shape
    rtype

    BRepExtrema_SeqOfSolution

SetAlgo()
  • sets the flag controlling …
    param A

    type A

    Extrema_ExtAlgo

    rtype

    None

SetFlag()
  • sets the flag controlling minimum and maximum search
    param F

    type F

    Extrema_ExtFlag

    rtype

    None

property thisown

The membership flag

class BRepExtrema_ElementFilter

Bases: object

DoCheck = 2
NoCheck = 0
Overlap = 1
PreCheckElements()
  • Checks if two mesh elements should be tested for overlapping/intersection (used for detection correct/incorrect cases of shared edges and vertices).
    param Standard_Integer

    type Standard_Integer

    param Standard_Integer

    type Standard_Integer

    rtype

    FilterResult

property thisown

The membership flag

class BRepExtrema_ExtCC(*args)

Bases: object

Return type

None* It calculates all the distances. :param E1: :type E1: TopoDS_Edge :param E2: :type E2: TopoDS_Edge :rtype: None

Initialize()
Parameters

E2

type E2

TopoDS_Edge

rtype

None

IsDone()
  • True if the distances are found.
    rtype

    bool

IsParallel()
  • Returns True if E1 and E2 are parallel.
    rtype

    bool

NbExt()
  • Returns the number of extremum distances.
    rtype

    int

ParameterOnE1()
  • Returns the parameter on the first edge of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    float

ParameterOnE2()
  • Returns the parameter on the second edge of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    float

Perform()
  • An exception is raised if the fields have not been initialized.
    param E1

    type E1

    TopoDS_Edge

    rtype

    None

PointOnE1()
  • Returns the Point of the <N>th extremum distance on the edge E1.
    param N

    type N

    int

    rtype

    gp_Pnt

PointOnE2()
  • Returns the Point of the <N>th extremum distance on the edge E2.
    param N

    type N

    int

    rtype

    gp_Pnt

SquareDistance()
  • Returns the value of the <N>th extremum square distance.
    param N

    type N

    int

    rtype

    float

TrimmedSquareDistances()
  • if the edges is a trimmed curve, dist11 is a square distance between the point on E1 of parameter FirstParameter and the point of parameter FirstParameter on E2.
    param dist11

    type dist11

    float

    param distP12

    type distP12

    float

    param distP21

    type distP21

    float

    param distP22

    type distP22

    float

    param P11

    type P11

    gp_Pnt

    param P12

    type P12

    gp_Pnt

    param P21

    type P21

    gp_Pnt

    param P22

    type P22

    gp_Pnt

    rtype

    None

property thisown

The membership flag

class BRepExtrema_ExtCF(*args)

Bases: object

Return type

None* It calculates all the distances. :param E: :type E: TopoDS_Edge :param F: :type F: TopoDS_Face :rtype: None

Initialize()
Parameters

E

type E

TopoDS_Edge

param F

type F

TopoDS_Face

rtype

None

IsDone()
  • True if the distances are found.
    rtype

    bool

IsParallel()
  • Returns True if the curve is on a parallel surface.
    rtype

    bool

NbExt()
  • Returns the number of extremum distances.
    rtype

    int

ParameterOnEdge()
  • Returns the parameters on the Edge of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    float

ParameterOnFace()
  • Returns the parameters on the Face of the <N>th extremum distance.
    param N

    type N

    int

    param U

    type U

    float

    param V

    type V

    float

    rtype

    None

Perform()
  • An exception is raised if the fields have not been initialized. Be careful: this method uses the Face only for classify not for the fields.
    param E

    type E

    TopoDS_Edge

    param F

    type F

    TopoDS_Face

    rtype

    None

PointOnEdge()
  • Returns the Point of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    gp_Pnt

PointOnFace()
  • Returns the Point of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    gp_Pnt

SquareDistance()
  • Returns the value of the <N>th extremum square distance.
    param N

    type N

    int

    rtype

    float

property thisown

The membership flag

class BRepExtrema_ExtFF(*args)

Bases: object

Return type

None* It calculates all the distances. :param F1: :type F1: TopoDS_Face :param F2: :type F2: TopoDS_Face :rtype: None

Initialize()
Parameters

F2

type F2

TopoDS_Face

rtype

None

IsDone()
  • True if the distances are found.
    rtype

    bool

IsParallel()
  • Returns True if the surfaces are parallel.
    rtype

    bool

NbExt()
  • Returns the number of extremum distances.
    rtype

    int

ParameterOnFace1()
  • Returns the parameters on the Face F1 of the <N>th extremum distance.
    param N

    type N

    int

    param U

    type U

    float

    param V

    type V

    float

    rtype

    None

ParameterOnFace2()
  • Returns the parameters on the Face F2 of the <N>th extremum distance.
    param N

    type N

    int

    param U

    type U

    float

    param V

    type V

    float

    rtype

    None

Perform()
  • An exception is raised if the fields have not been initialized. Be careful: this method uses the Face F2 only for classify, not for the fields.
    param F1

    type F1

    TopoDS_Face

    param F2

    type F2

    TopoDS_Face

    rtype

    None

PointOnFace1()
  • Returns the Point of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    gp_Pnt

PointOnFace2()
  • Returns the Point of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    gp_Pnt

SquareDistance()
  • Returns the value of the <N>th extremum square distance.
    param N

    type N

    int

    rtype

    float

property thisown

The membership flag

class BRepExtrema_ExtPC(*args)

Bases: object

Return type

None* It calculates all the distances. :param V: :type V: TopoDS_Vertex :param E: :type E: TopoDS_Edge :rtype: None

Initialize()
Parameters

E

type E

TopoDS_Edge

rtype

None

IsDone()
  • True if the distances are found.
    rtype

    bool

IsMin()
  • Returns True if the <N>th extremum distance is a minimum.
    param N

    type N

    int

    rtype

    bool

NbExt()
  • Returns the number of extremum distances.
    rtype

    int

Parameter()
  • Returns the parameter on the edge of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    float

Perform()
  • An exception is raised if the fields have not been initialized.
    param V

    type V

    TopoDS_Vertex

    rtype

    None

Point()
  • Returns the Point of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    gp_Pnt

SquareDistance()
  • Returns the value of the <N>th extremum square distance.
    param N

    type N

    int

    rtype

    float

TrimmedSquareDistances()
  • if the curve is a trimmed curve, dist1 is a square distance between <P> and the point of parameter FirstParameter <pnt1> and dist2 is a square distance between <P> and the point of parameter LastParameter <pnt2>.
    param dist1

    type dist1

    float

    param dist2

    type dist2

    float

    param pnt1

    type pnt1

    gp_Pnt

    param pnt2

    type pnt2

    gp_Pnt

    rtype

    None

property thisown

The membership flag

class BRepExtrema_ExtPF(*args)

Bases: object

Return type

None* It calculates all the distances. :param TheVertex: :type TheVertex: TopoDS_Vertex :param TheFace: :type TheFace: TopoDS_Face :param TheFlag: default value is Extrema_ExtFlag_MINMAX :type TheFlag: Extrema_ExtFlag :param TheAlgo: default value is Extrema_ExtAlgo_Grad :type TheAlgo: Extrema_ExtAlgo :rtype: None

Initialize()
Parameters

TheFace

type TheFace

TopoDS_Face

param TheFlag

default value is Extrema_ExtFlag_MINMAX

type TheFlag

Extrema_ExtFlag

param TheAlgo

default value is Extrema_ExtAlgo_Grad

type TheAlgo

Extrema_ExtAlgo

rtype

None

IsDone()
  • True if the distances are found.
    rtype

    bool

NbExt()
  • Returns the number of extremum distances.
    rtype

    int

Parameter()
  • Returns the parameters on the Face of the <N>th extremum distance.
    param N

    type N

    int

    param U

    type U

    float

    param V

    type V

    float

    rtype

    None

Perform()
  • An exception is raised if the fields have not been initialized. Be careful: this method uses the Face only for classify not for the fields.
    param TheVertex

    type TheVertex

    TopoDS_Vertex

    param TheFace

    type TheFace

    TopoDS_Face

    rtype

    None

Point()
  • Returns the Point of the <N>th extremum distance.
    param N

    type N

    int

    rtype

    gp_Pnt

SetAlgo()
Parameters

A

type A

Extrema_ExtAlgo

rtype

None

SetFlag()
Parameters

F

type F

Extrema_ExtFlag

rtype

None

SquareDistance()
  • Returns the value of the <N>th extremum square distance.
    param N

    type N

    int

    rtype

    float

property thisown

The membership flag

class BRepExtrema_MapOfIntegerPackedMapOfInteger(*args)

Bases: object

Assign()
Bind()
Bound()
ChangeFind()
ChangeSeek()
Clear()
Exchange()
Find()
IsBound()
Keys()
ReSize()
Seek()
Set()
Size()
UnBind()
begin()
cbegin()
cend()
end()
property thisown

The membership flag

class BRepExtrema_Poly

Bases: object

static Distance()
  • returns Standard_True if OK.
    param S1

    type S1

    TopoDS_Shape

    param S2

    type S2

    TopoDS_Shape

    param P1

    type P1

    gp_Pnt

    param P2

    type P2

    gp_Pnt

    param dist

    type dist

    float

    rtype

    bool

property thisown

The membership flag

class BRepExtrema_SelfIntersection(*args)

Bases: OCC.Core.BRepExtrema.BRepExtrema_ElementFilter

  • Creates unitialized self-intersection tool.
    param theTolerance

    default value is 0.0

    type theTolerance

    float

    rtype

    None* Creates self-intersection tool for the given shape.

    param theShape

    type theShape

    TopoDS_Shape

    param theTolerance

    default value is 0.0

    type theTolerance

    float

    rtype

    None

ElementSet()
  • Returns set of all the face triangles of the shape.
    rtype

    opencascade::handle<BRepExtrema_TriangleSet>

GetSubShape()
  • Returns sub-shape from the shape for the given index (started from 0).
    param theID

    type theID

    int

    rtype

    TopoDS_Face

IsDone()
  • True if the detection is completed.
    rtype

    bool

LoadShape()
  • Loads shape for detection of self-intersections.
    param theShape

    type theShape

    TopoDS_Shape

    rtype

    bool

OverlapElements()
  • Returns set of IDs of overlapped sub-shapes (started from 0).
    rtype

    BRepExtrema_MapOfIntegerPackedMapOfInteger

Perform()
  • Performs detection of self-intersections.
    rtype

    None

SetTolerance()
  • Sets tolerance value used for self-intersection test.
    param theTolerance

    type theTolerance

    float

    rtype

    None

Tolerance()
  • Returns tolerance value used for self-intersection test.
    rtype

    float

property thisown

The membership flag

class BRepExtrema_SeqOfSolution(*args)

Bases: object

Append()
Assign()
ChangeFirst()
ChangeLast()
ChangeValue()
Clear()
Exchange()
First()
InsertAfter()
InsertBefore()
IsEmpty()
Last()
Length()
Lower()
Prepend()
Remove()
Reverse()
Set()
SetValue()
Size()
Split()
Upper()
Value()
begin()
cbegin()
cend()
static delNode()
end()
property thisown

The membership flag

class BRepExtrema_ShapeList(*args)

Bases: object

Append()
Appended()
Assign()
ChangeFirst()
ChangeLast()
ChangeValue()
First()
IsEmpty()
Last()
Length()
Lower()
Set()
SetValue()
Size()
Upper()
Value()
begin()
cbegin()
cend()
end()
property thisown

The membership flag

class BRepExtrema_ShapeProximity(*args)

Bases: object

  • Creates empty proximity tool.
    param theTolerance

    default value is 0.0

    type theTolerance

    float

    rtype

    None* Creates proximity tool for the given two shapes.

    param theShape1

    type theShape1

    TopoDS_Shape

    param theShape2

    type theShape2

    TopoDS_Shape

    param theTolerance

    default value is 0.0

    type theTolerance

    float

    rtype

    None

ElementSet1()
  • Returns set of all the face triangles of the 1st shape.
    rtype

    opencascade::handle<BRepExtrema_TriangleSet>

ElementSet2()
  • Returns set of all the face triangles of the 2nd shape.
    rtype

    opencascade::handle<BRepExtrema_TriangleSet>

GetSubShape1()
  • Returns sub-shape from 1st shape with the given index (started from 0).
    param theID

    type theID

    int

    rtype

    TopoDS_Face

GetSubShape2()
  • Returns sub-shape from 1st shape with the given index (started from 0).
    param theID

    type theID

    int

    rtype

    TopoDS_Face

IsDone()
  • True if the search is completed.
    rtype

    bool

LoadShape1()
  • Loads 1st shape into proximity tool.
    param theShape1

    type theShape1

    TopoDS_Shape

    rtype

    bool

LoadShape2()
  • Loads 2nd shape into proximity tool.
    param theShape2

    type theShape2

    TopoDS_Shape

    rtype

    bool

OverlapSubShapes1()
  • Returns set of IDs of overlapped faces of 1st shape (started from 0).
    rtype

    BRepExtrema_MapOfIntegerPackedMapOfInteger

OverlapSubShapes2()
  • Returns set of IDs of overlapped faces of 2nd shape (started from 0).
    rtype

    BRepExtrema_MapOfIntegerPackedMapOfInteger

Perform()
  • Performs search of overlapped faces.
    rtype

    None

SetTolerance()
  • Sets tolerance value for overlap test (distance between shapes).
    param theTolerance

    type theTolerance

    float

    rtype

    None

Tolerance()
  • Returns tolerance value for overlap test (distance between shapes).
    rtype

    float

property thisown

The membership flag

class BRepExtrema_SolutionElem(*args)

Bases: object

  • Empty constructor
    rtype

    None* This constructor is used when the solution of a distance is a Vertex. The different initialized fields are: @param theDist the distance @param thePoint the solution point @param theSolType the type of solution @param theVertex and the Vertex

    param theDist

    type theDist

    float

    param thePoint

    type thePoint

    gp_Pnt

    param theSolType

    type theSolType

    BRepExtrema_SupportType

    param theVertex

    type theVertex

    TopoDS_Vertex

    rtype

    None* This constructor is used when the solution of distance is on an Edge. The different initialized fields are: @param theDist the distance @param thePoint the solution point @param theSolType the type of solution @param theEdge the Edge @param theParam the parameter to locate the solution

    param theDist

    type theDist

    float

    param thePoint

    type thePoint

    gp_Pnt

    param theSolType

    type theSolType

    BRepExtrema_SupportType

    param theEdge

    type theEdge

    TopoDS_Edge

    param theParam

    type theParam

    float

    rtype

    None* This constructor is used when the solution of distance is in a Face. The different initialized fields are: @param theDist the distance @param thePoint the solution point @param theSolType the type of solution @param theFace the Face @param theU U parameter to locate the solution @param theV V parameter to locate the solution

    param theDist

    type theDist

    float

    param thePoint

    type thePoint

    gp_Pnt

    param theSolType

    type theSolType

    BRepExtrema_SupportType

    param theFace

    type theFace

    TopoDS_Face

    param theU

    type theU

    float

    param theV

    type theV

    float

    rtype

    None

Dist()
  • Returns the value of the minimum distance.
    rtype

    float

Edge()
  • Returns the vertex if the solution is an Edge.
    rtype

    TopoDS_Edge

EdgeParameter()
  • Returns the parameter value if the solution is on Edge.
    param theParam

    type theParam

    float

    rtype

    None

Face()
  • Returns the vertex if the solution is an Face.
    rtype

    TopoDS_Face

FaceParameter()
  • Returns the parameters U and V if the solution is in a Face.
    param theU

    type theU

    float

    param theV

    type theV

    float

    rtype

    None

Point()
  • Returns the solution point.
    rtype

    gp_Pnt

SupportKind()
  • Returns the Support type: IsVertex => The solution is a vertex. IsOnEdge => The solution belongs to an Edge. IsInFace => The solution is inside a Face.
    rtype

    BRepExtrema_SupportType

Vertex()
  • Returns the vertex if the solution is a Vertex.
    rtype

    TopoDS_Vertex

property thisown

The membership flag

class BRepExtrema_TriangleSet(*args)

Bases: object

  • Creates empty triangle set.
    rtype

    None* Creates triangle set from the given face.

    param theFaces

    type theFaces

    BRepExtrema_ShapeList

    rtype

    None

Box()
  • Returns AABB of the given triangle.
    param theIndex

    type theIndex

    int

    rtype

    BVH_Box<float, 3>

Center()
  • Returns centroid position along specified axis.
    param theIndex

    type theIndex

    int

    param theAxis

    type theAxis

    int

    rtype

    float

Clear()
  • Clears triangle set data.
    rtype

    None

static DownCast(t)
GetFaceID()
  • Returns face ID of the given triangle.
    param theIndex

    type theIndex

    int

    rtype

    int

GetVertices()
  • Returns vertices of the given triangle.
    param theIndex

    type theIndex

    int

    param theVertex1

    type theVertex1

    BVH_Vec3d

    param theVertex2

    type theVertex2

    BVH_Vec3d

    param theVertex3

    type theVertex3

    BVH_Vec3d

    rtype

    None

Init()
  • Initializes triangle set.
    param theFaces

    type theFaces

    BRepExtrema_ShapeList

    rtype

    bool

Size()
  • @name methods implementing BVH set interface Returns total number of triangles.
    rtype

    int

Swap()
  • Swaps indices of two specified triangles.
    param theIndex1

    type theIndex1

    int

    param theIndex2

    type theIndex2

    int

    rtype

    None

property thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

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

The membership flag

value()