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)
- constructor(C: gp_Circ2d, Parameterisation?: Convert_ParameterisationType): Convert_CircleToBSplineCurve
The equivalent B-spline curve has the same orientation as the circle C.
Parameters (2)CParameterisation
- constructor(C: gp_Circ2d, U1: number, U2: number, Parameterisation?: Convert_ParameterisationType): Convert_CircleToBSplineCurve
The circle C is limited between the parametric values U1, U2 in radians. U1 and U2 [0.0, 2*Pi] . The equivalent B-spline curve is oriented from U1 to U2 and has the same orientation as the circle C.
Raised if U1 = U2 or U1 = U2 + 2.0 * PiParameters (4)CU1U2Parameterisation
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)
- constructor(theAngularTolerance?: number): Convert_CompBezierCurves2dToBSplineCurve2d
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)
- constructor(theAngularTolerance?: number): Convert_CompBezierCurvesToBSplineCurve
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)
- constructor(Dimension: number, MaxDegree: number, Degree: number, Coefficients: NCollection_Array1_double, PolynomialIntervals: NCollection_Array1_double, TrueIntervals: NCollection_Array1_double): Convert_CompPolynomialToPoles
To Convert only one span.
Parameters (6)DimensionMaxDegreeDegreeCoefficientsPolynomialIntervalsTrueIntervals
- constructor(NumCurves: number, Continuity: number, Dimension: number, MaxDegree: number, NumCoeffPerCurve: NCollection_HArray1_int, Coefficients: NCollection_HArray1_double, PolynomialIntervals: NCollection_HArray2_double, TrueIntervals: NCollection_HArray1_double): Convert_CompPolynomialToPoles
Warning! Continuity can be at MOST the maximum degree of the polynomial functions TrueIntervals : this is the true parameterisation for the composite curve that is : the curve has myContinuity if the nth curve is parameterized between myTrueIntervals(n) and myTrueIntervals(n+1).
Coefficients have to be the implicit "c form": Coefficients[Numcurves][MaxDegree+1][Dimension]
Warning! The NumberOfCoefficient of an polynome is his degree + 1 Example: To convert the linear function f(x) = 2*x + 1 on the domaine [2,5] to BSpline with the bound [-1,1]. Arguments are : NumCurves = 1; Continuity = 1; Dimension = 1; MaxDegree = 1; NumCoeffPerCurve [1] = {2}; Coefficients[2] = {1, 2}; PolynomialIntervals[1,2] = {{2,5}} TrueIntervals[2] = {-1, 1}Parameters (8)NumCurvesContinuityDimensionMaxDegreeNumCoeffPerCurveCoefficientsPolynomialIntervalsTrueIntervals
- constructor(NumCurves: number, Dimension: number, MaxDegree: number, Continuity: NCollection_Array1_int, NumCoeffPerCurve: NCollection_Array1_int, Coefficients: NCollection_Array1_double, PolynomialIntervals: NCollection_Array2_double, TrueIntervals: NCollection_Array1_double): Convert_CompPolynomialToPoles
To Convert several span with different order of Continuity. Warning: The Length of Continuity have to be NumCurves-1.
Parameters (8)NumCurvesDimensionMaxDegreeContinuityNumCoeffPerCurveCoefficientsPolynomialIntervalsTrueIntervals
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.
DeprecatedReturnsA 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.
DeprecatedReturnsA 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.
DeprecatedReturnsA 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)CV1V2
- 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)CU1U2V1V2
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.
Returns the pole of index Index to the poles table of the BSpline curve whose data is computed in this framework.
DeprecatedParameters (1)theIndex—pole index (1-based)
Returnspole 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.
DeprecatedParameters (1)theIndex—weight index (1-based)
Returnsweight 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.
DeprecatedParameters (1)theIndex—knot index (1-based)
Returnsknot 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.
DeprecatedParameters (1)theIndex—multiplicity index (1-based)
Returnsmultiplicity 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.
DeprecatedParameters (2)theParametrisationtheDegree
ReturnsA 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.
DeprecatedParameters (4)theParametrisationtheUFirsttheULasttheDegree
ReturnsA 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)
- constructor(Cyl: gp_Cylinder, V1: number, V2: number): Convert_CylinderToBSplineSurface
The equivalent B-splineSurface as the same orientation as the cylinder in the U and V parametric directions.
Raised if V1 = V2.Parameters (3)CylV1V2
- constructor(Cyl: gp_Cylinder, U1: number, U2: number, V1: number, V2: number): Convert_CylinderToBSplineSurface
The equivalent B-splineSurface as the same orientation as the cylinder in the U and V parametric directions.
Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2.Parameters (5)CylU1U2V1V2
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.
Returns the pole of index (UIndex, VIndex).
DeprecatedParameters (2)UIndexVIndex
- Weight(UIndex: number, VIndex: number): number
Returns the weight of the pole of index (UIndex, VIndex).
DeprecatedParameters (2)UIndexVIndex
- UKnot(UIndex: number): number
Returns the U-knot of range UIndex.
DeprecatedParameters (1)UIndex
- VKnot(VIndex: number): number
Returns the V-knot of range VIndex.
DeprecatedParameters (1)VIndex
- UMultiplicity(UIndex: number): number
Returns the multiplicity of the U-knot of range UIndex.
DeprecatedParameters (1)UIndex
- VMultiplicity(VIndex: number): number
Returns the multiplicity of the V-knot of range VIndex.
DeprecatedParameters (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)
- constructor(E: gp_Elips2d, Parameterisation?: Convert_ParameterisationType): Convert_EllipseToBSplineCurve
The equivalent B-spline curve has the same orientation as the ellipse E.
Parameters (2)EParameterisation
- constructor(E: gp_Elips2d, U1: number, U2: number, Parameterisation?: Convert_ParameterisationType): Convert_EllipseToBSplineCurve
The ellipse E is limited between the parametric values U1, U2. The equivalent B-spline curve is oriented from U1 to U2 and has the same orientation as E.
Raised if U1 = U2 or U1 = U2 + 2.0 * PiParameters (4)EU1U2Parameterisation
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)MaxUDegreeMaxVDegreeNumCoeffCoefficientsPolynomialUIntervalsPolynomialVIntervals
- 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 aParameters (12)NbUSurfacesNBVSurfacesUContinuityVContinuityMaxUDegreeMaxVDegreeNumCoeffPerSurfaceCoefficientsPolynomialUIntervalsPolynomialVIntervalsTrueUIntervalsTrueVIntervals
Instance methods(12)
- NbUPoles(): number
Returns the number of poles in the U parametric direction.
- NbVPoles(): number
Returns the number of poles in the V parametric direction.
Returns the poles of the BSpline Surface.
- UDegree(): number
Returns the degree in the U parametric direction.
- VDegree(): number
Returns the degree 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.
Returns the knots in the U direction.
Returns the knots in the V direction.
Returns the multiplicities of the knots in the U direction.
Returns the multiplicities of the knots in the V direction.
- IsDone(): boolean
Returns true if the conversion was successful.
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)
- constructor(H: gp_Hypr2d, U1: number, U2: number): Convert_HyperbolaToBSplineCurve
The hyperbola H is limited between the parametric values U1, U2 and the equivalent B-spline curve has the same orientation as the hyperbola.
Parameters (3)HU1U2
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)
- constructor(Prb: gp_Parab2d, U1: number, U2: number): Convert_ParabolaToBSplineCurve
The parabola Prb is limited between the parametric values U1, U2 and the equivalent B-spline curve as the same orientation as the parabola Prb.
Parameters (3)PrbU1U2
Convert_ParameterisationType
Properties(8)
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 = Param2Parameters (4)SphParam1Param2UTrim
- 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)SphU1U2V1V2
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 * PiParameters (4)TParam1Param2UTrim
- 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 * PiParameters (5)TU1U2V1V2