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_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_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