Open CASCADE Technology
6.9.0

The GeomConvert package provides some global functions as follows. More...
#include <GeomConvert.hxx>
Static Public Member Functions  
static Handle< Geom_BSplineCurve >  SplitBSplineCurve (const Handle< Geom_BSplineCurve > &C, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Boolean SameOrientation=Standard_True) 
Convert a curve from Geom by an approximation method. More...  
static Handle< Geom_BSplineCurve >  SplitBSplineCurve (const Handle< Geom_BSplineCurve > &C, const Standard_Real FromU1, const Standard_Real ToU2, const Standard_Real ParametricTolerance, const Standard_Boolean SameOrientation=Standard_True) 
This function computes the segment of Bspline curve between the parametric values FromU1, ToU2. If C is periodic the arc has the same orientation as C if SameOrientation = True. If C is not periodic SameOrientation is not used for the computation and C is oriented fromU1 toU2. If U1 and U2 and two parametric values we consider that U1 = U2 if Abs (U1  U2) <= ParametricTolerance and ParametricTolerance must be greater or equal to Resolution from package gp. More...  
static Handle < Geom_BSplineSurface >  SplitBSplineSurface (const Handle< Geom_BSplineSurface > &S, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, const Standard_Boolean SameUOrientation=Standard_True, const Standard_Boolean SameVOrientation=Standard_True) 
Computes the Bspline surface patche between the knots values FromUK1, ToUK2, FromVK1, ToVK2. If S is periodic in one direction the patche has the same orientation as S in this direction if the flag is true in this direction (SameUOrientation, SameVOrientation). If S is not periodic SameUOrientation and SameVOrientation are not used for the computation and S is oriented FromUK1 ToUK2 and FromVK1 ToVK2. Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2 FromUK1 or ToUK2 are out of the bounds [FirstUKnotIndex, LastUKnotIndex] FromVK1 or ToVK2 are out of the bounds [FirstVKnotIndex, LastVKnotIndex]. More...  
static Handle < Geom_BSplineSurface >  SplitBSplineSurface (const Handle< Geom_BSplineSurface > &S, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Boolean USplit, const Standard_Boolean SameOrientation=Standard_True) 
This method splits a Bspline surface patche between the knots values FromK1, ToK2 in one direction. If USplit = True then the splitting direction is the U parametric direction else it is the V parametric direction. If S is periodic in the considered direction the patche has the same orientation as S in this direction if SameOrientation is True If S is not periodic in this direction SameOrientation is not used for the computation and S is oriented FromK1 ToK2. Raised if FromK1 = ToK2 or if FromK1 or ToK2 are out of the bounds [FirstUKnotIndex, LastUKnotIndex] in the considered parametric direction. More...  
static Handle < Geom_BSplineSurface >  SplitBSplineSurface (const Handle< Geom_BSplineSurface > &S, const Standard_Real FromU1, const Standard_Real ToU2, const Standard_Real FromV1, const Standard_Real ToV2, const Standard_Real ParametricTolerance, const Standard_Boolean SameUOrientation=Standard_True, const Standard_Boolean SameVOrientation=Standard_True) 
This method computes the Bspline surface patche between the parametric values FromU1, ToU2, FromV1, ToV2. If S is periodic in one direction the patche has the same orientation as S in this direction if the flag is True in this direction (SameUOrientation, SameVOrientation). If S is not periodic SameUOrientation and SameVOrientation are not used for the computation and S is oriented FromU1 ToU2 and FromV1 ToV2. If U1 and U2 and two parametric values we consider that U1 = U2 if Abs (U1  U2) <= ParametricTolerance and ParametricTolerance must be greater or equal to Resolution from package gp. More...  
static Handle < Geom_BSplineSurface >  SplitBSplineSurface (const Handle< Geom_BSplineSurface > &S, const Standard_Real FromParam1, const Standard_Real ToParam2, const Standard_Boolean USplit, const Standard_Real ParametricTolerance, const Standard_Boolean SameOrientation=Standard_True) 
This method splits the Bspline surface S in one direction between the parametric values FromParam1, ToParam2. If USplit = True then the Splitting direction is the U parametric direction else it is the V parametric direction. If S is periodic in the considered direction the patche has the same orientation as S in this direction if SameOrientation is true. If S is not periodic in the considered direction SameOrientation is not used for the computation and S is oriented FromParam1 ToParam2. If U1 and U2 and two parametric values we consider that U1 = U2 if Abs (U1  U2) <= ParametricTolerance and ParametricTolerance must be greater or equal to Resolution from package gp. More...  
static Handle< Geom_BSplineCurve >  CurveToBSplineCurve (const Handle< Geom_Curve > &C, const Convert_ParameterisationType Parameterisation=Convert_TgtThetaOver2) 
This function converts a non infinite curve from Geom into a Bspline curve. C must be an ellipse or a circle or a trimmed conic or a trimmed line or a Bezier curve or a trimmed Bezier curve or a BSpline curve or a trimmed BSpline curve or an OffsetCurve. The returned Bspline is not periodic except if C is a Circle or an Ellipse. If the Parameterisation is QuasiAngular than the returned curve is NOT periodic in case a periodic Geom_Circle or Geom_Ellipse. For TgtThetaOver2_1 and TgtThetaOver2_2 the method raises an exception in case of a periodic Geom_Circle or a Geom_Ellipse ParameterisationType applies only if the curve is a Circle or an ellipse : TgtThetaOver2, – TgtThetaOver2_1, – TgtThetaOver2_2, – TgtThetaOver2_3, – TgtThetaOver2_4,. More...  
static Handle < Geom_BSplineSurface >  SurfaceToBSplineSurface (const Handle< Geom_Surface > &S) 
This algorithm converts a non infinite surface from Geom into a Bspline surface. S must be a trimmed plane or a trimmed cylinder or a trimmed cone or a trimmed sphere or a trimmed torus or a sphere or a torus or a Bezier surface of a trimmed Bezier surface or a trimmed swept surface with a corresponding basis curve which can be turned into a Bspline curve (see the method CurveToBSplineCurve). Raises DomainError if the type of the surface is not previously defined. More...  
static void  ConcatG1 (TColGeom_Array1OfBSplineCurve &ArrayOfCurves, const TColStd_Array1OfReal &ArrayOfToler, Handle< TColGeom_HArray1OfBSplineCurve > &ArrayOfConcatenated, const Standard_Boolean ClosedG1Flag, const Standard_Real ClosedTolerance) 
This Method concatenates G1 the ArrayOfCurves as far as it is possible. ArrayOfCurves[0..N1] ArrayOfToler contains the biggest tolerance of the two points shared by two consecutives curves. Its dimension: [0..N2] ClosedG1 indicates if the ArrayOfCurves is closed. In this case ClosedG1 contains the biggest tolerance of the two points which are at the closure. Otherwise its value is 0.0. More...  
static void  ConcatC1 (TColGeom_Array1OfBSplineCurve &ArrayOfCurves, const TColStd_Array1OfReal &ArrayOfToler, Handle< TColStd_HArray1OfInteger > &ArrayOfIndices, Handle< TColGeom_HArray1OfBSplineCurve > &ArrayOfConcatenated, const Standard_Boolean ClosedG1Flag, const Standard_Real ClosedTolerance) 
This Method concatenates C1 the ArrayOfCurves as far as it is possible. ArrayOfCurves[0..N1] ArrayOfToler contains the biggest tolerance of the two points shared by two consecutives curves. Its dimension: [0..N2] ClosedG1 indicates if the ArrayOfCurves is closed. In this case ClosedG1 contains the biggest tolerance of the two points which are at the closure. Otherwise its value is 0.0. More...  
static void  ConcatC1 (TColGeom_Array1OfBSplineCurve &ArrayOfCurves, const TColStd_Array1OfReal &ArrayOfToler, Handle< TColStd_HArray1OfInteger > &ArrayOfIndices, Handle< TColGeom_HArray1OfBSplineCurve > &ArrayOfConcatenated, const Standard_Boolean ClosedG1Flag, const Standard_Real ClosedTolerance, const Standard_Real AngularTolerance) 
This Method concatenates C1 the ArrayOfCurves as far as it is possible. ArrayOfCurves[0..N1] ArrayOfToler contains the biggest tolerance of the two points shared by two consecutives curves. Its dimension: [0..N2] ClosedG1 indicates if the ArrayOfCurves is closed. In this case ClosedG1 contains the biggest tolerance of the two points which are at the closure. Otherwise its value is 0.0. More...  
static void  C0BSplineToC1BSplineCurve (Handle< Geom_BSplineCurve > &BS, const Standard_Real tolerance, const Standard_Real AngularTolerance=1.0e7) 
This Method reduces as far as it is possible the multiplicities of the knots of the BSpline BS.(keeping the geometry). It returns a new BSpline which could still be C0. tolerance is a geometrical tolerance. The Angular toleranceis in radians and mesures the angle of the tangents on the left and on the right to decide if the curve is G1 or not at a given point. More...  
static void  C0BSplineToArrayOfC1BSplineCurve (const Handle< Geom_BSplineCurve > &BS, Handle< TColGeom_HArray1OfBSplineCurve > &tabBS, const Standard_Real tolerance) 
This Method reduces as far as it is possible the multiplicities of the knots of the BSpline BS.(keeping the geometry). It returns an array of BSpline C1. tolerance is a geometrical tolerance. More...  
static void  C0BSplineToArrayOfC1BSplineCurve (const Handle< Geom_BSplineCurve > &BS, Handle< TColGeom_HArray1OfBSplineCurve > &tabBS, const Standard_Real AngularTolerance, const Standard_Real tolerance) 
This Method reduces as far as it is possible the multiplicities of the knots of the BSpline BS.(keeping the geometry). It returns an array of BSpline C1. tolerance is a geometrical tolerance : it allows for the maximum deformation The Angular tolerance is in radians and mesures the angle of the tangents on the left and on the right to decide if the curve is C1 or not at a given point. More...  
The GeomConvert package provides some global functions as follows.
References : . Generating the Bezier Points of Bspline curves and surfaces (Wolfgang Bohm) CAGD volume 13 number 6 november 1981 . On NURBS: A Survey (Leslie Piegl) IEEE Computer Graphics and Application January 1991 . Curve and surface construction using rational Bsplines (Leslie Piegl and Wayne Tiller) CAD Volume 19 number 9 november 1987 . A survey of curve and surface methods in CAGD (Wolfgang BOHM) CAGD 1 1984

static 
This Method reduces as far as it is possible the multiplicities of the knots of the BSpline BS.(keeping the geometry). It returns an array of BSpline C1. tolerance is a geometrical tolerance.

static 
This Method reduces as far as it is possible the multiplicities of the knots of the BSpline BS.(keeping the geometry). It returns an array of BSpline C1. tolerance is a geometrical tolerance : it allows for the maximum deformation The Angular tolerance is in radians and mesures the angle of the tangents on the left and on the right to decide if the curve is C1 or not at a given point.

static 
This Method reduces as far as it is possible the multiplicities of the knots of the BSpline BS.(keeping the geometry). It returns a new BSpline which could still be C0. tolerance is a geometrical tolerance. The Angular toleranceis in radians and mesures the angle of the tangents on the left and on the right to decide if the curve is G1 or not at a given point.

static 
This Method concatenates C1 the ArrayOfCurves as far as it is possible. ArrayOfCurves[0..N1] ArrayOfToler contains the biggest tolerance of the two points shared by two consecutives curves. Its dimension: [0..N2] ClosedG1 indicates if the ArrayOfCurves is closed. In this case ClosedG1 contains the biggest tolerance of the two points which are at the closure. Otherwise its value is 0.0.

static 
This Method concatenates C1 the ArrayOfCurves as far as it is possible. ArrayOfCurves[0..N1] ArrayOfToler contains the biggest tolerance of the two points shared by two consecutives curves. Its dimension: [0..N2] ClosedG1 indicates if the ArrayOfCurves is closed. In this case ClosedG1 contains the biggest tolerance of the two points which are at the closure. Otherwise its value is 0.0.

static 
This Method concatenates G1 the ArrayOfCurves as far as it is possible. ArrayOfCurves[0..N1] ArrayOfToler contains the biggest tolerance of the two points shared by two consecutives curves. Its dimension: [0..N2] ClosedG1 indicates if the ArrayOfCurves is closed. In this case ClosedG1 contains the biggest tolerance of the two points which are at the closure. Otherwise its value is 0.0.

static 
This function converts a non infinite curve from Geom into a Bspline curve. C must be an ellipse or a circle or a trimmed conic or a trimmed line or a Bezier curve or a trimmed Bezier curve or a BSpline curve or a trimmed BSpline curve or an OffsetCurve. The returned Bspline is not periodic except if C is a Circle or an Ellipse. If the Parameterisation is QuasiAngular than the returned curve is NOT periodic in case a periodic Geom_Circle or Geom_Ellipse. For TgtThetaOver2_1 and TgtThetaOver2_2 the method raises an exception in case of a periodic Geom_Circle or a Geom_Ellipse ParameterisationType applies only if the curve is a Circle or an ellipse : TgtThetaOver2, – TgtThetaOver2_1, – TgtThetaOver2_2, – TgtThetaOver2_3, – TgtThetaOver2_4,.
Purpose: this is the classical rational parameterisation 2 1  t cos(theta) = — 2 1 + t
2t sin(theta) = — 2 1 + t
t = tan (theta/2)
with TgtThetaOver2 the routine will compute the number of spans using the rule num_spans = [ (ULast  UFirst) / 1.2 ] + 1 with TgtThetaOver2_N, N spans will be forced: an error will be raized if (ULast  UFirst) >= PI and N = 1, ULast  UFirst >= 2 PI and N = 2
QuasiAngular, here t is a rational function that approximates theta —> tan(theta/2). Neverthless the composing with above function yields exact functions whose square sum up to 1 RationalC1 ; t is replaced by a polynomial function of u so as to grant C1 contiuity across knots. Exceptions Standard_DomainError:

static 
Convert a curve from Geom by an approximation method.
This method computes the arc of Bspline curve between the two knots FromK1 and ToK2. If C is periodic the arc has the same orientation as C if SameOrientation = Standard_True. If C is not periodic SameOrientation is not used for the computation and C is oriented from the knot fromK1 to the knot toK2. We just keep the local definition of C between the knots FromK1 and ToK2. The returned Bspline curve has its first and last knots with a multiplicity equal to degree + 1, where degree is the polynomial degree of C. The indexes of the knots FromK1 and ToK2 doesn't include the repetition of multiple knots in their definition. Raised if FromK1 = ToK2 Raised if FromK1 or ToK2 are out of the bounds [FirstUKnotIndex, LastUKnotIndex]

static 
This function computes the segment of Bspline curve between the parametric values FromU1, ToU2. If C is periodic the arc has the same orientation as C if SameOrientation = True. If C is not periodic SameOrientation is not used for the computation and C is oriented fromU1 toU2. If U1 and U2 and two parametric values we consider that U1 = U2 if Abs (U1  U2) <= ParametricTolerance and ParametricTolerance must be greater or equal to Resolution from package gp.
Raised if FromU1 or ToU2 are out of the parametric bounds of the curve (The tolerance criterion is ParametricTolerance). Raised if Abs (FromU1  ToU2) <= ParametricTolerance Raised if ParametricTolerance < Resolution from gp.

static 
Computes the Bspline surface patche between the knots values FromUK1, ToUK2, FromVK1, ToVK2. If S is periodic in one direction the patche has the same orientation as S in this direction if the flag is true in this direction (SameUOrientation, SameVOrientation). If S is not periodic SameUOrientation and SameVOrientation are not used for the computation and S is oriented FromUK1 ToUK2 and FromVK1 ToVK2. Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2 FromUK1 or ToUK2 are out of the bounds [FirstUKnotIndex, LastUKnotIndex] FromVK1 or ToVK2 are out of the bounds [FirstVKnotIndex, LastVKnotIndex].

static 
This method splits a Bspline surface patche between the knots values FromK1, ToK2 in one direction. If USplit = True then the splitting direction is the U parametric direction else it is the V parametric direction. If S is periodic in the considered direction the patche has the same orientation as S in this direction if SameOrientation is True If S is not periodic in this direction SameOrientation is not used for the computation and S is oriented FromK1 ToK2. Raised if FromK1 = ToK2 or if FromK1 or ToK2 are out of the bounds [FirstUKnotIndex, LastUKnotIndex] in the considered parametric direction.

static 
This method computes the Bspline surface patche between the parametric values FromU1, ToU2, FromV1, ToV2. If S is periodic in one direction the patche has the same orientation as S in this direction if the flag is True in this direction (SameUOrientation, SameVOrientation). If S is not periodic SameUOrientation and SameVOrientation are not used for the computation and S is oriented FromU1 ToU2 and FromV1 ToV2. If U1 and U2 and two parametric values we consider that U1 = U2 if Abs (U1  U2) <= ParametricTolerance and ParametricTolerance must be greater or equal to Resolution from package gp.
Raised if FromU1 or ToU2 or FromV1 or ToU2 are out of the parametric bounds of the surface (the tolerance criterion is ParametricTolerance). Raised if Abs (FromU1  ToU2) <= ParametricTolerance or Abs (FromV1  ToV2) <= ParametricTolerance. Raised if ParametricTolerance < Resolution.

static 
This method splits the Bspline surface S in one direction between the parametric values FromParam1, ToParam2. If USplit = True then the Splitting direction is the U parametric direction else it is the V parametric direction. If S is periodic in the considered direction the patche has the same orientation as S in this direction if SameOrientation is true. If S is not periodic in the considered direction SameOrientation is not used for the computation and S is oriented FromParam1 ToParam2. If U1 and U2 and two parametric values we consider that U1 = U2 if Abs (U1  U2) <= ParametricTolerance and ParametricTolerance must be greater or equal to Resolution from package gp.
Raises if FromParam1 or ToParam2 are out of the parametric bounds of the surface in the considered direction. Raises if Abs (FromParam1  ToParam2) <= ParametricTolerance.

static 
This algorithm converts a non infinite surface from Geom into a Bspline surface. S must be a trimmed plane or a trimmed cylinder or a trimmed cone or a trimmed sphere or a trimmed torus or a sphere or a torus or a Bezier surface of a trimmed Bezier surface or a trimmed swept surface with a corresponding basis curve which can be turned into a Bspline curve (see the method CurveToBSplineCurve). Raises DomainError if the type of the surface is not previously defined.