OpenCascade.js
API ReferenceModelingAlgorithmsTKGeomAlgo

ApproxInt

OCCT package ApproxInt: ApproxInt_KnotTools, ApproxInt_SvSurfaces.

ApproxInt_KnotTools

This class intended to build knots sequence on discrete set of points for further approximation into bspline curve.
Short description of algorithm: 1) Build discrete curvature on points set. 2) According to special rules build draft knots sequence. 3) Filter draft sequence to build output sequence.
For more details look at: Anshuman Razdan - Knot Placement for B-Spline curve Approximation.

Constructors(1)

Static methods(3)

  • BuildKnots(thePntsXYZ: NCollection_Array1_gp_Pnt, thePntsU1V1: NCollection_Array1_gp_Pnt2d, thePntsU2V2: NCollection_Array1_gp_Pnt2d, thePars: math_Vector, theApproxXYZ: boolean, theApproxU1V1: boolean, theApproxU2V2: boolean, theMinNbPnts: number, theKnots: NCollection_DynamicArray_int): void

    Main function to build optimal knot sequence. At least one set from (thePntsXYZ, thePntsU1V1, thePntsU2V2) should exist.

    Parameters (9)
    • thePntsXYZ
      • Set of 3d points.
    • thePntsU1V1
      • Set of 2d points.
    • thePntsU2V2
      • Set of 2d points.
    • thePars
      • Expected parameters associated with set.
    • theApproxXYZ
      • Flag, existence of 3d set.
    • theApproxU1V1
      • Flag existence of first 2d set.
    • theApproxU2V2
      • Flag existence of second 2d set.
    • theMinNbPnts
      • Minimal number of points per knot interval.
    • theKnots
      • output knots sequence. Mutated in place; read the updated value from this argument after the call.
  • BuildCurvature(theCoords: any, theDim: number, thePars: math_Vector, theCurv: NCollection_Array1_double, theMaxCurv: number): { theMaxCurv: number }

    Builds discrete curvature.

    Parameters (5)
    • theCoords
    • theDim
    • thePars
    • theCurv
      Mutated in place; read the updated value from this argument after the call.
    • theMaxCurv
    Returns

    A result object with fields:

    • theMaxCurv: updated value from the call.
  • DefineParType(theWL: IntPatch_WLine, theFpar: number, theLpar: number, theApproxXYZ: boolean, theApproxU1V1: boolean, theApproxU2V2: boolean): Approx_ParametrizationType

    Defines preferable parametrization type for theWL.

    Parameters (6)
    • theWL
    • theFpar
    • theLpar
    • theApproxXYZ
    • theApproxU1V1
    • theApproxU2V2

ApproxInt_SvSurfaces

This class is root class for classes dedicated to calculate 2d and 3d points and tangents of intersection lines of two surfaces of different types for given u, v parameters of intersection point on two surfaces.
The field myUseSolver is used to manage type of calculation: if myUseSolver = true, input parameters u1, v1, u2, v2 are considered as first approximation of exact intersection point, then coordinates u1, v1, u2, v2 are refined with help of the solver used in intersection algorithm and required values are calculated. if myUseSolver = false, u1, v1, u2, v2 are considered as "exact" intersection points on two surfaces and required values are calculated directly using u1, v1, u2, v2

Instance methods(8)

  • Compute(u1: number, v1: number, u2: number, v2: number, Pt: gp_Pnt, Tg: gp_Vec, Tguv1: gp_Vec2d, Tguv2: gp_Vec2d): { returnValue: boolean; u1: number; v1: number; u2: number; v2: number }

    returns True if Tg,Tguv1 Tguv2 can be computed.

    Parameters (8)
    • u1
    • v1
    • u2
    • v2
    • Pt
      Mutated in place; read the updated value from this argument after the call.
    • Tg
      Mutated in place; read the updated value from this argument after the call.
    • Tguv1
      Mutated in place; read the updated value from this argument after the call.
    • Tguv2
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • u1: updated value from the call.
    • v1: updated value from the call.
    • u2: updated value from the call.
    • v2: updated value from the call.
  • Pnt(u1: number, v1: number, u2: number, v2: number, P: gp_Pnt): void
    Parameters (5)
    • u1
    • v1
    • u2
    • v2
    • P
  • SeekPoint(u1: number, v1: number, u2: number, v2: number, Point: IntSurf_PntOn2S): boolean

    computes point on curve and parameters on the surfaces

    Parameters (5)
    • u1
    • v1
    • u2
    • v2
    • Point
      Mutated in place; read the updated value from this argument after the call.
  • Tangency(u1: number, v1: number, u2: number, v2: number, Tg: gp_Vec): boolean
    Parameters (5)
    • u1
    • v1
    • u2
    • v2
    • Tg
  • TangencyOnSurf1(u1: number, v1: number, u2: number, v2: number, Tg: gp_Vec2d): boolean
    Parameters (5)
    • u1
    • v1
    • u2
    • v2
    • Tg
  • TangencyOnSurf2(u1: number, v1: number, u2: number, v2: number, Tg: gp_Vec2d): boolean
    Parameters (5)
    • u1
    • v1
    • u2
    • v2
    • Tg
  • SetUseSolver(theUseSol: boolean): void
    Parameters (1)
    • theUseSol
  • GetUseSolver(): boolean