OpenCascade.js
API ReferenceModelingDataTKGeomBase

CPnts

OCCT package CPnts: CPnts_AbscissaPoint, CPnts_MyGaussFunction, CPnts_MyRootFunction, CPnts_UniformDeflection.

CPnts_AbscissaPoint

the algorithm computes a point on a curve at a given distance from another point on the curve
We can instantiates with Curve from Adaptor3d, Pnt from gp, Vec from gp
or Curve2d from Adaptor2d, Pnt2d from gp, Vec2d from gp

Constructors(5)

  • constructor(C: Adaptor3d_Curve, Abscissa: number, U0: number, Resolution: number): CPnts_AbscissaPoint

    the algorithm computes a point on a curve <Curve> at the distance <Abscissa> from the point of parameter <U0>. <Resolution> is the error allowed in the computation. The computed point can be outside of the curve 's bounds.

    Parameters (4)
    • C
    • Abscissa
    • U0
    • Resolution
  • constructor(C: Adaptor2d_Curve2d, Abscissa: number, U0: number, Resolution: number): CPnts_AbscissaPoint

    the algorithm computes a point on a curve <Curve> at the distance <Abscissa> from the point of parameter <U0>. <Resolution> is the error allowed in the computation. The computed point can be outside of the curve 's bounds.

    Parameters (4)
    • C
    • Abscissa
    • U0
    • Resolution
  • constructor(C: Adaptor3d_Curve, Abscissa: number, U0: number, Ui: number, Resolution: number): CPnts_AbscissaPoint

    the algorithm computes a point on a curve <Curve> at the distance <Abscissa> from the point of parameter <U0>. <Ui> is the starting value used in the iterative process which find the solution, it must be closed to the final solution <Resolution> is the error allowed in the computation. The computed point can be outside of the curve 's bounds.

    Parameters (5)
    • C
    • Abscissa
    • U0
    • Ui
    • Resolution
  • constructor(C: Adaptor2d_Curve2d, Abscissa: number, U0: number, Ui: number, Resolution: number): CPnts_AbscissaPoint

    the algorithm computes a point on a curve <Curve> at the distance <Abscissa> from the point of parameter <U0>. <Ui> is the starting value used in the iterative process which find the solution, it must be closed to the final solution <Resolution> is the error allowed in the computation. The computed point can be outside of the curve 's bounds.

    Parameters (5)
    • C
    • Abscissa
    • U0
    • Ui
    • Resolution

Static methods(8)

  • Computes the length of the Curve .

    Parameters (1)
    • C
  • Computes the length of the Curve .

    Parameters (1)
    • C
  • Length(C: Adaptor3d_Curve, Tol: number): number

    Computes the length of the Curve with the given tolerance.

    Parameters (2)
    • C
    • Tol
  • Length(C: Adaptor2d_Curve2d, Tol: number): number

    Computes the length of the Curve with the given tolerance.

    Parameters (2)
    • C
    • Tol
  • Length(C: Adaptor3d_Curve, U1: number, U2: number): number

    Computes the length of the Curve between <U1> and <U2>.

    Parameters (3)
    • C
    • U1
    • U2
  • Length(C: Adaptor2d_Curve2d, U1: number, U2: number): number

    Computes the length of the Curve between <U1> and <U2>.

    Parameters (3)
    • C
    • U1
    • U2
  • Length(C: Adaptor3d_Curve, U1: number, U2: number, Tol: number): number

    Computes the length of the Curve between <U1> and <U2> with the given tolerance.

    Parameters (4)
    • C
    • U1
    • U2
    • Tol
  • Length(C: Adaptor2d_Curve2d, U1: number, U2: number, Tol: number): number

    Computes the length of the Curve between <U1> and <U2> with the given tolerance. creation of a indefinite AbscissaPoint.

    Parameters (4)
    • C
    • U1
    • U2
    • Tol

Instance methods(14)

  • Initializes the resolution function with .

    Parameters (1)
    • C
  • Initializes the resolution function with .

    Parameters (1)
    • C
  • Init(C: Adaptor3d_Curve, Tol: number): void

    Initializes the resolution function with .

    Parameters (2)
    • C
    • Tol
  • Init(C: Adaptor2d_Curve2d, Tol: number): void

    Initializes the resolution function with .

    Parameters (2)
    • C
    • Tol
  • Init(C: Adaptor3d_Curve, U1: number, U2: number): void

    Initializes the resolution function with between U1 and U2.

    Parameters (3)
    • C
    • U1
    • U2
  • Init(C: Adaptor2d_Curve2d, U1: number, U2: number): void

    Initializes the resolution function with between U1 and U2.

    Parameters (3)
    • C
    • U1
    • U2
  • Init(C: Adaptor3d_Curve, U1: number, U2: number, Tol: number): void

    Initializes the resolution function with between U1 and U2.

    Parameters (4)
    • C
    • U1
    • U2
    • Tol
  • Init(C: Adaptor2d_Curve2d, U1: number, U2: number, Tol: number): void

    Initializes the resolution function with between U1 and U2.

    Parameters (4)
    • C
    • U1
    • U2
    • Tol
  • Perform(Abscissa: number, U0: number, Resolution: number): void

    Computes the point at the distance <Abscissa> of the curve. U0 is the parameter of the point from which the distance is measured.

    Parameters (3)
    • Abscissa
    • U0
    • Resolution
  • Perform(Abscissa: number, U0: number, Ui: number, Resolution: number): void

    Computes the point at the distance <Abscissa> of the curve. U0 is the parameter of the point from which the distance is measured and Ui is the starting value for the iterative process (should be close to the final solution).

    Parameters (4)
    • Abscissa
    • U0
    • Ui
    • Resolution
  • AdvPerform(Abscissa: number, U0: number, Ui: number, Resolution: number): void

    Computes the point at the distance <Abscissa> of the curve; performs more appropriate tolerance management; to use this method in right way it is necessary to call empty constructor. then call method Init with Tolerance = Resolution, then call AdvPermorm. U0 is the parameter of the point from which the distance is measured and Ui is the starting value for the iterative process (should be close to the final solution).

    Parameters (4)
    • Abscissa
    • U0
    • Ui
    • Resolution
  • IsDone(): boolean

    True if the computation was successful, False otherwise.

  • Parameter(): number

    Returns the parameter of the solution.

  • SetParameter(P: number): void

    Enforce the solution, used by GCPnts.

    Parameters (1)
    • P

CPnts_MyGaussFunction

for implementation, compute values for Gauss

Constructors(1)

Instance methods(1)

  • Value(X: number, F: number): { returnValue: boolean; F: number }

    Computes the value of the function <F> for a given value of variable <X>. returns True if the computation was done successfully, False otherwise.

    Parameters (2)
    • X
    • F
    Returns

    A result object with fields:

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

CPnts_MyRootFunction

Implements a function for the Newton algorithm to find the solution of Integral(F) = L (compute Length and Derivative of the curve for Newton).

Constructors(1)

Instance methods(5)

  • Init(X0: number, L: number): void

    We want to solve Integral(X0,X,F(X,D)) = L.

    Parameters (2)
    • X0
    • L
  • Init(X0: number, L: number, Tol: number): void

    F is a pointer on a function D is a client data Order is the order of integration to use.

    Parameters (3)
    • X0
    • L
    • Tol
  • Value(X: number, F: number): { returnValue: boolean; F: number }

    This is Integral(X0,X,F(X,D)) - L.

    Parameters (2)
    • X
    • F
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • F: updated value from the call.
  • Derivative(X: number, D: number): { returnValue: boolean; D: number }

    This is F(X,D).

    Parameters (2)
    • X
    • D
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • D: updated value from the call.
  • Values(X: number, F: number, D: number): { returnValue: boolean; F: number; D: number }

    Computes the value <F> and the derivative <D> of the function for the variable <X>. Returns True if the calculation were successfully done, False otherwise.

    Parameters (3)
    • X
    • F
    • D
    Returns

    A result object with fields:

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

CPnts_UniformDeflection

This class defines an algorithm to create a set of points (with a given chordal deviation) at the positions of constant deflection of a given parametrized curve or a trimmed circle. The continuity of the curve must be at least C2.
the usage of the is the following.
class myUniformDFeflection instantiates UniformDeflection(Curve, Tool);
Curve C; // Curve inherits from Curve or Curve2d from Adaptor2d myUniformDeflection Iter1; DefPntOfmyUniformDeflection P;
for(Iter1.Initialize(C, Deflection, EPSILON, True); Iter1.More(); Iter1.Next()) { P = Iter1.Value(); ... make something with P } if(!Iter1.IsAllDone()) { ... something wrong happened }

Constructors(5)

  • creation of a indefinite UniformDeflection

  • constructor(C: Adaptor3d_Curve, Deflection: number, Resolution: number, WithControl: boolean): CPnts_UniformDeflection

    Computes a uniform deflection distribution of points on the curve . <Deflection> defines the constant deflection value. The algorithm computes the number of points and the points. The curve must be at least C2 else the computation can fail. If just some parts of the curve is C2 it is better to give the parameters bounds and to use the below constructor . if <WithControl> is True, the algorithm controls the estimate deflection when the curve is singular at the point P(u),the algorithm computes the next point as P(u + std::max(CurrentStep,std::abs(LastParameter-FirstParameter))) if the singularity is at the first point ,the next point calculated is the P(LastParameter).

    Parameters (4)
    • C
    • Deflection
    • Resolution
    • WithControl
  • constructor(C: Adaptor2d_Curve2d, Deflection: number, Resolution: number, WithControl: boolean): CPnts_UniformDeflection

    As above with 2d curve.

    Parameters (4)
    • C
    • Deflection
    • Resolution
    • WithControl
  • constructor(C: Adaptor3d_Curve, Deflection: number, U1: number, U2: number, Resolution: number, WithControl: boolean): CPnts_UniformDeflection

    Computes an uniform deflection distribution of points on a part of the curve . Deflection defines the step between the points. <U1> and <U2> define the distribution span. <U1> and <U2> must be in the parametric range of the curve.

    Parameters (6)
    • C
    • Deflection
    • U1
    • U2
    • Resolution
    • WithControl
  • constructor(C: Adaptor2d_Curve2d, Deflection: number, U1: number, U2: number, Resolution: number, WithControl: boolean): CPnts_UniformDeflection

    As above with 2d curve.

    Parameters (6)
    • C
    • Deflection
    • U1
    • U2
    • Resolution
    • WithControl

Instance methods(9)

  • Initialize(C: Adaptor3d_Curve, Deflection: number, Resolution: number, WithControl: boolean): void

    Initialize the algorithms with , <Deflection>, <UStep>, <Resolution> and <WithControl>.

    Parameters (4)
    • C
    • Deflection
    • Resolution
    • WithControl
  • Initialize(C: Adaptor2d_Curve2d, Deflection: number, Resolution: number, WithControl: boolean): void

    Initialize the algorithms with , <Deflection>, <UStep>, <Resolution> and <WithControl>.

    Parameters (4)
    • C
    • Deflection
    • Resolution
    • WithControl
  • Initialize(C: Adaptor3d_Curve, Deflection: number, U1: number, U2: number, Resolution: number, WithControl: boolean): void

    Initialize the algorithms with , <Deflection>, <UStep>, <U1>, <U2> and <WithControl>.

    Parameters (6)
    • C
    • Deflection
    • U1
    • U2
    • Resolution
    • WithControl
  • Initialize(C: Adaptor2d_Curve2d, Deflection: number, U1: number, U2: number, Resolution: number, WithControl: boolean): void

    Initialize the algorithms with , <Deflection>, <UStep>, <U1>, <U2> and <WithControl>.

    Parameters (6)
    • C
    • Deflection
    • U1
    • U2
    • Resolution
    • WithControl
  • IsAllDone(): boolean

    To know if all the calculus were done successfully (ie all the points have been computed). The calculus can fail if the Curve is not C1 in the considered domain. Returns True if the calculus was successful.

  • Next(): void

    go to the next Point.

  • More(): boolean

    returns True if it exists a next Point.

  • Value(): number

    return the computed parameter

  • return the computed parameter