Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-01 08:32:30

0001 // Created on: 1991-10-10
0002 // Created by: Jean Claude VAUTHIER
0003 // Copyright (c) 1991-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Convert_ParameterisationType_HeaderFile
0018 #define _Convert_ParameterisationType_HeaderFile
0019 
0020 //! Identifies a type of parameterization of a circle or ellipse represented as a BSpline curve.
0021 //! For a circle with a center C and a radius R (for example a Geom2d_Circle or a Geom_Circle),
0022 //! the natural parameterization is angular. It uses the angle Theta made by the vector CM with
0023 //! the 'X Axis' of the circle's local coordinate system as parameter for the current point M. The
0024 //! coordinates of the point M are as follows:
0025 //! X   =   R *cos ( Theta )
0026 //! y   =   R * sin ( Theta )
0027 //! Similarly, for an ellipse with a center C, a major radius R and a minor radius r, the circle
0028 //! Circ with center C and radius R (and located in the same plane as the ellipse) lends its natural
0029 //! angular parameterization to the ellipse. This is achieved by an affine transformation in the
0030 //! plane of the ellipse, in the ratio r / R, about the 'X Axis' of its local coordinate system. The
0031 //! coordinates of the current point M are as follows:
0032 //! X   =   R * cos ( Theta )
0033 //! y   =   r * sin ( Theta )
0034 //! The process of converting a circle or an ellipse into a rational or non-rational BSpline curve
0035 //! transforms the Theta angular parameter into a parameter t. This ensures the rational or
0036 //! polynomial parameterization of the resulting BSpline curve. Several types of parametric
0037 //! transformations are available.
0038 //! TgtThetaOver2
0039 //! The most usual method is Convert_TgtThetaOver2 where the parameter t on the BSpline
0040 //! curve is obtained by means of transformation of the following type:
0041 //! t = tan ( Theta / 2 )
0042 //! The result of this definition is:
0043 //! cos ( Theta ) = ( 1. - t**2 ) / ( 1. + t**2 )
0044 //! sin ( Theta ) =      2. * t / ( 1. + t**2 )
0045 //! which ensures the rational parameterization of the circle or the ellipse. However, this is not
0046 //! the most suitable parameterization method where the arc of the circle or ellipse has a large
0047 //! opening angle. In such cases, the curve will be represented by a BSpline with intermediate
0048 //! knots. Each span, i.e. each portion of curve between two different knot values, will use
0049 //! parameterization of this type. The number of spans is calculated using the following rule: ( 1.2
0050 //! * Delta / Pi ) + 1 where Delta is equal to the opening angle (in radians) of the arc of the
0051 //! circle (Delta is equal to 2.* Pi in the case of a complete circle). The resulting BSpline curve
0052 //! is "exact", i.e. computing any point of parameter t on the BSpline curve gives an exact point on
0053 //! the circle or the ellipse. TgtThetaOver2_N Where N is equal to 1, 2, 3 or 4, this ensures the
0054 //! same type of parameterization as Convert_TgtThetaOver2 but sets the number of spans in the
0055 //! resulting BSpline curve to N rather than allowing the algorithm to make this calculation.
0056 //! However, the opening angle Delta (parametric angle, given in radians) of the arc of the circle
0057 //! (or of the ellipse) must comply with the following:
0058 //! -   Delta <= 0.9999 * Pi for the Convert_TgtThetaOver2_1 method, or
0059 //! -   Delta <= 1.9999 * Pi for the Convert_TgtThetaOver2_2 method.
0060 //! QuasiAngular
0061 //! The Convert_QuasiAngular method of parameterization uses a different type of rational
0062 //! parameterization. This method ensures that the parameter t along the resulting BSpline curve is
0063 //! very close to the natural parameterization angle Theta of the circle or ellipse (i.e. which uses
0064 //! the functions sin ( Theta ) and cos ( Theta ).
0065 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
0066 //! curve gives an exact point on the circle or the ellipse.
0067 //! RationalC1
0068 //! The Convert_RationalC1 method of parameterization uses a further type of rational
0069 //! parameterization. This method ensures that the equation relating to the resulting BSpline curve
0070 //! has a "C1" continuous denominator, which is not the case with the above methods. RationalC1
0071 //! enhances the degree of continuity at the junction point of the different spans of the curve.
0072 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
0073 //! curve gives an exact point on the circle or the ellipse.
0074 //! Polynomial
0075 //! The Convert_Polynomial method is used to produce polynomial (i.e. non-rational)
0076 //! parameterization of the resulting BSpline curve with 8 poles (i.e. a polynomial degree equal to
0077 //! 7). However, the result is an approximation of the circle or ellipse (i.e. computing the point
0078 //! of parameter t on the BSpline curve does not give an exact point on the circle or the ellipse).
0079 enum Convert_ParameterisationType
0080 {
0081   Convert_TgtThetaOver2,
0082   Convert_TgtThetaOver2_1,
0083   Convert_TgtThetaOver2_2,
0084   Convert_TgtThetaOver2_3,
0085   Convert_TgtThetaOver2_4,
0086   Convert_QuasiAngular,
0087   Convert_RationalC1,
0088   Convert_Polynomial
0089 };
0090 
0091 #endif // _Convert_ParameterisationType_HeaderFile