OpenCascade.js
API ReferenceModelingAlgorithmsTKBO

BOPTools

OCCT package BOPTools: BOPTools_AlgoTools, BOPTools_AlgoTools2D, BOPTools_AlgoTools3D, BOPTools_ConnexityBlock, and 2 more bound classes.

BOPTools_AlgoTools

Provides tools used in Boolean Operations algorithm:

  • Vertices intersection;
  • Vertex construction;
  • Edge construction;
  • Classification algorithms;
  • Making connexity blocks;
  • Shape validation.

Constructors(1)

Static methods(56)

BOPTools_AlgoTools2D

The class contains handy static functions dealing with the topology This is the copy of the BOPTools_AlgoTools2D.cdl.

Constructors(1)

Static methods(17)

  • Compute P-Curve for the edge <aE> on the face <aF>. Raises exception Standard_ConstructionError if projection algorithm fails. <theContext> - storage for caching the geometrical tools.

    Parameters (3)
    • aE
    • aF
    • theContext
  • EdgeTangent(anE: TopoDS_Edge, aT: number, Tau: gp_Vec): boolean

    Compute tangent for the edge <aE> [in 3D] at parameter <aT>.

    Parameters (3)
    • anE
    • aT
    • Tau
      Mutated in place; read the updated value from this argument after the call.
  • PointOnSurface(aE: TopoDS_Edge, aF: TopoDS_Face, aT: number, U: number, V: number, theContext: IntTools_Context): { U: number; V: number }

    Compute surface parameters <U,V> of the face <aF> for the point from the edge <aE> at parameter <aT>. If <aE> has't pcurve on surface, algorithm tries to get it by projection and can raise exception Standard_ConstructionError if projection algorithm fails. <theContext> - storage for caching the geometrical tools.

    Parameters (6)
    • aE
    • aF
    • aT
    • U
    • V
    • theContext
    Returns

    A result object with fields:

    • U: updated value from the call.
    • V: updated value from the call.
  • CurveOnSurface(aE: TopoDS_Edge, aF: TopoDS_Face, aToler: number, theContext: IntTools_Context): { aC: Geom2d_Curve; aToler: number; [Symbol.dispose](): void }

    Get P-Curve <aC> for the edge <aE> on surface <aF>. If the P-Curve does not exist, build it using Make2D(). [aToler] - reached tolerance Raises exception Standard_ConstructionError if algorithm Make2D() fails. <theContext> - storage for caching the geometrical tools.

    Parameters (4)
    • aE
    • aF
    • aToler
    • theContext
    Returns

    A result object with fields:

    • aC: owned by the returned envelope.
    • aToler: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • CurveOnSurface(aE: TopoDS_Edge, aF: TopoDS_Face, aFirst: number, aLast: number, aToler: number, theContext: IntTools_Context): { aC: Geom2d_Curve; aFirst: number; aLast: number; aToler: number; [Symbol.dispose](): void }

    Get P-Curve <aC> for the edge <aE> on surface <aF>. If the P-Curve does not exist, build it using Make2D(). [aFirst, aLast] - range of the P-Curve [aToler] - reached tolerance Raises exception Standard_ConstructionError if algorithm Make2D() fails. <theContext> - storage for caching the geometrical tools.

    Parameters (6)
    • aE
    • aF
    • aFirst
    • aLast
    • aToler
    • theContext
    Returns

    A result object with fields:

    • aC: owned by the returned envelope.
    • aFirst: updated value from the call.
    • aLast: updated value from the call.
    • aToler: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • HasCurveOnSurface(aE: TopoDS_Edge, aF: TopoDS_Face, aFirst: number, aLast: number, aToler: number): { returnValue: boolean; aC: Geom2d_Curve; aFirst: number; aLast: number; aToler: number; [Symbol.dispose](): void }

    Returns TRUE if the edge <aE> has P-Curve <aC> on surface <aF>. [aFirst, aLast] - range of the P-Curve [aToler] - reached tolerance If the P-Curve does not exist, aC.IsNull()=TRUE.

    Parameters (5)
    • aE
    • aF
    • aFirst
    • aLast
    • aToler
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • aC: owned by the returned envelope.
    • aFirst: updated value from the call.
    • aLast: updated value from the call.
    • aToler: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • Returns TRUE if the edge <aE> has P-Curve <aC> on surface <aF>. If the P-Curve does not exist, aC.IsNull()=TRUE.

    Parameters (2)
    • aE
    • aF
  • AdjustPCurveOnFace(theF: TopoDS_Face, theC3D: Geom_Curve, theC2D: Geom2d_Curve, theContext: IntTools_Context): { theC2DA: Geom2d_Curve; [Symbol.dispose](): void }

    Adjust P-Curve <theC2D> (3D-curve <theC3D>) on surface of the face <theF>. <theContext> - storage for caching the geometrical tools.

    Parameters (4)
    • theF
    • theC3D
    • theC2D
    • theContext
    Returns

    A result object with fields:

    • theC2DA: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • AdjustPCurveOnFace(theF: TopoDS_Face, theFirst: number, theLast: number, theC2D: Geom2d_Curve, theContext: IntTools_Context): { theC2DA: Geom2d_Curve; [Symbol.dispose](): void }

    Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF>. [aT1, aT2] - range to adjust <theContext> - storage for caching the geometrical tools.

    Parameters (5)
    • theF
    • theFirst
    • theLast
    • theC2D
    • theContext
    Returns

    A result object with fields:

    • theC2DA: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • AdjustPCurveOnSurf(aF: BRepAdaptor_Surface, aT1: number, aT2: number, aC2D: Geom2d_Curve): { aC2DA: Geom2d_Curve; [Symbol.dispose](): void }

    Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF>. [aT1, aT2] - range to adjust.

    Parameters (4)
    • aF
    • aT1
    • aT2
    • aC2D
    Returns

    A result object with fields:

    • aC2DA: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • IntermediatePoint(aFirst: number, aLast: number): number

    Compute intermediate value in between [aFirst, aLast].

    Parameters (2)
    • aFirst
    • aLast
  • Compute intermediate value of parameter for the edge <anE>.

    Parameters (1)
    • anE
  • Make2D(aE: TopoDS_Edge, aF: TopoDS_Face, aFirst: number, aLast: number, aToler: number, theContext: IntTools_Context): { aC: Geom2d_Curve; aFirst: number; aLast: number; aToler: number; [Symbol.dispose](): void }

    Make P-Curve <aC> for the edge <aE> on surface <aF>. [aFirst, aLast] - range of the P-Curve [aToler] - reached tolerance Raises exception Standard_ConstructionError if algorithm fails. <theContext> - storage for caching the geometrical tools.

    Parameters (6)
    • aE
    • aF
    • aFirst
    • aLast
    • aToler
    • theContext
    Returns

    A result object with fields:

    • aC: owned by the returned envelope.
    • aFirst: updated value from the call.
    • aLast: updated value from the call.
    • aToler: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • MakePCurveOnFace(aF: TopoDS_Face, C3D: Geom_Curve, aToler: number, theContext: IntTools_Context): { aC: Geom2d_Curve; aToler: number; [Symbol.dispose](): void }

    Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF>. [aToler] - reached tolerance Raises exception Standard_ConstructionError if projection algorithm fails. <theContext> - storage for caching the geometrical tools.

    Parameters (4)
    • aF
    • C3D
    • aToler
    • theContext
    Returns

    A result object with fields:

    • aC: owned by the returned envelope.
    • aToler: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • MakePCurveOnFace(aF: TopoDS_Face, C3D: Geom_Curve, aT1: number, aT2: number, aToler: number, theContext: IntTools_Context): { aC: Geom2d_Curve; aToler: number; [Symbol.dispose](): void }

    Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF>. [aT1, aT2] - range to build [aToler] - reached tolerance Raises exception Standard_ConstructionError if projection algorithm fails. <theContext> - storage for caching the geometrical tools.

    Parameters (6)
    • aF
    • C3D
    • aT1
    • aT2
    • aToler
    • theContext
    Returns

    A result object with fields:

    • aC: owned by the returned envelope.
    • aToler: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • Attach P-Curve from the edge <aEold> on surface <aF> to the edge <aEnew> Returns 0 in case of success.

    Parameters (4)
    • aEold
    • aEnew
    • aF
    • aCtx
  • IsEdgeIsoline(theE: TopoDS_Edge, theF: TopoDS_Face, isTheUIso: boolean, isTheVIso: boolean): { isTheUIso: boolean; isTheVIso: boolean }

    Checks if CurveOnSurface of theE on theF matches with isoline of theF surface. Sets corresponding values for isTheUIso and isTheVIso variables.
    ATTENTION!!! This method is based on the comparison between direction of surface (which theF is based on) iso-lines and the direction of the edge p-curve (on theF) in middle-point of the p-curve.
    This method should be used carefully (e.g. BRep_Tool::IsClosed(...) together) in order to avoid false classification some p-curves as isoline (e.g. circle on a plane).

    Parameters (4)
    • theE
    • theF
    • isTheUIso
    • isTheVIso
    Returns

    A result object with fields:

    • isTheUIso: updated value from the call.
    • isTheVIso: updated value from the call.

BOPTools_AlgoTools3D

The class contains handy static functions dealing with the topology This is the copy of BOPTools_AlgoTools3D.cdl file.

Constructors(1)

Static methods(19)

  • DoSplitSEAMOnFace(theESplit: TopoDS_Edge, theFace: TopoDS_Face): boolean

    Makes the edge <theESplit> seam edge for the face <theFace> basing on the surface properties (U and V periods).

    Parameters (2)
    • theESplit
    • theFace
  • DoSplitSEAMOnFace(theEOrigin: TopoDS_Edge, theESplit: TopoDS_Edge, theFace: TopoDS_Face): boolean

    Makes the split edge <theESplit> seam edge for the face <theFace> basing on the positions of 2d curves of the original edge <theEOrigin>.

    Parameters (3)
    • theEOrigin
    • theESplit
    • theFace
  • GetNormalToFaceOnEdge(aE: TopoDS_Edge, aF: TopoDS_Face, aT: number, aD: gp_Dir, theContext: IntTools_Context): void

    Computes normal to the face <aF> for the point on the edge <aE> at parameter <aT>. <theContext> - storage for caching the geometrical tools.

    Parameters (5)
    • aE
    • aF
    • aT
    • aD
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • Computes normal to the face <aF> for the point on the edge <aE> at arbitrary intermediate parameter. <theContext> - storage for caching the geometrical tools.

    Parameters (4)
    • aE
    • aF
    • aD
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • SenseFlag(aNF1: gp_Dir, aNF2: gp_Dir): number

    Returns 1 if scalar product aNF1* aNF2>0. Returns 0 if directions aNF1 aNF2 coincide Returns -1 if scalar product aNF1* aNF2<0.

    Parameters (2)
    • aNF1
    • aNF2
  • GetNormalToSurface(aS: Geom_Surface, U: number, V: number, aD: gp_Dir): boolean

    Compute normal <aD> to surface <aS> in point (U,V) Returns TRUE if directions aD1U, aD1V coincide.

    Parameters (4)
    • aS
    • U
    • V
    • aD
      Mutated in place; read the updated value from this argument after the call.
  • GetApproxNormalToFaceOnEdge(aE: TopoDS_Edge, aF: TopoDS_Face, aT: number, aPx: gp_Pnt, aD: gp_Dir, theContext: IntTools_Context): boolean

    Computes normal to the face <aF> for the 3D-point that belongs to the edge <aE> at parameter <aT>. Output: aPx - the 3D-point where the normal computed aD - the normal; Warning: The normal is computed not exactly in the point on the edge, but in point that is near to the edge towards to the face material (so, we'll have approx. normal); The point is computed using PointNearEdge function, with the shifting value BOPTools_AlgoTools3D::MinStepIn2d(), from the edge, but if this value is too big, the point will be computed using Hatcher (PointInFace function). Returns TRUE in case of success.

    Parameters (6)
    • aE
    • aF
    • aT
    • aPx
      Mutated in place; read the updated value from this argument after the call.
    • aD
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • GetApproxNormalToFaceOnEdge(theE: TopoDS_Edge, theF: TopoDS_Face, aT: number, aP: gp_Pnt, aDNF: gp_Dir, aDt2D: number): boolean

    Computes normal to the face <aF> for the 3D-point that belongs to the edge <aE> at parameter <aT>. Output: aPx - the 3D-point where the normal computed aD - the normal; Warning: The normal is computed not exactly in the point on the edge, but in point that is near to the edge towards to the face material (so, we'll have approx. normal); The point is computed using PointNearEdge function with the shifting value <aDt2D> from the edge; No checks on this value will be done. Returns TRUE in case of success.

    Parameters (6)
    • theE
    • theF
    • aT
    • aP
      Mutated in place; read the updated value from this argument after the call.
    • aDNF
      Mutated in place; read the updated value from this argument after the call.
    • aDt2D
  • GetApproxNormalToFaceOnEdge(theE: TopoDS_Edge, theF: TopoDS_Face, aT: number, aDt2D: number, aP: gp_Pnt, aDNF: gp_Dir, theContext: IntTools_Context): boolean

    Computes normal to the face <aF> for the 3D-point that belongs to the edge <aE> at parameter <aT>. Output: aPx - the 3D-point where the normal computed aD - the normal; Warning: The normal is computed not exactly in the point on the edge, but in point that is near to the edge towards to the face material (so, we'll have approx. normal); The point is computed using PointNearEdge function with the shifting value <aDt2D> from the edge, but if this value is too big the point will be computed using Hatcher (PointInFace function). Returns TRUE in case of success.

    Parameters (7)
    • theE
    • theF
    • aT
    • aDt2D
    • aP
      Mutated in place; read the updated value from this argument after the call.
    • aDNF
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • PointNearEdge(aE: TopoDS_Edge, aF: TopoDS_Face, aP2D: gp_Pnt2d, aPx: gp_Pnt, theContext: IntTools_Context): number

    Compute the point <aPx>, (<aP2D>) that is near to the edge <aE> at arbitrary parameter towards to the material of the face <aF>. The value of shifting in 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d(). If the value of shifting is too big the point will be computed using Hatcher (PointInFace function). Returns error status: 0 - in case of success; 1 - <aE> does not have 2d curve on the face <aF>; 2 - the computed point is out of the face.

    Parameters (5)
    • aE
    • aF
    • aP2D
      Mutated in place; read the updated value from this argument after the call.
    • aPx
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • PointNearEdge(aE: TopoDS_Edge, aF: TopoDS_Face, aT: number, aDt2D: number, aP2D: gp_Pnt2d, aPx: gp_Pnt): number

    Compute the point <aPx>, (<aP2D>) that is near to the edge <aE> at parameter <aT> towards to the material of the face <aF>. The value of shifting in 2D is <aDt2D>. No checks on this value will be done. Returns error status: 0 - in case of success; 1 - <aE> does not have 2d curve on the face <aF>.

    Parameters (6)
    • aE
    • aF
    • aT
    • aDt2D
    • aP2D
      Mutated in place; read the updated value from this argument after the call.
    • aPx
      Mutated in place; read the updated value from this argument after the call.
  • PointNearEdge(aE: TopoDS_Edge, aF: TopoDS_Face, aT: number, aP2D: gp_Pnt2d, aPx: gp_Pnt, theContext: IntTools_Context): number

    Computes the point <aPx>, (<aP2D>) that is near to the edge <aE> at parameter <aT> towards to the material of the face <aF>. The value of shifting in 2D is dt2D=BOPTools_AlgoTools3D::MinStepIn2d() If the value of shifting is too big the point will be computed using Hatcher (PointInFace function). Returns error status: 0 - in case of success; 1 - <aE> does not have 2d curve on the face <aF>; 2 - the computed point is out of the face.

    Parameters (6)
    • aE
    • aF
    • aT
    • aP2D
      Mutated in place; read the updated value from this argument after the call.
    • aPx
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • PointNearEdge(aE: TopoDS_Edge, aF: TopoDS_Face, aT: number, aDt2D: number, aP2D: gp_Pnt2d, aPx: gp_Pnt, theContext: IntTools_Context): number

    Compute the point <aPx>, (<aP2D>) that is near to the edge <aE> at parameter <aT> towards to the material of the face <aF>. The value of shifting in 2D is <aDt2D> If the value of shifting is too big the point will be computed using Hatcher (PointInFace function). Returns error status: 0 - in case of success; 1 - <aE> does not have 2d curve on the face <aF>; 2 - the computed point is out of the face.

    Parameters (7)
    • aE
    • aF
    • aT
    • aDt2D
    • aP2D
      Mutated in place; read the updated value from this argument after the call.
    • aPx
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • MinStepIn2d(): number

    Returns simple step value that is used in 2D-computations = 1.e-5.

  • Returns TRUE if the shape <aS> does not contain geometry information (e.g. empty compound).

    Parameters (1)
    • aS
  • Get the edge <aER> from the face <aF> that is the same as the edge <aE>.

    Parameters (3)
    • aE
    • aF
    • aER
      Mutated in place; read the updated value from this argument after the call.
  • PointInFace(theF: TopoDS_Face, theP: gp_Pnt, theP2D: gp_Pnt2d, theContext: IntTools_Context): number

    Computes arbitrary point <theP> inside the face <theF>. <theP2D> - 2D representation of <theP> on the surface of <theF> Returns 0 in case of success.

    Parameters (4)
    • theF
    • theP
      Mutated in place; read the updated value from this argument after the call.
    • theP2D
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • PointInFace(theF: TopoDS_Face, theE: TopoDS_Edge, theT: number, theDt2D: number, theP: gp_Pnt, theP2D: gp_Pnt2d, theContext: IntTools_Context): number

    Computes a point <theP> inside the face <theF> using starting point taken by the parameter <theT> from the 2d curve of the edge <theE> on the face <theF> in the direction perpendicular to the tangent vector of the 2d curve of the edge. The point will be distanced on <theDt2D> from the 2d curve. <theP2D> - 2D representation of <theP> on the surface of <theF> Returns 0 in case of success.

    Parameters (7)
    • theF
    • theE
    • theT
    • theDt2D
    • theP
      Mutated in place; read the updated value from this argument after the call.
    • theP2D
      Mutated in place; read the updated value from this argument after the call.
    • theContext
  • PointInFace(theF: TopoDS_Face, theL: Geom2d_Curve, theP: gp_Pnt, theP2D: gp_Pnt2d, theContext: IntTools_Context, theDt2D: number): number

    Computes a point <theP> inside the face <theF> using the line <theL> so that 2D point <theP2D>, 2D representation of <theP> on the surface of <theF>, lies on that line. Returns 0 in case of success.

    Parameters (6)
    • theF
    • theL
    • theP
      Mutated in place; read the updated value from this argument after the call.
    • theP2D
      Mutated in place; read the updated value from this argument after the call.
    • theContext
    • theDt2D

BOPTools_Set

Constructors(3)

Instance methods(6)