OpenCascade.js
API ReferenceFoundationClassesTKMath

Convert

OCCT package Convert: Convert_CircleToBSplineCurve, Convert_CompBezierCurves2dToBSplineCurve2d, Convert_CompBezierCurvesToBSplineCurve,…

Convert_CircleToBSplineCurve

This algorithm converts a circle into a rational B-spline curve. The circle is a Circ2d from package gp and its parametrization is : P (U) = Loc + R * (std::cos(U) * Xdir + std::sin(U) * YDir) where Loc is the center of the circle Xdir and Ydir are the normalized directions of the local cartesian coordinate system of the circle. The parametrization range for the circle is U [0, 2Pi].
Warnings : The parametrization range for the B-spline curve is not [0, 2Pi].
KeyWords : Convert, Circle, BSplineCurve, 2D .

Constructors(2)

Convert_CompBezierCurves2dToBSplineCurve2d

Converts a list of connecting Bezier Curves 2d to a BSplineCurve 2d. if possible, the continuity of the BSpline will be increased to more than C0.

Constructors(1)

  • Constructs a framework for converting a sequence of adjacent non-rational Bezier curves into a BSpline curve.

    Parameters (1)
    • theAngularTolerance
      angular tolerance in radians for checking tangent parallelism at junction points

Convert_CompBezierCurvesToBSplineCurve

An algorithm to convert a sequence of adjacent non-rational Bezier curves into a BSpline curve. A CompBezierCurvesToBSplineCurve object provides a framework for:

  • defining the sequence of adjacent non-rational Bezier curves to be converted into a BSpline curve,
  • implementing the computation algorithm, and
  • consulting the results. Warning Do not attempt to convert rational Bezier curves using this type of algorithm.

Constructors(1)

  • Constructs a framework for converting a sequence of adjacent non-rational Bezier curves into a BSpline curve.

    Parameters (1)
    • theAngularTolerance
      angular tolerance in radians for checking tangent parallelism at junction points

Convert_CompPolynomialToPoles

Convert a serie of Polynomial N-Dimensional Curves that are have continuity CM to an N-Dimensional Bspline Curve that has continuity CM. (to convert an function (curve) polynomial by span in a BSpline) This class uses the following arguments : NumCurves : the number of Polynomial Curves Continuity: the requested continuity for the n-dimensional Spline Dimension : the dimension of the Spline MaxDegree : maximum allowed degree for each composite polynomial segment.
NumCoeffPerCurve : the number of coefficient per segments = degree - 1 Coefficients : the coefficients organized in the following way [1..<myNumPolynomials>][1..myMaxDegree +1][1..myDimension] that is : index [n,d,i] is at slot (n-1) * (myMaxDegree + 1) * myDimension + (d-1) * myDimension + i PolynomialIntervals : nth polynomial represents a polynomial between myPolynomialIntervals->Value(n,0) and myPolynomialIntervals->Value(n,1) TrueIntervals : the nth polynomial has to be mapped linearly to be defined on the following interval : myTrueIntervals->Value(n) and myTrueIntervals->Value(n+1) so that it adequately represents the function with the required continuity.

Constructors(3)

Instance methods(13)

  • NbPoles(): number

    Returns the number of poles of the n-dimensional BSpline.

  • Returns the poles of the n-dimensional BSpline in the following format: [1..NumPoles][1..Dimension].

  • Returns the poles of the n-dimensional BSpline in the following format: [1..NumPoles][1..Dimension].

  • Poles_2(): { thePoles: NCollection_HArray2_double; [Symbol.dispose](): void }

    Returns the poles of the n-dimensional BSpline via output parameter.

    Deprecated
    Returns

    A result object with fields:

    • thePoles: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Degree(): number

    Returns the degree of the n-dimensional BSpline.

  • NbKnots(): number

    Returns the number of knots of the n-dimensional BSpline.

  • Returns the knots of the n-dimensional BSpline.

  • Returns the knots of the n-dimensional BSpline.

  • Knots_2(): { theKnots: NCollection_HArray1_double; [Symbol.dispose](): void }

    Returns the knots of the n-dimensional BSpline via output parameter.

    Deprecated
    Returns

    A result object with fields:

    • theKnots: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Returns the multiplicities of the knots in the BSpline.

  • Returns the multiplicities of the knots in the BSpline.

  • Multiplicities_2(): { theMults: NCollection_HArray1_int; [Symbol.dispose](): void }

    Returns the multiplicities of the knots via output parameter.

    Deprecated
    Returns

    A result object with fields:

    • theMults: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • IsDone(): boolean

    Returns true if the conversion was successful.

Convert_ConeToBSplineSurface

This algorithm converts a bounded Cone into a rational B-spline surface. The cone a Cone from package gp. Its parametrization is: P (U, V) = Loc + V * Zdir + (R + V*Tan(Ang)) * (std::cos(U)*Xdir + std::sin(U)*Ydir) where Loc is the location point of the cone, Xdir, Ydir and Zdir are the normalized directions of the local cartesian coordinate system of the cone (Zdir is the direction of the Cone's axis), Ang is the cone semi-angle. The U parametrization range is [0, 2PI]. KeyWords : Convert, Cone, BSplineSurface.

Constructors(2)

  • constructor(C: gp_Cone, V1: number, V2: number): Convert_ConeToBSplineSurface

    The equivalent B-spline surface as the same orientation as the Cone in the U and V parametric directions.
    Raised if V1 = V2.

    Parameters (3)
    • C
    • V1
    • V2
  • constructor(C: gp_Cone, U1: number, U2: number, V1: number, V2: number): Convert_ConeToBSplineSurface

    The equivalent B-spline surface as the same orientation as the Cone in the U and V parametric directions.
    Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2.

    Parameters (5)
    • C
    • U1
    • U2
    • V1
    • V2

Convert_ConicToBSplineCurve

Root class for algorithms which convert a conic curve into a BSpline curve (CircleToBSplineCurve, EllipseToBSplineCurve, HyperbolaToBSplineCurve, ParabolaToBSplineCurve). These algorithms all work on 2D curves from the gp package and compute all the data needed to construct a BSpline curve equivalent to the conic curve. This data consists of:

  • the degree of the curve,
  • the periodic characteristics of the curve,
  • a poles table with associated weights,
  • a knots table with associated multiplicities. The abstract class ConicToBSplineCurve provides a framework for storing and consulting this computed data.

Instance methods(14)

  • Degree(): number

    Returns the degree of the BSpline curve whose data is computed in this framework.

  • NbPoles(): number

    Returns the number of poles of the BSpline curve whose data is computed in this framework.

  • NbKnots(): number

    Returns the number of knots of the BSpline curve whose data is computed in this framework.

  • IsPeriodic(): boolean

    Returns true if the BSpline curve whose data is computed in this framework is periodic.

  • Pole(theIndex: number): gp_Pnt2d

    Returns the pole of index Index to the poles table of the BSpline curve whose data is computed in this framework.

    Deprecated
    Parameters (1)
    • theIndex
      pole index (1-based)
    Returns

    pole at the given index

  • Weight(theIndex: number): number

    Returns the weight of the pole of index Index to the poles table of the BSpline curve whose data is computed in this framework.

    Deprecated
    Parameters (1)
    • theIndex
      weight index (1-based)
    Returns

    weight at the given index

  • Knot(theIndex: number): number

    Returns the knot of index Index to the knots table of the BSpline curve whose data is computed in this framework.

    Deprecated
    Parameters (1)
    • theIndex
      knot index (1-based)
    Returns

    knot at the given index

  • Multiplicity(theIndex: number): number

    Returns the multiplicity of the knot of index Index to the knots table of the BSpline curve whose data is computed in this framework.

    Deprecated
    Parameters (1)
    • theIndex
      multiplicity index (1-based)
    Returns

    multiplicity at the given index

  • Returns the poles of the BSpline curve.

  • Returns the weights of the BSpline curve.

  • Returns the knots of the BSpline curve.

  • Returns the multiplicities of the BSpline curve.

  • BuildCosAndSin(theParametrisation: Convert_ParameterisationType, theDegree: number): { theCosNumerator: NCollection_HArray1_double; theSinNumerator: NCollection_HArray1_double; theDenominator: NCollection_HArray1_double; theDegree: number; theKnots: NCollection_HArray1_double; theMults: NCollection_HArray1_int; [Symbol.dispose](): void }

    Legacy API returning handle arrays for compatibility.

    Deprecated
    Parameters (2)
    • theParametrisation
    • theDegree
    Returns

    A result object with fields:

    • theCosNumerator: owned by the returned envelope.
    • theSinNumerator: owned by the returned envelope.
    • theDenominator: owned by the returned envelope.
    • theDegree: updated value from the call.
    • theKnots: owned by the returned envelope.
    • theMults: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • BuildCosAndSin(theParametrisation: Convert_ParameterisationType, theUFirst: number, theULast: number, theDegree: number): { theCosNumerator: NCollection_HArray1_double; theSinNumerator: NCollection_HArray1_double; theDenominator: NCollection_HArray1_double; theDegree: number; theKnots: NCollection_HArray1_double; theMults: NCollection_HArray1_int; [Symbol.dispose](): void }

    Legacy API returning handle arrays for compatibility.

    Deprecated
    Parameters (4)
    • theParametrisation
    • theUFirst
    • theULast
    • theDegree
    Returns

    A result object with fields:

    • theCosNumerator: owned by the returned envelope.
    • theSinNumerator: owned by the returned envelope.
    • theDenominator: owned by the returned envelope.
    • theDegree: updated value from the call.
    • theKnots: owned by the returned envelope.
    • theMults: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.

Convert_CylinderToBSplineSurface

This algorithm converts a bounded cylinder into a rational B-spline surface. The cylinder is a Cylinder from package gp. The parametrization of the cylinder is: P (U, V) = Loc + V * Zdir + Radius * (Xdirstd::cos(U) + YdirSin(U)) where Loc is the location point of the cylinder, Xdir, Ydir and Zdir are the normalized directions of the local cartesian coordinate system of the cylinder (Zdir is the direction of the cylinder's axis). The U parametrization range is U [0, 2PI]. KeyWords : Convert, Cylinder, BSplineSurface.

Constructors(2)

Convert_ElementarySurfaceToBSplineSurface

Root class for algorithms which convert an elementary surface (cylinder, cone, sphere or torus) into a BSpline surface. These algorithms all work on elementary surfaces from the gp package and compute all the data needed to construct a BSpline surface equivalent to the cylinder, cone, sphere or torus.

Instance methods(20)

  • UDegree(): number

    Returns the degree in the U parametric direction.

  • VDegree(): number

    Returns the degree in the V parametric direction.

  • NbUPoles(): number

    Returns the number of poles in the U parametric direction.

  • NbVPoles(): number

    Returns the number of poles in the V parametric direction.

  • NbUKnots(): number

    Returns the number of knots in the U parametric direction.

  • NbVKnots(): number

    Returns the number of knots in the V parametric direction.

  • IsUPeriodic(): boolean

    Returns true if the surface is periodic in the U parametric direction.

  • IsVPeriodic(): boolean

    Returns true if the surface is periodic in the V parametric direction.

  • Pole(UIndex: number, VIndex: number): gp_Pnt

    Returns the pole of index (UIndex, VIndex).

    Deprecated
    Parameters (2)
    • UIndex
    • VIndex
  • Weight(UIndex: number, VIndex: number): number

    Returns the weight of the pole of index (UIndex, VIndex).

    Deprecated
    Parameters (2)
    • UIndex
    • VIndex
  • UKnot(UIndex: number): number

    Returns the U-knot of range UIndex.

    Deprecated
    Parameters (1)
    • UIndex
  • VKnot(VIndex: number): number

    Returns the V-knot of range VIndex.

    Deprecated
    Parameters (1)
    • VIndex
  • UMultiplicity(UIndex: number): number

    Returns the multiplicity of the U-knot of range UIndex.

    Deprecated
    Parameters (1)
    • UIndex
  • VMultiplicity(VIndex: number): number

    Returns the multiplicity of the V-knot of range VIndex.

    Deprecated
    Parameters (1)
    • VIndex
  • Returns the poles of the BSpline surface.

  • Returns the weights of the BSpline surface.

  • Returns the U-knots of the BSpline surface.

  • Returns the V-knots of the BSpline surface.

  • Returns the U-multiplicities of the BSpline surface.

  • Returns the V-multiplicities of the BSpline surface.

Convert_EllipseToBSplineCurve

This algorithm converts a ellipse into a rational B-spline curve. The ellipse is represented an Elips2d from package gp with the parametrization : P (U) = Loc + (MajorRadius * std::cos(U) * Xdir + MinorRadius * std::sin(U) * Ydir) where Loc is the center of the ellipse, Xdir and Ydir are the normalized directions of the local cartesian coordinate system of the ellipse. The parametrization range is U [0, 2PI]. KeyWords : Convert, Ellipse, BSplineCurve, 2D .

Constructors(2)

Convert_GridPolynomialToPoles

Convert a grid of Polynomial Surfaces that are have continuity CM to an Bspline Surface that has continuity CM.

Constructors(2)

  • constructor(MaxUDegree: number, MaxVDegree: number, NumCoeff: NCollection_HArray1_int, Coefficients: NCollection_HArray1_double, PolynomialUIntervals: NCollection_HArray1_double, PolynomialVIntervals: NCollection_HArray1_double): Convert_GridPolynomialToPoles

    To only one polynomial Surface. The Length of <PolynomialUIntervals> and <PolynomialVIntervals> have to be 2. This values defined the parametric domain of the Polynomial Equation.
    Coefficients: The <Coefficients> have to be formatted than an "C array" [MaxUDegree+1] [MaxVDegree+1] [3]

    Parameters (6)
    • MaxUDegree
    • MaxVDegree
    • NumCoeff
    • Coefficients
    • PolynomialUIntervals
    • PolynomialVIntervals
  • constructor(NbUSurfaces: number, NBVSurfaces: number, UContinuity: number, VContinuity: number, MaxUDegree: number, MaxVDegree: number, NumCoeffPerSurface: NCollection_HArray2_int, Coefficients: NCollection_HArray1_double, PolynomialUIntervals: NCollection_HArray1_double, PolynomialVIntervals: NCollection_HArray1_double, TrueUIntervals: NCollection_HArray1_double, TrueVIntervals: NCollection_HArray1_double): Convert_GridPolynomialToPoles

    To one grid of polynomial Surface. Warning! Continuity in each parametric direction can be at MOST the maximum degree of the polynomial functions.
    <TrueUIntervals>, <TrueVIntervals> : this is the true parameterisation for the composite surface
    Coefficients: The Coefficients have to be formatted than an "C array" [NbVSurfaces] [NBUSurfaces] [MaxUDegree+1] [MaxVDegree+1] [3] raises DomainError if <NumCoeffPerSurface> is not a [1, NbVSurfaces*NbUSurfaces, 1,2] array. if <Coefficients> is not a

    Parameters (12)
    • NbUSurfaces
    • NBVSurfaces
    • UContinuity
    • VContinuity
    • MaxUDegree
    • MaxVDegree
    • NumCoeffPerSurface
    • Coefficients
    • PolynomialUIntervals
    • PolynomialVIntervals
    • TrueUIntervals
    • TrueVIntervals

Instance methods(12)

Convert_HyperbolaToBSplineCurve

This algorithm converts a hyperbola into a rational B-spline curve. The hyperbola is an Hypr2d from package gp with the parametrization : P (U) = Loc + (MajorRadius * std::cosh(U) * Xdir + MinorRadius * std::sinh(U) * Ydir) where Loc is the location point of the hyperbola, Xdir and Ydir are the normalized directions of the local cartesian coordinate system of the hyperbola. KeyWords : Convert, Hyperbola, BSplineCurve, 2D .

Constructors(1)

Convert_ParabolaToBSplineCurve

This algorithm converts a parabola into a non rational B-spline curve. The parabola is a Parab2d from package gp with the parametrization P (U) = Loc + F * (U*U * Xdir + 2 * U * Ydir) where Loc is the apex of the parabola, Xdir is the normalized direction of the symmetry axis of the parabola, Ydir is the normalized direction of the directrix and F is the focal length. KeyWords : Convert, Parabola, BSplineCurve, 2D .

Constructors(1)

Convert_SphereToBSplineSurface

This algorithm converts a bounded Sphere into a rational B-spline surface. The sphere is a Sphere from package gp. The parametrization of the sphere is: P (U, V) = Loc + Radius * std::sin(V) * Zdir + Radius * std::cos(V) * (std::cos(U)*Xdir + std::sin(U)*Ydir) where Loc is the center of the sphere Xdir, Ydir and Zdir are the normalized directions of the local cartesian coordinate system of the sphere. The parametrization range is U [0, 2PI] and V [-PI/2, PI/2]. KeyWords : Convert, Sphere, BSplineSurface.

Constructors(3)

  • The equivalent B-spline surface as the same orientation as the sphere in the U and V parametric directions.

    Parameters (1)
    • Sph
  • constructor(Sph: gp_Sphere, Param1: number, Param2: number, UTrim?: boolean): Convert_SphereToBSplineSurface

    The equivalent B-spline surface as the same orientation as the sphere in the U and V parametric directions.
    Raised if UTrim = True and Param1 = Param2 or Param1 = Param2 + 2.0 * Pi Raised if UTrim = False and Param1 = Param2

    Parameters (4)
    • Sph
    • Param1
    • Param2
    • UTrim
  • constructor(Sph: gp_Sphere, U1: number, U2: number, V1: number, V2: number): Convert_SphereToBSplineSurface

    The equivalent B-spline surface as the same orientation as the sphere in the U and V parametric directions.
    Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2.

    Parameters (5)
    • Sph
    • U1
    • U2
    • V1
    • V2

Convert_TorusToBSplineSurface

This algorithm converts a bounded Torus into a rational B-spline surface. The torus is a Torus from package gp. The parametrization of the torus is : P (U, V) = Loc + MinorRadius * std::sin(V) * Zdir + (MajorRadius+MinorRadius*std::cos(V)) * (std::cos(U)*Xdir + std::sin(U)*Ydir) where Loc is the center of the torus, Xdir, Ydir and Zdir are the normalized directions of the local cartesian coordinate system of the Torus. The parametrization range is U [0, 2PI], V [0, 2PI]. KeyWords : Convert, Torus, BSplineSurface.

Constructors(3)

  • The equivalent B-spline surface as the same orientation as the torus in the U and V parametric directions.

    Parameters (1)
    • T
  • constructor(T: gp_Torus, Param1: number, Param2: number, UTrim?: boolean): Convert_TorusToBSplineSurface

    The equivalent B-spline surface as the same orientation as the torus in the U and V parametric directions.
    Raised if Param1 = Param2 or Param1 = Param2 + 2.0 * Pi

    Parameters (4)
    • T
    • Param1
    • Param2
    • UTrim
  • constructor(T: gp_Torus, U1: number, U2: number, V1: number, V2: number): Convert_TorusToBSplineSurface

    The equivalent B-spline surface as the same orientation as the torus in the U and V parametric directions.
    Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2 or V1 = V2 + 2.0 * Pi

    Parameters (5)
    • T
    • U1
    • U2
    • V1
    • V2