OpenCascade.js
API ReferenceModelingDataTKG2d

Adaptor2d

OCCT package Adaptor2d: Adaptor2d_Curve2d, Adaptor2d_Line2d, Adaptor2d_OffsetCurve.

Adaptor2d_Curve2d

Root class for 2D curves on which geometric algorithms work. An adapted curve is an interface between the services provided by a curve, and those required of the curve by algorithms, which use it. A derived concrete class is provided: Geom2dAdaptor_Curve for a curve from the Geom2d package.
Polynomial coefficients of BSpline curves used for their evaluation are cached for better performance. Therefore these evaluations are not thread-safe and parallel evaluations need to be prevented.

Constructors(1)

Static methods(2)

Instance methods(36)

  • Shallow copy of adaptor.

  • FirstParameter(): number
  • LastParameter(): number
  • If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity .
    The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Trim(First: number, Last: number, Tol: number): Adaptor2d_Curve2d

    Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>.

    Parameters (3)
    • First
    • Last
    • Tol
  • IsClosed(): boolean
  • IsPeriodic(): boolean
  • Period(): number
  • Value(U: number): gp_Pnt2d

    Computes the point of parameter U on the curve.

    Parameters (1)
    • U
  • D0(U: number, P: gp_Pnt2d): void

    Computes the point of parameter U on the curve.

    Parameters (2)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
  • D1(U: number, P: gp_Pnt2d, V: gp_Vec2d): void

    Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

    Parameters (3)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V
      Mutated in place; read the updated value from this argument after the call.
  • D2(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): void

    Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.

    Parameters (4)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
  • D3(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): void

    Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the current interval is not C3.

    Parameters (5)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
    • V3
      Mutated in place; read the updated value from this argument after the call.
  • DN(U: number, N: number): gp_Vec2d

    The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.

    Parameters (2)
    • U
    • N
  • Resolution(R3d: number): number

    Returns the parametric resolution corresponding to the real space resolution <R3d>.

    Parameters (1)
    • R3d
  • Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

  • Degree(): number
  • IsRational(): boolean
  • NbPoles(): number
  • NbKnots(): number
  • NbSamples(): number
  • EvalD0(theU: number): gp_Pnt2d

    Computes the point of parameter U on the curve. Raises an exception on failure.

    Parameters (1)
    • theU
  • EvalD1(theU: number): Geom2d_Curve_ResD1

    Computes the point and first derivative at parameter U. Raises an exception on failure.

    Parameters (1)
    • theU
  • EvalD2(theU: number): Geom2d_Curve_ResD2

    Computes the point and first two derivatives at parameter U. Raises an exception on failure.

    Parameters (1)
    • theU
  • EvalD3(theU: number): Geom2d_Curve_ResD3

    Computes the point and first three derivatives at parameter U. Raises an exception on failure.

    Parameters (1)
    • theU
  • EvalDN(theU: number, theN: number): gp_Vec2d

    Computes the Nth derivative at parameter U. Raises an exception on failure.

    Parameters (2)
    • theU
    • theN

Adaptor2d_Line2d

Use by the TopolTool to trim a surface.

Constructors(2)

Static methods(2)

Instance methods(32)

  • Shallow copy of adaptor.

  • Load(L: gp_Lin2d): void
    Parameters (1)
    • L
  • Load(L: gp_Lin2d, UFirst: number, ULast: number): void
    Parameters (3)
    • L
    • UFirst
    • ULast
  • FirstParameter(): number
  • LastParameter(): number
  • If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity .
    The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Trim(First: number, Last: number, Tol: number): Adaptor2d_Curve2d

    Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>.

    Parameters (3)
    • First
    • Last
    • Tol
  • IsClosed(): boolean
  • IsPeriodic(): boolean
  • Period(): number
  • Value(U: number): gp_Pnt2d

    Computes the point of parameter U on the curve.

    Parameters (1)
    • U
  • D0(U: number, P: gp_Pnt2d): void

    Computes the point of parameter U on the curve.

    Parameters (2)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
  • D1(U: number, P: gp_Pnt2d, V: gp_Vec2d): void

    Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

    Parameters (3)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V
      Mutated in place; read the updated value from this argument after the call.
  • D2(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): void

    Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.

    Parameters (4)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
  • D3(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): void

    Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the current interval is not C3.

    Parameters (5)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
    • V3
      Mutated in place; read the updated value from this argument after the call.
  • DN(U: number, N: number): gp_Vec2d

    The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.

    Parameters (2)
    • U
    • N
  • Resolution(R3d: number): number

    Returns the parametric resolution corresponding to the real space resolution <R3d>.

    Parameters (1)
    • R3d
  • Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

  • Degree(): number
  • IsRational(): boolean
  • NbPoles(): number
  • NbKnots(): number

Adaptor2d_OffsetCurve

Defines an Offset curve (algorithmic 2d curve).

Constructors(4)

Static methods(2)

Instance methods(36)

  • Shallow copy of adaptor.

  • Changes the curve. The Offset is reset to 0.

    Parameters (1)
    • S
  • Load(Offset: number): void

    Changes the Offset on the current Curve.

    Parameters (1)
    • Offset
  • Load(Offset: number, WFirst: number, WLast: number): void

    Changes the Offset Curve on the current Curve.

    Parameters (3)
    • Offset
    • WFirst
    • WLast
  • Offset(): number
  • FirstParameter(): number
  • LastParameter(): number
  • If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity .
    The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Trim(First: number, Last: number, Tol: number): Adaptor2d_Curve2d

    Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>.

    Parameters (3)
    • First
    • Last
    • Tol
  • IsClosed(): boolean
  • IsPeriodic(): boolean
  • Period(): number
  • Value(U: number): gp_Pnt2d

    Computes the point of parameter U on the curve.

    Parameters (1)
    • U
  • D0(U: number, P: gp_Pnt2d): void

    Computes the point of parameter U on the curve.

    Parameters (2)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
  • D1(U: number, P: gp_Pnt2d, V: gp_Vec2d): void

    Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

    Parameters (3)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V
      Mutated in place; read the updated value from this argument after the call.
  • D2(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d): void

    Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.

    Parameters (4)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
  • D3(U: number, P: gp_Pnt2d, V1: gp_Vec2d, V2: gp_Vec2d, V3: gp_Vec2d): void

    Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the current interval is not C3.

    Parameters (5)
    • U
    • P
      Mutated in place; read the updated value from this argument after the call.
    • V1
      Mutated in place; read the updated value from this argument after the call.
    • V2
      Mutated in place; read the updated value from this argument after the call.
    • V3
      Mutated in place; read the updated value from this argument after the call.
  • DN(U: number, N: number): gp_Vec2d

    The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.

    Parameters (2)
    • U
    • N
  • Resolution(R3d: number): number

    Returns the parametric resolution corresponding to the real space resolution <R3d>.

    Parameters (1)
    • R3d
  • Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

  • Degree(): number
  • IsRational(): boolean
  • NbPoles(): number
  • NbKnots(): number
  • NbSamples(): number