b311480e |
1 | -- Created on: 1991-10-10 |
2 | -- Created by: Jean Claude VAUTHIER |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class CircleToBSplineCurve from Convert inherits ConicToBSplineCurve |
18 | |
19 | --- Purpose : |
20 | -- This algorithm converts a circle into a rational B-spline curve. |
21 | -- The circle is a Circ2d from package gp and its parametrization is : |
22 | -- P (U) = Loc + R * (Cos(U) * Xdir + Sin(U) * YDir) where Loc is the |
23 | -- center of the circle Xdir and Ydir are the normalized directions |
24 | -- of the local cartesian coordinate system of the circle. |
25 | -- The parametrization range for the circle is U [0, 2Pi]. |
26 | -- |
27 | --- Warnings : |
28 | -- The parametrization range for the B-spline curve is not [0, 2Pi]. |
29 | -- |
30 | --- KeyWords : |
31 | -- Convert, Circle, BSplineCurve, 2D . |
32 | |
33 | |
34 | uses Circ2d from gp, |
35 | ParameterisationType from Convert |
36 | |
37 | raises DomainError from Standard |
38 | |
39 | is |
40 | |
41 | Create (C : Circ2d; |
42 | Parameterisation : ParameterisationType from Convert |
43 | = Convert_TgtThetaOver2) |
44 | returns CircleToBSplineCurve; |
45 | --- Purpose : |
46 | -- The equivalent B-spline curve has the same orientation |
47 | -- as the circle C. |
48 | |
49 | |
50 | Create (C : Circ2d; U1, U2 : Real ; |
51 | Parameterisation : ParameterisationType from Convert |
52 | = Convert_TgtThetaOver2) |
53 | returns CircleToBSplineCurve |
54 | --- Purpose : |
55 | -- The circle C is limited between the parametric values U1, U2 |
56 | -- in radians. U1 and U2 [0.0, 2*Pi] . |
57 | -- The equivalent B-spline curve is oriented from U1 to U2 and has |
58 | -- the same orientation as the circle C. |
59 | raises DomainError; |
60 | --- Purpose : |
61 | -- Raised if U1 = U2 or U1 = U2 + 2.0 * Pi |
62 | |
63 | |
64 | end CircleToBSplineCurve; |
65 | |