OpenCascade.js
API ReferenceModelingDataTKG2d

Geom2dEval

OCCT package Geom2dEval: Geom2dEval_AHTBezierCurve, Geom2dEval_ArchimedeanSpiralCurve, Geom2dEval_CircleInvoluteCurve, Geom2dEval_LogarithmicSpiralCurve,…

Geom2dEval_AHTBezierCurve

2D Algebraic-Hyperbolic-Trigonometric Bezier curve. Uses a mixed basis: {1, t, ..., t^k, sinh(alphat), cosh(alphat), sin(betat), cos(betat)}. The number of basis functions = algDegree + 1 + 2*(alpha>0) + 2*(beta>0) must equal NbPoles. Parameter range: [0, 1].

Constructors(2)

  • constructor(thePoles: NCollection_Array1_gp_Pnt2d, theAlgDegree: number, theAlpha: number, theBeta: number): Geom2dEval_AHTBezierCurve

    Non-rational constructor.

    Parameters (4)
    • thePoles
      control points
    • theAlgDegree
      algebraic polynomial degree (>= 0)
    • theAlpha
      hyperbolic frequency (>= 0, 0 = no hyperbolic terms)
    • theBeta
      trigonometric frequency (>= 0, 0 = no trig terms)
  • constructor(thePoles: NCollection_Array1_gp_Pnt2d, theWeights: NCollection_Array1_double, theAlgDegree: number, theAlpha: number, theBeta: number): Geom2dEval_AHTBezierCurve

    Rational constructor.

    Parameters (5)
    • thePoles
      control points
    • theWeights
      weights for each pole (must be > 0)
    • theAlgDegree
      algebraic polynomial degree (>= 0)
    • theAlpha
      hyperbolic frequency (>= 0, 0 = no hyperbolic terms)
    • theBeta
      trigonometric frequency (>= 0, 0 = no trig terms)

Static methods(2)

Instance methods(25)

  • Returns the array of poles.

  • Returns the array of weights.

  • AlgDegree(): number

    Returns the algebraic polynomial degree.

  • Alpha(): number

    Returns the hyperbolic frequency parameter.

  • Beta(): number

    Returns the trigonometric frequency parameter.

  • NbPoles(): number

    Returns the number of poles.

  • IsRational(): boolean

    Returns true if the curve is rational (has explicit weights).

  • Returns the start point of the curve (at parameter 0).

  • Returns the end point of the curve (at parameter 1).

  • Reverse(): void

    Reversal is not supported for this eval curve.

  • ReversedParameter(U: number): number

    Reversal is not supported for this eval curve.

    Parameters (1)
    • U
  • FirstParameter(): number

    Returns the value of the first parameter: 0.0.

  • LastParameter(): number

    Returns the value of the last parameter: 1.0.

  • IsClosed(): boolean

    Returns true if the curve is closed.

  • IsPeriodic(): boolean

    Returns false. The AHT-Bezier curve is not periodic.

  • Returns GeomAbs_CN.

  • IsCN(N: number): boolean

    Returns true for any N. The AHT-Bezier curve is infinitely differentiable.

    Parameters (1)
    • N
  • EvalD0(U: number): gp_Pnt2d

    Computes the point at parameter U.

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

    Computes the point and first derivative at parameter U.

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

    Computes the point and first two derivatives at parameter U.

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

    Computes the point and first three derivatives at parameter U.

    Parameters (1)
    • U
  • EvalDN(U: number, N: number): gp_Vec2d

    Computes the N-th derivative at parameter U.

    Parameters (2)
    • U
      the parameter value
    • N
      the derivative order (must be >= 1)
    Returns

    the N-th derivative vector

  • Transformation is not supported for this eval geometry.

    Parameters (1)
    • T
  • Creates a new object which is a copy of this curve.

Geom2dEval_ArchimedeanSpiralCurve

Describes a 2D Archimedean spiral curve. The polar equation is r = a + b*t, where a is the initial radius and b is the growth rate per radian.
The parametric equation is:

C(t)=O+(a+b*t)*cos(t)*XDir+(a+b*t)*sin(t)*YDir

where:

  • O, XDir are from the local coordinate system,
  • YDir is the perpendicular to XDir,
  • a is the initial radius (>= 0),
  • b is the growth rate per radian (> 0).
    The parameter range is [0, +inf). The curve is neither periodic nor closed.

Constructors(1)

  • constructor(thePosition: gp_Ax2d, theInitialRadius: number, theGrowthRate: number): Geom2dEval_ArchimedeanSpiralCurve

    Creates an Archimedean spiral.

    Parameters (3)
    • thePosition
      the local coordinate system
    • theInitialRadius
      the initial radius (must be >= 0)
    • theGrowthRate
      the growth rate per radian (must be > 0)

Static methods(2)

Instance methods(19)

  • Returns the local coordinate system.

  • InitialRadius(): number

    Returns the initial radius.

  • GrowthRate(): number

    Returns the growth rate per radian.

  • Reverse(): void

    Reversal is not supported for this eval curve.

  • ReversedParameter(U: number): number

    Reversal is not supported for this eval curve.

    Parameters (1)
    • U
  • FirstParameter(): number

    Returns 0.

  • LastParameter(): number

    Returns Precision::Infinite().

  • IsClosed(): boolean

    Returns false.

  • IsPeriodic(): boolean

    Returns false.

  • Returns GeomAbs_CN.

  • IsCN(N: number): boolean

    Returns true for any N >= 0.

    Parameters (1)
    • N
  • EvalD0(U: number): gp_Pnt2d

    Computes the point at parameter U.

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

    Computes the point and first derivative at parameter U.

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

    Computes the point and first two derivatives at parameter U.

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

    Computes the point and first three derivatives at parameter U.

    Parameters (1)
    • U
  • EvalDN(U: number, N: number): gp_Vec2d

    Computes the N-th derivative at parameter U.

    Parameters (2)
    • U
    • N
  • Transformation is not supported for this eval geometry.

    Parameters (1)
    • T
  • Creates a new object which is a copy of this curve.

Geom2dEval_CircleInvoluteCurve

Describes a 2D involute of a circle. Critical for gear tooth profiles.
The parametric equation is:

C(t)=O+R*(cos(t)+t*sin(t))*XDir+R*(sin(t)-t*cos(t))*YDir

where:

  • O, XDir are from the local coordinate system,
  • YDir is the perpendicular to XDir,
  • R is the base circle radius (> 0).
    The parameter range is [0, +inf). At t=0, the curve starts on the base circle. D1(0) = (0,0) (cusp). |D1(t)| = R*t (speed linear in parameter).

Constructors(1)

Static methods(2)

Instance methods(18)

  • Returns the local coordinate system.

  • Radius(): number

    Returns the base circle radius.

  • Reverse(): void

    Reversal is not supported for this eval curve.

  • ReversedParameter(U: number): number

    Reversal is not supported for this eval curve.

    Parameters (1)
    • U
  • FirstParameter(): number

    Returns 0.

  • LastParameter(): number

    Returns Precision::Infinite().

  • IsClosed(): boolean

    Returns false.

  • IsPeriodic(): boolean

    Returns false.

  • Returns GeomAbs_CN.

  • IsCN(N: number): boolean

    Returns true for any N >= 0.

    Parameters (1)
    • N
  • EvalD0(U: number): gp_Pnt2d

    Computes the point at parameter U.

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

    Computes the point and first derivative at parameter U.

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

    Computes the point and first two derivatives at parameter U.

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

    Computes the point and first three derivatives at parameter U.

    Parameters (1)
    • U
  • EvalDN(U: number, N: number): gp_Vec2d

    Computes the N-th derivative at parameter U.

    Parameters (2)
    • U
    • N
  • Transformation is not supported for this eval geometry.

    Parameters (1)
    • T
  • Creates a new object which is a copy of this curve.

Geom2dEval_LogarithmicSpiralCurve

Describes a 2D logarithmic (equiangular) spiral curve. The polar equation is r = aexp(bt).
The parametric equation is:

C(t)=O+a*exp(b*t)*cos(t)*XDir+a*exp(b*t)*sin(t)*YDir

where:

  • O, XDir are from the local coordinate system,
  • YDir is the perpendicular to XDir,
  • a is the scale factor (> 0),
  • b is the growth exponent (> 0).
    The parameter range is (-inf, +inf). The angle between tangent and radial direction is constant = atan(1/b).

Constructors(1)

  • constructor(thePosition: gp_Ax2d, theScale: number, theGrowthExponent: number): Geom2dEval_LogarithmicSpiralCurve

    Creates a logarithmic spiral.

    Parameters (3)
    • thePosition
      the local coordinate system
    • theScale
      the scale factor (must be > 0)
    • theGrowthExponent
      the growth exponent (must be > 0)

Static methods(2)

Instance methods(20)

  • Returns the local coordinate system.

  • Scale(): number

    Returns the scale factor.

  • Scale(P: gp_Pnt2d, S: number): void

    Returns the scale factor.

    Parameters (2)
    • P
    • S
  • GrowthExponent(): number

    Returns the growth exponent.

  • Reverse(): void

    Reversal is not supported for this eval curve.

  • ReversedParameter(U: number): number

    Reversal is not supported for this eval curve.

    Parameters (1)
    • U
  • FirstParameter(): number

    Returns -Precision::Infinite().

  • LastParameter(): number

    Returns Precision::Infinite().

  • IsClosed(): boolean

    Returns false.

  • IsPeriodic(): boolean

    Returns false.

  • Returns GeomAbs_CN.

  • IsCN(N: number): boolean

    Returns true for any N >= 0.

    Parameters (1)
    • N
  • EvalD0(U: number): gp_Pnt2d

    Computes the point at parameter U.

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

    Computes the point and first derivative at parameter U.

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

    Computes the point and first two derivatives at parameter U.

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

    Computes the point and first three derivatives at parameter U.

    Parameters (1)
    • U
  • EvalDN(U: number, N: number): gp_Vec2d

    Computes the N-th derivative at parameter U.

    Parameters (2)
    • U
    • N
  • Transformation is not supported for this eval geometry.

    Parameters (1)
    • T
  • Creates a new object which is a copy of this curve.

Geom2dEval_SineWaveCurve

Describes a 2D sine wave curve.
The parametric equation is:

C(t)=O+t*XDir+A*sin(omega*t+phi)*YDir

where:

  • O, XDir, YDir are from the local coordinate system (gp_Ax2d gives XDir, YDir is the perpendicular),
  • A is the amplitude (> 0),
  • omega is the angular frequency (> 0),
  • phi is the phase shift.
    The parameter range is (-inf, +inf). The curve is not periodic.

Constructors(1)

  • constructor(thePosition: gp_Ax2d, theAmplitude: number, theOmega: number, thePhase?: number): Geom2dEval_SineWaveCurve

    Creates a 2D sine wave curve.

    Parameters (4)
    • thePosition
      the local coordinate system
    • theAmplitude
      the wave amplitude (must be > 0)
    • theOmega
      the angular frequency (must be > 0)
    • thePhase
      the phase shift (default 0)

Static methods(2)

Instance methods(20)

  • Returns the local coordinate system.

  • Amplitude(): number

    Returns the amplitude.

  • Omega(): number

    Returns the angular frequency.

  • Phase(): number

    Returns the phase shift.

  • Reverse(): void

    Reversal is not supported for this eval curve.

  • ReversedParameter(U: number): number

    Reversal is not supported for this eval curve.

    Parameters (1)
    • U
  • FirstParameter(): number

    Returns -Precision::Infinite().

  • LastParameter(): number

    Returns Precision::Infinite().

  • IsClosed(): boolean

    Returns false.

  • IsPeriodic(): boolean

    Returns false.

  • Returns GeomAbs_CN.

  • IsCN(N: number): boolean

    Returns true for any N >= 0.

    Parameters (1)
    • N
  • EvalD0(U: number): gp_Pnt2d

    Computes the point at parameter U.

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

    Computes the point and first derivative at parameter U.

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

    Computes the point and first two derivatives at parameter U.

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

    Computes the point and first three derivatives at parameter U.

    Parameters (1)
    • U
  • EvalDN(U: number, N: number): gp_Vec2d

    Computes the N-th derivative at parameter U.

    Parameters (2)
    • U
    • N
  • Transformation is not supported for this eval geometry.

    Parameters (1)
    • T
  • Creates a new object which is a copy of this curve.

Geom2dEval_TBezierCurve

2D Trigonometric Bezier curve. Uses a trigonometric Bernstein-like basis over the space {1, sin(alphat), cos(alphat), ..., sin(nalphat), cos(nalphat)}.
The parameter domain is [0, Pi/alpha]. The number of control points is 2*n + 1 for order n.
The alpha parameter controls the frequency of the trigonometric basis. A T-Bezier curve of order n with poles P_0, P_1, ..., P_{2n} is:

C(t)=P_0*T_0(t)+P_1*T_1(t)+...+P_{2n}*T_{2n}(t)

where:

  • T_0(t) = 1
  • T_{2k-1}(t) = sin(k * alpha * t), for k = 1..n
  • T_{2k}(t) = cos(k * alpha * t), for k = 1..n
    For rational curves, each pole is weighted:
C(t)=sum(w_i*P_i*T_i(t))/sum(w_i*T_i(t))

Constructors(2)

Static methods(2)

Instance methods(24)

  • Returns the poles array.

  • Returns the weights array (empty if non-rational).

  • Alpha(): number

    Returns the frequency parameter alpha.

  • NbPoles(): number

    Returns the number of poles.

  • Order(): number

    Returns the trigonometric order n (NbPoles = 2*n + 1).

  • IsRational(): boolean

    Returns true if the curve is rational.

  • Returns the start point C(0).

  • Returns the end point C(Pi/alpha).

  • Reverse(): void

    Reversal is not supported for this eval curve.

  • ReversedParameter(U: number): number

    Reversal is not supported for this eval curve.

    Parameters (1)
    • U
  • FirstParameter(): number

    Returns the first parameter value: 0.0.

  • LastParameter(): number

    Returns the last parameter value: Pi/alpha.

  • IsClosed(): boolean

    Returns true if StartPoint and EndPoint coincide.

  • IsPeriodic(): boolean

    Returns false. T-Bezier curves are not periodic.

  • Returns GeomAbs_CN. T-Bezier curves are infinitely differentiable.

  • IsCN(N: number): boolean

    Returns true for all N. T-Bezier curves are infinitely differentiable.

    Parameters (1)
    • N
  • EvalD0(U: number): gp_Pnt2d

    Computes the point C(U).

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

    Computes the point and first derivative at U.

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

    Computes the point and first two derivatives at U.

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

    Computes the point and first three derivatives at U.

    Parameters (1)
    • U
  • EvalDN(U: number, N: number): gp_Vec2d

    Computes the N-th derivative at U.

    Parameters (2)
    • U
      parameter value
    • N
      derivative order (must be >= 1)
    Returns

    the N-th derivative vector

  • Transformation is not supported for this eval geometry.

    Parameters (1)
    • T
  • Creates a new object which is a copy of this T-Bezier curve.