# OCC.BRepExtrema module

class `BRepExtrema_DistShapeShape`(*args)

  Bases: `object`

  - create empty tool

  Return type: | None

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

  Parameters: | Shape1 (TopoDS_Shape &) – Shape2 (TopoDS_Shape &) – F (Extrema_ExtFlag) – default value is Extrema_ExtFlag_MINMAX A (Extrema_ExtAlgo) – default value is Extrema_ExtAlgo_Grad
  Return type: | None

  - create tool and load both shapes into it

  Parameters: | Shape1 (TopoDS_Shape &) – Shape2 (TopoDS_Shape &) – theDeflection (float) – F (Extrema_ExtFlag) – default value is Extrema_ExtFlag_MINMAX A (Extrema_ExtAlgo) – default value is Extrema_ExtAlgo_Grad
  Return type: | None

  `DumpToString`()

    BRepExtrema_DistShapeShape_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.

    Return type: | bool

  `IsDone`()
    - True if the minimum distance is found.

    Return type: | bool

  `LoadS1`()
    - load first shape into extrema

    Parameters: | Shape1 (TopoDS_Shape &) –
    Return type: | None

  `LoadS2`()
    - load second shape into extrema

    Parameters: | Shape1 (TopoDS_Shape &) –
    Return type: | None

  `NbSolution`()
    - Returns the number of solutions satisfying the minimum distance.

    Return type: | int

  `ParOnEdgeS1`()
    - gives the corresponding parameter t if the Nth solution is situated on an Egde of the first shape

    Parameters: | N (int) – t (float &) –
    Return type: | None

  `ParOnEdgeS2`()
    - gives the corresponding parameter t if the Nth solution is situated on an Egde of the first shape

    Parameters: | N (int) – t (float &) –
    Return type: | None

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

    Parameters: | N (int) – u (float &) – v (float &) –
    Return type: | None

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

    Parameters: | N (int) – u (float &) – v (float &) –
    Return type: | 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.

    Return type: | bool

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

    Parameters: | N (int) –
    Return type: | gp_Pnt

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

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `SetAlgo`()

    Parameters: | A (Extrema_ExtAlgo) –
    Return type: | None

  `SetDeflection`()

    Parameters: | theDeflection (float) –
    Return type: | None

  `SetFlag`()

    Parameters: | F (Extrema_ExtFlag) –
    Return type: | 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.

    Parameters: | N (int) –
    Return type: | 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.

    Parameters: | N (int) –
    Return type: | 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

    Parameters: | N (int) –
    Return type: | 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

    Parameters: | N (int) –
    Return type: | BRepExtrema_SupportType

  `Value`()
    - Returns the value of the minimum distance.

    Return type: | float

  `thisown`

    The membership flag

class `BRepExtrema_DistanceSS`(*args)

  Bases: `object`

  - computes the distance between two Shapes ( face edge vertex).

  Parameters: | S1 (TopoDS_Shape &) – S2 (TopoDS_Shape &) – B1 (Bnd_Box &) – B2 (Bnd_Box &) – DstRef (float) – F (Extrema_ExtFlag) – default value is Extrema_ExtFlag_MINMAX A (Extrema_ExtAlgo) – default value is Extrema_ExtAlgo_Grad
  Return type: | 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().

  Parameters: | S1 (TopoDS_Shape &) – S2 (TopoDS_Shape &) – B1 (Bnd_Box &) – B2 (Bnd_Box &) – DstRef (float) – aDeflection (float) – F (Extrema_ExtFlag) – default value is Extrema_ExtFlag_MINMAX A (Extrema_ExtAlgo) – default value is Extrema_ExtAlgo_Grad
  Return type: | None

  `DistValue`()
    - returns the distance value

    Return type: | float

  `IsDone`()
    - True if the distance has been computed

    Return type: | bool

  `Seq1Value`()
    - returns the list of solutions on the first shape

    Return type: | BRepExtrema_SeqOfSolution

  `Seq2Value`()
    - returns the list of solutions on the second shape

    Return type: | BRepExtrema_SeqOfSolution

  `SetAlgo`()
    - sets the flag controlling …

    Parameters: | A (Extrema_ExtAlgo) –
    Return type: | None

  `SetFlag`()
    - sets the flag controlling minimum and maximum search

    Parameters: | F (Extrema_ExtFlag) –
    Return type: | None

  `thisown`

    The membership flag

class `BRepExtrema_ElementFilter`(*args, **kwargs)

  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).

    Parameters: | Standard_Integer – Standard_Integer –
    Return type: | FilterResult

  `thisown`

    The membership flag

class `BRepExtrema_ExtCC`(*args)

  Bases: `object`

  Return type: | None

  - It calculates all the distances.

  Parameters: | E1 (TopoDS_Edge &) – E2 (TopoDS_Edge &) –
  Return type: | None

  `Initialize`()

    Parameters: | E2 (TopoDS_Edge &) –
    Return type: | None

  `IsDone`()
    - True if the distances are found.

    Return type: | bool

  `IsParallel`()
    - Returns True if E1 and E2 are parallel.

    Return type: | bool

  `NbExt`()
    - Returns the number of extremum distances.

    Return type: | int

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

    Parameters: | N (int) –
    Return type: | float

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

    Parameters: | N (int) –
    Return type: | float

  `Perform`()
    - An exception is raised if the fields have not been initialized.

    Parameters: | E1 (TopoDS_Edge &) –
    Return type: | None

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

    Parameters: | N (int) –
    Return type: | gp_Pnt

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

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `SquareDistance`()
    - Returns the value of the <N>th extremum square distance.

    Parameters: | N (int) –
    Return type: | 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.

    Parameters: | dist11 (float &) – distP12 (float &) – distP21 (float &) – distP22 (float &) – P11 (gp_Pnt) – P12 (gp_Pnt) – P21 (gp_Pnt) – P22 (gp_Pnt) –
    Return type: | None

  `thisown`

    The membership flag

class `BRepExtrema_ExtCF`(*args)

  Bases: `object`

  Return type: | None

  - It calculates all the distances.

  Parameters: | E (TopoDS_Edge &) – F (TopoDS_Face &) –
  Return type: | None

  `Initialize`()

    Parameters: | E (TopoDS_Edge &) – F (TopoDS_Face &) –
    Return type: | None

  `IsDone`()
    - True if the distances are found.

    Return type: | bool

  `IsParallel`()
    - Returns True if the curve is on a parallel surface.

    Return type: | bool

  `NbExt`()
    - Returns the number of extremum distances.

    Return type: | int

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

    Parameters: | N (int) –
    Return type: | float

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

    Parameters: | N (int) – U (float &) – V (float &) –
    Return type: | 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.

    Parameters: | E (TopoDS_Edge &) – F (TopoDS_Face &) –
    Return type: | None

  `PointOnEdge`()
    - Returns the Point of the <N>th extremum distance.

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `PointOnFace`()
    - Returns the Point of the <N>th extremum distance.

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `SquareDistance`()
    - Returns the value of the <N>th extremum square distance.

    Parameters: | N (int) –
    Return type: | float

  `thisown`

    The membership flag

class `BRepExtrema_ExtFF`(*args)

  Bases: `object`

  Return type: | None

  - It calculates all the distances.

  Parameters: | F1 (TopoDS_Face &) – F2 (TopoDS_Face &) –
  Return type: | None

  `Initialize`()

    Parameters: | F2 (TopoDS_Face &) –
    Return type: | None

  `IsDone`()
    - True if the distances are found.

    Return type: | bool

  `IsParallel`()
    - Returns True if the surfaces are parallel.

    Return type: | bool

  `NbExt`()
    - Returns the number of extremum distances.

    Return type: | int

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

    Parameters: | N (int) – U (float &) – V (float &) –
    Return type: | None

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

    Parameters: | N (int) – U (float &) – V (float &) –
    Return type: | 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.

    Parameters: | F1 (TopoDS_Face &) – F2 (TopoDS_Face &) –
    Return type: | None

  `PointOnFace1`()
    - Returns the Point of the <N>th extremum distance.

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `PointOnFace2`()
    - Returns the Point of the <N>th extremum distance.

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `SquareDistance`()
    - Returns the value of the <N>th extremum square distance.

    Parameters: | N (int) –
    Return type: | float

  `thisown`

    The membership flag

class `BRepExtrema_ExtPC`(*args)

  Bases: `object`

  Return type: | None

  - It calculates all the distances.

  Parameters: | V (TopoDS_Vertex &) – E (TopoDS_Edge &) –
  Return type: | None

  `Initialize`()

    Parameters: | E (TopoDS_Edge &) –
    Return type: | None

  `IsDone`()
    - True if the distances are found.

    Return type: | bool

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

    Parameters: | N (int) –
    Return type: | bool

  `NbExt`()
    - Returns the number of extremum distances.

    Return type: | int

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

    Parameters: | N (int) –
    Return type: | float

  `Perform`()
    - An exception is raised if the fields have not been initialized.

    Parameters: | V (TopoDS_Vertex &) –
    Return type: | None

  `Point`()
    - Returns the Point of the <N>th extremum distance.

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `SquareDistance`()
    - Returns the value of the <N>th extremum square distance.

    Parameters: | N (int) –
    Return type: | 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>.

    Parameters: | dist1 (float &) – dist2 (float &) – pnt1 (gp_Pnt) – pnt2 (gp_Pnt) –
    Return type: | None

  `thisown`

    The membership flag

class `BRepExtrema_ExtPF`(*args)

  Bases: `object`

  Return type: | None

  - It calculates all the distances.

  Parameters: | TheVertex (TopoDS_Vertex &) – TheFace (TopoDS_Face &) – TheFlag (Extrema_ExtFlag) – default value is Extrema_ExtFlag_MINMAX TheAlgo (Extrema_ExtAlgo) – default value is Extrema_ExtAlgo_Grad
  Return type: | None

  `Initialize`()

    Parameters: | TheFace (TopoDS_Face &) – TheFlag (Extrema_ExtFlag) – default value is Extrema_ExtFlag_MINMAX TheAlgo (Extrema_ExtAlgo) – default value is Extrema_ExtAlgo_Grad
    Return type: | None

  `IsDone`()
    - True if the distances are found.

    Return type: | bool

  `NbExt`()
    - Returns the number of extremum distances.

    Return type: | int

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

    Parameters: | N (int) – U (float &) – V (float &) –
    Return type: | 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.

    Parameters: | TheVertex (TopoDS_Vertex &) – TheFace (TopoDS_Face &) –
    Return type: | None

  `Point`()
    - Returns the Point of the <N>th extremum distance.

    Parameters: | N (int) –
    Return type: | gp_Pnt

  `SetAlgo`()

    Parameters: | A (Extrema_ExtAlgo) –
    Return type: | None

  `SetFlag`()

    Parameters: | F (Extrema_ExtFlag) –
    Return type: | None

  `SquareDistance`()
    - Returns the value of the <N>th extremum square distance.

    Parameters: | N (int) –
    Return type: | float

  `thisown`

    The membership flag

class `BRepExtrema_Poly`(*args, **kwargs)

  Bases: `object`

  static `Distance`(*args)
    - returns Standard_True if OK.

    Parameters: | S1 (TopoDS_Shape &) – S2 (TopoDS_Shape &) – P1 (gp_Pnt) – P2 (gp_Pnt) – dist (float &) –
    Return type: | bool

  `thisown`

    The membership flag

`BRepExtrema_Poly_Distance`(*args)
  - returns Standard_True if OK.

  Parameters: | S1 (TopoDS_Shape &) – S2 (TopoDS_Shape &) – P1 (gp_Pnt) – P2 (gp_Pnt) – dist (float &) –
  Return type: | bool

class `BRepExtrema_SelfIntersection`(*args)

  Bases: `OCC.BRepExtrema.BRepExtrema_ElementFilter`

  - Creates unitialized self-intersection tool.

  Parameters: | theTolerance (float) – default value is 0.0
  Return type: | None

  - Creates self-intersection tool for the given shape.

  Parameters: | theShape (TopoDS_Shape &) – theTolerance (float) – default value is 0.0
  Return type: | None

  `ElementSet`()
    - Returns set of all the face triangles of the shape.

    Return type: | Handle_BRepExtrema_TriangleSet

  `GetSubShape`()
    - Returns sub-shape from the shape for the given index (started from 0).

    Parameters: | theID (int) –
    Return type: | TopoDS_Face

  `IsDone`()
    - True if the detection is completed.

    Return type: | bool

  `LoadShape`()
    - Loads shape for detection of self-intersections.

    Parameters: | theShape (TopoDS_Shape &) –
    Return type: | bool

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

    Return type: | BRepExtrema_MapOfIntegerPackedMapOfInteger

  `Perform`()
    - Performs detection of self-intersections.

    Return type: | None

  `SetTolerance`()
    - Sets tolerance value used for self-intersection test.

    Parameters: | theTolerance (float) –
    Return type: | None

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

    Return type: | float

  `thisown`

    The membership flag

class `BRepExtrema_ShapeProximity`(*args)

  Bases: `object`

  - Creates empty proximity tool.

  Parameters: | theTolerance (float) – default value is 0.0
  Return type: | None

  - Creates proximity tool for the given two shapes.

  Parameters: | theShape1 (TopoDS_Shape &) – theShape2 (TopoDS_Shape &) – theTolerance (float) – default value is 0.0
  Return type: | None

  `ElementSet1`()
    - Returns set of all the face triangles of the 1st shape.

    Return type: | Handle_BRepExtrema_TriangleSet

  `ElementSet2`()
    - Returns set of all the face triangles of the 2nd shape.

    Return type: | Handle_BRepExtrema_TriangleSet

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

    Parameters: | theID (int) –
    Return type: | TopoDS_Face

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

    Parameters: | theID (int) –
    Return type: | TopoDS_Face

  `IsDone`()
    - True if the search is completed.

    Return type: | bool

  `LoadShape1`()
    - Loads 1st shape into proximity tool.

    Parameters: | theShape1 (TopoDS_Shape &) –
    Return type: | bool

  `LoadShape2`()
    - Loads 2nd shape into proximity tool.

    Parameters: | theShape2 (TopoDS_Shape &) –
    Return type: | bool

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

    Return type: | BRepExtrema_MapOfIntegerPackedMapOfInteger

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

    Return type: | BRepExtrema_MapOfIntegerPackedMapOfInteger

  `Perform`()
    - Performs search of overlapped faces.

    Return type: | None

  `SetTolerance`()
    - Sets tolerance value for overlap test (distance between shapes).

    Parameters: | theTolerance (float) –
    Return type: | None

  `Tolerance`()
    - Returns tolerance value for overlap test (distance between shapes).

    Return type: | float

  `thisown`

    The membership flag

class `BRepExtrema_SolutionElem`(*args)

  Bases: `object`

  - Empty constructor

  Return type: | 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

  Parameters: | theDist (float) – thePoint (gp_Pnt) – theSolType (BRepExtrema_SupportType) – theVertex (TopoDS_Vertex &) –
  Return type: | 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

  Parameters: | theDist (float) – thePoint (gp_Pnt) – theSolType (BRepExtrema_SupportType) – theEdge (TopoDS_Edge &) – theParam (float) –
  Return type: | 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

  Parameters: | theDist (float) – thePoint (gp_Pnt) – theSolType (BRepExtrema_SupportType) – theFace (TopoDS_Face &) – theU (float) – theV (float) –
  Return type: | None

  `Dist`()
    - Returns the value of the minimum distance.

    Return type: | float

  `Edge`()
    - Returns the vertex if the solution is an Edge.

    Return type: | TopoDS_Edge

  `EdgeParameter`()
    - Returns the parameter value if the solution is on Edge.

    Parameters: | theParam (float &) –
    Return type: | None

  `Face`()
    - Returns the vertex if the solution is an Face.

    Return type: | TopoDS_Face

  `FaceParameter`()
    - Returns the parameters U and V if the solution is in a Face.

    Parameters: | theU (float &) – theV (float &) –
    Return type: | None

  `Point`()
    - Returns the solution point.

    Return type: | 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.

    Return type: | BRepExtrema_SupportType

  `Vertex`()
    - Returns the vertex if the solution is a Vertex.

    Return type: | TopoDS_Vertex

  `thisown`

    The membership flag

class `SwigPyIterator`(*args, **kwargs)

  Bases: `object`

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

    The membership flag

  `value`()

`register_handle`(handle, base_object)

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