1 // Created on: 1991-10-10
2 // Created by: Jean Claude VAUTHIER
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Convert_ParameterisationType_HeaderFile
18 #define _Convert_ParameterisationType_HeaderFile
21 //! Identifies a type of parameterization of a circle or ellipse represented as a BSpline curve.
22 //! For a circle with a center C and a radius R (for example a Geom2d_Circle or a Geom_Circle),
23 //! the natural parameterization is angular. It uses the angle Theta made by the vector CM with
24 //! the 'X Axis' of the circle's local coordinate system as parameter for the current point M. The
25 //! coordinates of the point M are as follows:
26 //! X = R *cos ( Theta )
27 //! y = R * sin ( Theta )
28 //! Similarly, for an ellipse with a center C, a major radius R and a minor radius r, the circle Circ
29 //! with center C and radius R (and located in the same plane as the ellipse) lends its natural
30 //! angular parameterization to the ellipse. This is achieved by an affine transformation in the plane
31 //! of the ellipse, in the ratio r / R, about the 'X Axis' of its local coordinate system. The
32 //! coordinates of the current point M are as follows:
33 //! X = R * cos ( Theta )
34 //! y = r * sin ( Theta )
35 //! The process of converting a circle or an ellipse into a rational or non-rational BSpline curve
36 //! transforms the Theta angular parameter into a parameter t. This ensures the rational or
37 //! polynomial parameterization of the resulting BSpline curve. Several types of parametric
38 //! transformations are available.
40 //! The most usual method is Convert_TgtThetaOver2 where the parameter t on the BSpline
41 //! curve is obtained by means of transformation of the following type:
42 //! t = tan ( Theta / 2 )
43 //! The result of this definition is:
44 //! cos ( Theta ) = ( 1. - t**2 ) / ( 1. + t**2 )
45 //! sin ( Theta ) = 2. * t / ( 1. + t**2 )
46 //! which ensures the rational parameterization of the circle or the ellipse. However, this is not the
47 //! most suitable parameterization method where the arc of the circle or ellipse has a large opening
48 //! angle. In such cases, the curve will be represented by a BSpline with intermediate knots. Each
49 //! span, i.e. each portion of curve between two different knot values, will use parameterization of
51 //! The number of spans is calculated using the following rule:
52 //! ( 1.2 * Delta / Pi ) + 1
53 //! where Delta is equal to the opening angle (in radians) of the arc of the circle (Delta is
54 //! equal to 2.* Pi in the case of a complete circle).
55 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
56 //! curve gives an exact point on the circle or the ellipse.
58 //! Where N is equal to 1, 2, 3 or 4, this ensures the same type of parameterization as
59 //! Convert_TgtThetaOver2 but sets the number of spans in the resulting BSpline curve to N
60 //! rather than allowing the algorithm to make this calculation.
61 //! However, the opening angle Delta (parametric angle, given in radians) of the arc of the circle
62 //! (or of the ellipse) must comply with the following:
63 //! - Delta <= 0.9999 * Pi for the Convert_TgtThetaOver2_1 method, or
64 //! - Delta <= 1.9999 * Pi for the Convert_TgtThetaOver2_2 method.
66 //! The Convert_QuasiAngular method of parameterization uses a different type of rational
67 //! parameterization. This method ensures that the parameter t along the resulting BSpline curve is
68 //! very close to the natural parameterization angle Theta of the circle or ellipse (i.e. which uses
69 //! the functions sin ( Theta ) and cos ( Theta ).
70 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
71 //! curve gives an exact point on the circle or the ellipse.
73 //! The Convert_RationalC1 method of parameterization uses a further type of rational
74 //! parameterization. This method ensures that the equation relating to the resulting BSpline curve
75 //! has a "C1" continuous denominator, which is not the case with the above methods. RationalC1
76 //! enhances the degree of continuity at the junction point of the different spans of the curve.
77 //! The resulting BSpline curve is "exact", i.e. computing any point of parameter t on the BSpline
78 //! curve gives an exact point on the circle or the ellipse.
80 //! The Convert_Polynomial method is used to produce polynomial (i.e. non-rational)
81 //! parameterization of the resulting BSpline curve with 8 poles (i.e. a polynomial degree equal to 7).
82 //! However, the result is an approximation of the circle or ellipse (i.e. computing the point of
83 //! parameter t on the BSpline curve does not give an exact point on the circle or the ellipse).
84 enum Convert_ParameterisationType
86 Convert_TgtThetaOver2,
87 Convert_TgtThetaOver2_1,
88 Convert_TgtThetaOver2_2,
89 Convert_TgtThetaOver2_3,
90 Convert_TgtThetaOver2_4,
96 #endif // _Convert_ParameterisationType_HeaderFile