Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:22

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 
0021 //! Identifies a type of parameterization of a circle or ellipse represented as a BSpline curve.
0022 //! For a circle with a center C and a radius R (for example a Geom2d_Circle or a Geom_Circle),
0023 //! the natural parameterization is angular. It uses the angle Theta made by the vector CM with
0024 //! the 'X Axis' of the circle's local coordinate system as parameter for the current point M. The
0025 //! coordinates of the point M are as follows:
0026 //! X   =   R *cos ( Theta )
0027 //! y   =   R * sin ( Theta )
0028 //! Similarly, for an ellipse with a center C, a major radius R and a minor radius r, the circle Circ
0029 //! with center C and radius R (and located in the same plane as the ellipse) lends its natural
0030 //! angular parameterization to the ellipse. This is achieved by an affine transformation in the plane
0031 //! of the ellipse, in the ratio r / R, about the 'X Axis' of its local coordinate system. The
0032 //! coordinates of the current point M are as follows:
0033 //! X   =   R * cos ( Theta )
0034 //! y   =   r * sin ( Theta )
0035 //! The process of converting a circle or an ellipse into a rational or non-rational BSpline curve
0036 //! transforms the Theta angular parameter into a parameter t. This ensures the rational or
0037 //! polynomial parameterization of the resulting BSpline curve. Several types of parametric
0038 //! transformations are available.
0039 //! TgtThetaOver2
0040 //! The most usual method is Convert_TgtThetaOver2 where the parameter t on the BSpline
0041 //! curve is obtained by means of transformation of the following type:
0042 //! t = tan ( Theta / 2 )
0043 //! The result of this definition is:
0044 //! cos ( Theta ) = ( 1. - t**2 ) / ( 1. + t**2 )
0045 //! sin ( Theta ) =      2. * t / ( 1. + t**2 )
0046 //! which ensures the rational parameterization of the circle or the ellipse. However, this is not the
0047 //! most suitable parameterization method where the arc of the circle or ellipse has a large opening
0048 //! angle. In such cases, the curve will be represented by a BSpline with intermediate knots. Each
0049 //! span, i.e. each portion of curve between two different knot values, will use parameterization of
0050 //! this type.
0051 //! The number of spans is calculated using the following rule:
0052 //! ( 1.2 * Delta / Pi ) + 1
0053 //! where Delta is equal to the opening angle (in radians) of the arc of the circle (Delta is
0054 //! equal to 2.* Pi in the case of a complete circle).
0055 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
0056 //! curve gives an exact point on the circle or the ellipse.
0057 //! TgtThetaOver2_N
0058 //! Where N is equal to 1, 2, 3 or 4, this ensures the same type of parameterization as
0059 //! Convert_TgtThetaOver2 but sets the number of spans in the resulting BSpline curve to N
0060 //! rather than allowing the algorithm to make this calculation.
0061 //! However, the opening angle Delta (parametric angle, given in radians) of the arc of the circle
0062 //! (or of the ellipse) must comply with the following:
0063 //! -   Delta <= 0.9999 * Pi for the Convert_TgtThetaOver2_1 method, or
0064 //! -   Delta <= 1.9999 * Pi for the Convert_TgtThetaOver2_2 method.
0065 //! QuasiAngular
0066 //! The Convert_QuasiAngular method of parameterization uses a different type of rational
0067 //! parameterization. This method ensures that the parameter t along the resulting BSpline curve is
0068 //! very close to the natural parameterization angle Theta of the circle or ellipse (i.e. which uses
0069 //! the functions sin ( Theta ) and cos ( Theta ).
0070 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
0071 //! curve gives an exact point on the circle or the ellipse.
0072 //! RationalC1
0073 //! The Convert_RationalC1 method of parameterization uses a further type of rational
0074 //! parameterization. This method ensures that the equation relating to the resulting BSpline curve
0075 //! has a "C1" continuous denominator, which is not the case with the above methods. RationalC1
0076 //! enhances the degree of continuity at the junction point of the different spans of the curve.
0077 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
0078 //! curve gives an exact point on the circle or the ellipse.
0079 //! Polynomial
0080 //! The Convert_Polynomial method is used to produce polynomial (i.e. non-rational)
0081 //! parameterization of the resulting BSpline curve with 8 poles (i.e. a polynomial degree equal to 7).
0082 //! However, the result is an approximation of the circle or ellipse (i.e. computing the point of
0083 //! parameter t on the BSpline curve does not give an exact point on the circle or the ellipse).
0084 enum Convert_ParameterisationType
0085 {
0086 Convert_TgtThetaOver2,
0087 Convert_TgtThetaOver2_1,
0088 Convert_TgtThetaOver2_2,
0089 Convert_TgtThetaOver2_3,
0090 Convert_TgtThetaOver2_4,
0091 Convert_QuasiAngular,
0092 Convert_RationalC1,
0093 Convert_Polynomial
0094 };
0095 
0096 #endif // _Convert_ParameterisationType_HeaderFile