OpenCascade.js
API ReferenceModelingAlgorithmsTKTopAlgo

BRepExtrema

OCCT package BRepExtrema: BRepExtrema_DistanceSS, BRepExtrema_DistShapeShape, BRepExtrema_ElementFilter, BRepExtrema_ExtCC, and 14 more bound classes.

BRepExtrema_DistanceSS

This class allows to compute minimum distance between two brep shapes (face edge vertex) and is used in DistShapeShape class.

Constructors(1)

Instance methods(4)

BRepExtrema_DistShapeShape

This class provides tools to compute minimum distance between two Shapes (Compound,CompSolid, Solid, Shell, Face, Wire, Edge, Vertex).

Constructors(3)

Instance methods(22)

  • SetDeflection(theDeflection: number): void

    Sets deflection to computation of the minimum distance.

    Parameters (1)
    • theDeflection
  • LoadS1(Shape1: TopoDS_Shape): void

    load first shape into extrema

    Parameters (1)
    • Shape1
  • LoadS2(Shape1: TopoDS_Shape): void

    load second shape into extrema

    Parameters (1)
    • Shape1
  • Perform(theRange?: Message_ProgressRange): boolean

    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. theRange - the progress indicator of algorithm

    Parameters (1)
    • theRange
  • IsDone(): boolean

    True if the minimum distance is found.

  • NbSolution(): number

    Returns the number of solutions satisfying the minimum distance.

  • Value(): number

    Returns the value of the minimum distance.

  • InnerSolution(): boolean

    True if one of the shapes is a solid and the other shape is completely or partially inside the solid.

  • PointOnShape1(N: number): gp_Pnt

    Returns the Point corresponding to the <N>th solution on the first Shape.

    Parameters (1)
    • N
  • PointOnShape2(N: number): gp_Pnt

    Returns the Point corresponding to the <N>th solution on the second Shape.

    Parameters (1)
    • N
  • 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 (1)
    • N
  • 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 (1)
    • N
  • 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 (1)
    • N
  • 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 (1)
    • N
  • ParOnEdgeS1(N: number, t: number): { t: number }

    gives the corresponding parameter t if the Nth solution is situated on an Edge of the first shape

    Parameters (2)
    • N
    • t
    Returns

    A result object with fields:

    • t: updated value from the call.
  • ParOnEdgeS2(N: number, t: number): { t: number }

    gives the corresponding parameter t if the Nth solution is situated on an Edge of the first shape

    Parameters (2)
    • N
    • t
    Returns

    A result object with fields:

    • t: updated value from the call.
  • ParOnFaceS1(N: number, u: number, v: number): { u: number; v: number }

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

    Parameters (3)
    • N
    • u
    • v
    Returns

    A result object with fields:

    • u: updated value from the call.
    • v: updated value from the call.
  • ParOnFaceS2(N: number, u: number, v: number): { u: number; v: number }

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

    Parameters (3)
    • N
    • u
    • v
    Returns

    A result object with fields:

    • u: updated value from the call.
    • v: updated value from the call.
  • Sets unused parameter Obsolete.

    Parameters (1)
    • F
  • Sets unused parameter Obsolete.

    Parameters (1)
    • A
  • SetMultiThread(theIsMultiThread: boolean): void

    If isMultiThread == true then computation will be performed in parallel.

    Parameters (1)
    • theIsMultiThread
  • IsMultiThread(): boolean

    Returns true then computation will be performed in parallel Default value is false.

BRepExtrema_ElementFilter

Filtering tool used to detect if two given mesh elements should be tested for overlapping/intersection or not.

Constructors(1)

Instance methods(1)

  • PreCheckElements(argNo0: number, argNo1: number): BRepExtrema_ElementFilter_FilterResult

    Checks if two mesh elements should be tested for overlapping/intersection (used for detection correct/incorrect cases of shared edges and vertices).

    Parameters (2)
    • argNo0
    • argNo1

BRepExtrema_ExtCC

Constructors(2)

Instance methods(11)

  • Parameters (1)
    • E2
  • Perform(E1: TopoDS_Edge): void

    An exception is raised if the fields have not been initialized.

    Parameters (1)
    • E1
  • IsDone(): boolean

    True if the distances are found.

  • NbExt(): number

    Returns the number of extremum distances.

  • IsParallel(): boolean

    Returns True if E1 and E2 are parallel.

  • SquareDistance(N: number): number

    Returns the value of the <N>th extremum square distance.

    Parameters (1)
    • N
  • ParameterOnE1(N: number): number

    Returns the parameter on the first edge of the <N>th extremum distance.

    Parameters (1)
    • N
  • PointOnE1(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance on the edge E1.

    Parameters (1)
    • N
  • ParameterOnE2(N: number): number

    Returns the parameter on the second edge of the <N>th extremum distance.

    Parameters (1)
    • N
  • PointOnE2(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance on the edge E2.

    Parameters (1)
    • N
  • TrimmedSquareDistances(dist11: number, distP12: number, distP21: number, distP22: number, P11: gp_Pnt, P12: gp_Pnt, P21: gp_Pnt, P22: gp_Pnt): { dist11: number; distP12: number; distP21: number; distP22: number }

    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 (8)
    • dist11
    • distP12
    • distP21
    • distP22
    • P11
      Mutated in place; read the updated value from this argument after the call.
    • P12
      Mutated in place; read the updated value from this argument after the call.
    • P21
      Mutated in place; read the updated value from this argument after the call.
    • P22
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • dist11: updated value from the call.
    • distP12: updated value from the call.
    • distP21: updated value from the call.
    • distP22: updated value from the call.

BRepExtrema_ExtCF

Constructors(2)

Instance methods(10)

  • Parameters (2)
    • E
    • F
  • 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 (2)
    • E
    • F
  • IsDone(): boolean

    True if the distances are found.

  • NbExt(): number

    Returns the number of extremum distances.

  • SquareDistance(N: number): number

    Returns the value of the <N>th extremum square distance.

    Parameters (1)
    • N
  • IsParallel(): boolean

    Returns True if the curve is on a parallel surface.

  • ParameterOnEdge(N: number): number

    Returns the parameters on the Edge of the <N>th extremum distance.

    Parameters (1)
    • N
  • ParameterOnFace(N: number, U: number, V: number): { U: number; V: number }

    Returns the parameters on the Face of the <N>th extremum distance.

    Parameters (3)
    • N
    • U
    • V
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • PointOnEdge(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance.

    Parameters (1)
    • N
  • PointOnFace(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance.

    Parameters (1)
    • N

BRepExtrema_ExtFF

Constructors(2)

Instance methods(10)

  • Parameters (1)
    • F2
  • 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 (2)
    • F1
    • F2
  • IsDone(): boolean

    True if the distances are found.

  • IsParallel(): boolean

    Returns True if the surfaces are parallel.

  • NbExt(): number

    Returns the number of extremum distances.

  • SquareDistance(N: number): number

    Returns the value of the <N>th extremum square distance.

    Parameters (1)
    • N
  • ParameterOnFace1(N: number, U: number, V: number): { U: number; V: number }

    Returns the parameters on the Face F1 of the <N>th extremum distance.

    Parameters (3)
    • N
    • U
    • V
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • ParameterOnFace2(N: number, U: number, V: number): { U: number; V: number }

    Returns the parameters on the Face F2 of the <N>th extremum distance.

    Parameters (3)
    • N
    • U
    • V
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • PointOnFace1(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance.

    Parameters (1)
    • N
  • PointOnFace2(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance.

    Parameters (1)
    • N

BRepExtrema_ExtPC

Constructors(2)

Instance methods(9)

  • Parameters (1)
    • E
  • An exception is raised if the fields have not been initialized.

    Parameters (1)
    • V
  • IsDone(): boolean

    True if the distances are found.

  • NbExt(): number

    Returns the number of extremum distances.

  • IsMin(N: number): boolean

    Returns True if the <N>th extremum distance is a minimum.

    Parameters (1)
    • N
  • SquareDistance(N: number): number

    Returns the value of the <N>th extremum square distance.

    Parameters (1)
    • N
  • Parameter(N: number): number

    Returns the parameter on the edge of the <N>th extremum distance.

    Parameters (1)
    • N
  • Point(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance.

    Parameters (1)
    • N
  • TrimmedSquareDistances(dist1: number, dist2: number, pnt1: gp_Pnt, pnt2: gp_Pnt): { dist1: number; dist2: number }

    if the curve is a trimmed curve, dist1 is a square distance between
    and the point of parameter FirstParameter <pnt1> and dist2 is a square distance between
    and the point of parameter LastParameter <pnt2>.

    Parameters (4)
    • dist1
    • dist2
    • pnt1
      Mutated in place; read the updated value from this argument after the call.
    • pnt2
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • dist1: updated value from the call.
    • dist2: updated value from the call.

BRepExtrema_ExtPF

Constructors(2)

Instance methods(9)

  • Initialize(TheFace: TopoDS_Face, TheFlag?: Extrema_ExtFlag, TheAlgo?: Extrema_ExtAlgo): void
    Parameters (3)
    • TheFace
    • TheFlag
    • TheAlgo
  • Perform(TheVertex: TopoDS_Vertex, TheFace: TopoDS_Face): void

    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 (2)
    • TheVertex
    • TheFace
  • IsDone(): boolean

    True if the distances are found.

  • NbExt(): number

    Returns the number of extremum distances.

  • SquareDistance(N: number): number

    Returns the value of the <N>th extremum square distance.

    Parameters (1)
    • N
  • Parameter(N: number, U: number, V: number): { U: number; V: number }

    Returns the parameters on the Face of the <N>th extremum distance.

    Parameters (3)
    • N
    • U
    • V
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • Point(N: number): gp_Pnt

    Returns the Point of the <N>th extremum distance.

    Parameters (1)
    • N
  • Parameters (1)
    • F
  • Parameters (1)
    • A

BRepExtrema_OverlapTool

Enables storing of individual overlapped triangles (useful for debug).
Tool class for for detection of overlapping of two BVH primitive sets. This tool is not intended to be used independently, and is integrated in other classes, implementing algorithms based on shape tessellation (BRepExtrema_ShapeProximity and BRepExtrema_SelfIntersection).
Note that input element sets may correspond to different shapes or to the same shape. In first case, tessellations of two given shapes will be tested for intersection (or overlapping, if tolerance is not zero). In second case, tessellation of single shape will be tested for self- intersections. Please note that algorithm results are approximate and depend greatly on the quality of input tessellation(s).

Constructors(2)

Instance methods(8)

BRepExtrema_Poly

Constructors(1)

Static methods(1)

  • Distance(S1: TopoDS_Shape, S2: TopoDS_Shape, P1: gp_Pnt, P2: gp_Pnt, dist: number): { returnValue: boolean; dist: number }

    returns true if OK.

    Parameters (5)
    • S1
    • S2
    • P1
      Mutated in place; read the updated value from this argument after the call.
    • P2
      Mutated in place; read the updated value from this argument after the call.
    • dist
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • dist: updated value from the call.

BRepExtrema_SelfIntersection

Tool class for detection of self-sections in the given shape. This class is based on BRepExtrema_OverlapTool and thus uses shape tessellation to detect incorrect mesh fragments (pairs of overlapped triangles belonging to different faces).
Thus, a result depends critically on the quality of mesh generator (e.g., BREP mesh is not always a good choice, because it can contain gaps between adjacent face triangulations, which may not share vertices on common edge; thus false overlap can be detected). As a result, this tool can be used for relatively fast approximated test which provides sub-set of potentially overlapped faces.

Constructors(2)

Instance methods(8)

  • Tolerance(): number

    Returns tolerance value used for self-intersection test.

  • SetTolerance(theTolerance: number): void

    Sets tolerance value used for self-intersection test.

    Parameters (1)
    • theTolerance
  • LoadShape(theShape: TopoDS_Shape): boolean

    Loads shape for detection of self-intersections.

    Parameters (1)
    • theShape
  • Perform(): void

    Performs detection of self-intersections.

  • IsDone(): boolean

    True if the detection is completed.

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

  • GetSubShape(theID: number): TopoDS_Face

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

    Parameters (1)
    • theID
  • Returns set of all the face triangles of the shape.

BRepExtrema_ShapeProximity

Tool class for shape proximity detection.
First approach: For two given shapes and given tolerance (offset from the mesh) the algorithm allows to determine whether or not they are overlapped. The algorithm input consists of any shapes which can be decomposed into individual faces (used as basic shape elements).
The algorithm can be run in two modes. If tolerance is set to zero, the algorithm will detect only intersecting faces (containing triangles with common points). If tolerance is set to positive value, the algorithm will also detect faces located on distance less than the given tolerance from each other.
Second approach: Compute the proximity value between two shapes (handles only edge/edge or face/face cases) if the tolerance is not defined (Precision::Infinite()). In this case the proximity value is a minimal thickness of a layer containing both shapes.
For the both approaches the high performance is achieved through the use of existing triangulation of faces. So, poly triangulation (with the desired deflection) should already be built. Note that solution is approximate (and corresponds to the deflection used for triangulation).

Constructors(2)

Instance methods(19)

  • Tolerance(): number

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

  • SetTolerance(theTolerance: number): void

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

    Parameters (1)
    • theTolerance
  • Proximity(): number

    Returns proximity value calculated for the whole input shapes.

  • LoadShape1(theShape1: TopoDS_Shape): boolean

    Loads 1st shape into proximity tool.

    Parameters (1)
    • theShape1
  • LoadShape2(theShape2: TopoDS_Shape): boolean

    Loads 2nd shape into proximity tool.

    Parameters (1)
    • theShape2
  • SetNbSamples1(theNbSamples: number): void

    Set number of sample points on the 1st shape used to compute the proximity value. In case of 0, all triangulation nodes will be used.

    Parameters (1)
    • theNbSamples
  • SetNbSamples2(theNbSamples: number): void

    Set number of sample points on the 2nd shape used to compute the proximity value. In case of 0, all triangulation nodes will be used.

    Parameters (1)
    • theNbSamples
  • Perform(): void

    Performs search of overlapped faces.

  • IsDone(): boolean

    True if the search is completed.

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

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

  • GetSubShape1(theID: number): TopoDS_Shape

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

    Parameters (1)
    • theID
  • GetSubShape2(theID: number): TopoDS_Shape

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

    Parameters (1)
    • theID
  • Returns set of all the face triangles of the 1st shape.

  • Returns set of all the face triangles of the 2nd shape.

  • Returns the point on the 1st shape, which could be used as a reference point for the value of the proximity.

  • Returns the point on the 2nd shape, which could be used as a reference point for the value of the proximity.

  • ProxPntStatus1(): unknown

    Returns the status of point on the 1st shape, which could be used as a reference point for the value of the proximity.

  • ProxPntStatus2(): unknown

    Returns the status of point on the 2nd shape, which could be used as a reference point for the value of the proximity.

BRepExtrema_SolutionElem

This class is used to store information relative to the minimum distance between two shapes.

Constructors(4)

  • Empty constructor.

  • constructor(theDist: number, thePoint: gp_Pnt, theSolType: BRepExtrema_SupportType, theVertex: TopoDS_Vertex): BRepExtrema_SolutionElem

    This constructor is used when the solution of a distance is a Vertex. The different initialized fields are:

    Parameters (4)
    • theDist
      the distance
    • thePoint
      the solution point
    • theSolType
      the type of solution
    • theVertex
      and the Vertex
  • constructor(theDist: number, thePoint: gp_Pnt, theSolType: BRepExtrema_SupportType, theEdge: TopoDS_Edge, theParam: number): BRepExtrema_SolutionElem

    This constructor is used when the solution of distance is on an Edge. The different initialized fields are:

    Parameters (5)
    • theDist
      the distance
    • thePoint
      the solution point
    • theSolType
      the type of solution
    • theEdge
      the Edge
    • theParam
      the parameter to locate the solution
  • constructor(theDist: number, thePoint: gp_Pnt, theSolType: BRepExtrema_SupportType, theFace: TopoDS_Face, theU: number, theV: number): BRepExtrema_SolutionElem

    This constructor is used when the solution of distance is in a Face. The different initialized fields are:

    Parameters (6)
    • theDist
      the distance
    • thePoint
      the solution point
    • theSolType
      the type of solution
    • theFace
      the Face
    • theU
      U parameter to locate the solution
    • theV
      V parameter to locate the solution

Instance methods(8)

  • Dist(): number

    Returns the value of the minimum distance.

  • Returns the solution point.

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

  • Returns the vertex if the solution is a Vertex.

  • Returns the vertex if the solution is an Edge.

  • Returns the vertex if the solution is an Face.

  • EdgeParameter(theParam: number): { theParam: number }

    Returns the parameter value if the solution is on Edge.

    Parameters (1)
    • theParam
    Returns

    A result object with fields:

    • theParam: updated value from the call.
  • FaceParameter(theU: number, theV: number): { theU: number; theV: number }

    Returns the parameters U and V if the solution is in a Face.

    Parameters (2)
    • theU
    • theV
    Returns

    A result object with fields:

    • theU: updated value from the call.
    • theV: updated value from the call.

BRepExtrema_TriangleSet

BVH_PrimitiveSet3d

List of shapes and their IDs for collision detection.
Triangle set corresponding to specific face.

Constructors(2)

Static methods(2)

Instance methods(13)

BRepExtrema_VertexInspector

Inspector for CellFilter algorithm working with gp_XYZ points in 3d space. Used in search of coincidence points with a certain tolerance.

Constructors(1)

Static methods(2)

Instance methods(5)

  • Add(thePnt: gp_XYZ): void

    Keep the points used for comparison.

    Parameters (1)
    • thePnt
  • SetTol(theTol: number): void

    Set tolerance for comparison of point coordinates.

    Parameters (1)
    • theTol
  • SetCurrent(theCurPnt: gp_XYZ): void

    Set current point to search for coincidence.

    Parameters (1)
    • theCurPnt
  • IsNeedAdd(): boolean
  • Implementation of inspection method.

    Parameters (1)
    • theTarget