b311480e |
1 | -- Created on: 1993-03-10 |
2 | -- Created by: JCV |
3 | -- Copyright (c) 1993-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 CylindricalSurface from Geom inherits ElementarySurface from Geom |
18 | |
19 | |
20 | ---Purpose : This class defines the infinite cylindrical surface. |
21 | -- |
22 | -- The local coordinate system of the CylindricalSurface is defined |
23 | -- with an axis placement (see class ElementarySurface). |
24 | -- |
25 | -- The "ZAxis" is the symmetry axis of the CylindricalSurface, |
26 | -- it gives the direction of increasing parametric value V. |
27 | -- |
28 | -- The parametrization range is : |
29 | -- U [0, 2*PI], V ]- infinite, + infinite[ |
30 | -- |
31 | -- The "XAxis" and the "YAxis" define the placement plane of the |
32 | -- surface (Z = 0, and parametric value V = 0) perpendicular to |
33 | -- the symmetry axis. The "XAxis" defines the origin of the |
34 | -- parameter U = 0. The trigonometric sense gives the positive |
35 | -- orientation for the parameter U. |
36 | -- |
37 | -- When you create a CylindricalSurface the U and V directions of |
38 | -- parametrization are such that at each point of the surface the |
39 | -- normal is oriented towards the "outside region". |
40 | -- |
41 | -- The methods UReverse VReverse change the orientation of the |
42 | -- surface. |
43 | |
44 | uses Ax3 from gp, |
45 | Cylinder from gp, |
46 | Pnt from gp, |
47 | Trsf from gp, |
48 | GTrsf2d from gp, |
49 | Vec from gp, |
50 | Curve from Geom, |
51 | Geometry from Geom |
52 | |
53 | raises ConstructionError from Standard, |
54 | RangeError from Standard |
55 | |
56 | |
57 | is |
58 | |
6e33d3ce |
59 | Create (A3 : Ax3; Radius : Real) returns CylindricalSurface |
7fd59977 |
60 | ---Purpose : |
61 | -- A3 defines the local coordinate system of the cylindrical surface. |
62 | -- The "ZDirection" of A3 defines the direction of the surface's |
63 | -- axis of symmetry. |
64 | -- At the creation the parametrization of the surface is defined |
65 | -- such that the normal Vector (N = D1U ^ D1V) is oriented towards |
66 | -- the "outside region" of the surface. |
67 | --- Warnings : |
68 | -- It is not forbidden to create a cylindrical surface with |
69 | -- Radius = 0.0 |
70 | raises ConstructionError; |
71 | ---Purpose : Raised if Radius < 0.0 |
72 | |
73 | |
74 | |
6e33d3ce |
75 | Create (C : Cylinder) returns CylindricalSurface; |
7fd59977 |
76 | ---Purpose : |
77 | -- Creates a CylindricalSurface from a non transient Cylinder |
78 | -- from package gp. |
79 | |
80 | |
81 | |
82 | SetCylinder (me : mutable; C : Cylinder); |
83 | ---Purpose : |
84 | -- Set <me> so that <me> has the same geometric properties as C. |
85 | |
86 | |
87 | SetRadius (me : mutable; R : Real) |
88 | ---Purpose : Changes the radius of the cylinder. |
89 | raises ConstructionError; |
90 | ---Purpose : Raised if R < 0.0 |
91 | |
92 | |
93 | Cylinder (me) returns Cylinder; |
94 | ---Purpose : |
95 | -- returns a non transient cylinder with the same geometric |
96 | -- properties as <me>. |
97 | |
98 | |
99 | UReversedParameter (me; U : Real) returns Real; |
100 | ---Purpose: Return the parameter on the Ureversed surface for |
101 | -- the point of parameter U on <me>. |
102 | -- Return 2.PI - U. |
103 | |
104 | |
105 | VReversedParameter (me; V : Real) returns Real; |
106 | ---Purpose: Return the parameter on the Vreversed surface for |
107 | -- the point of parameter V on <me>. |
108 | -- Return -V |
109 | |
110 | TransformParameters(me; U,V : in out Real; T : Trsf from gp) |
111 | ---Purpose: Computes the parameters on the transformed surface for |
112 | -- the transform of the point of parameters U,V on <me>. |
113 | -- me->Transformed(T)->Value(U',V') |
114 | -- is the same point as |
115 | -- me->Value(U,V).Transformed(T) |
116 | -- Where U',V' are the new values of U,V after calling |
117 | -- me->TranformParameters(U,V,T) |
118 | -- This methods multiplies V by T.ScaleFactor() |
119 | is redefined; |
120 | |
121 | ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp |
122 | ---Purpose: Returns a 2d transformation used to find the new |
123 | -- parameters of a point on the transformed surface. |
124 | -- me->Transformed(T)->Value(U',V') |
125 | -- is the same point as |
126 | -- me->Value(U,V).Transformed(T) |
127 | -- Where U',V' are obtained by transforming U,V with |
128 | -- th 2d transformation returned by |
129 | -- me->ParametricTransformation(T) |
130 | -- This methods returns a scale centered on the |
131 | -- U axis with T.ScaleFactor |
132 | is redefined; |
133 | |
134 | |
135 | |
136 | Bounds (me; U1, U2, V1, V2 : out Real); |
137 | ---Purpose : |
138 | -- The CylindricalSurface is infinite in the V direction so |
139 | -- V1 = Realfirst, V2 = RealLast from package Standard. |
140 | -- U1 = 0 and U2 = 2*PI. |
141 | |
142 | |
143 | Coefficients (me; A1, A2, A3, B1, B2, B3, C1, C2, C3, D : out Real); |
144 | ---Purpose : |
145 | -- Returns the coefficients of the implicit equation of the quadric |
146 | -- in the absolute cartesian coordinate system : |
147 | -- These coefficients are normalized. |
148 | -- A1.X**2 + A2.Y**2 + A3.Z**2 + 2.(B1.X.Y + B2.X.Z + B3.Y.Z) + |
149 | -- 2.(C1.X + C2.Y + C3.Z) + D = 0.0 |
150 | |
151 | |
152 | Radius (me) returns Real; |
153 | ---Purpose: Returns the radius of this cylinder. |
154 | |
155 | IsUClosed (me) returns Boolean; |
156 | ---Purpose : Returns True. |
157 | |
158 | |
159 | IsVClosed (me) returns Boolean; |
160 | ---Purpose : Returns False. |
161 | |
162 | |
163 | IsUPeriodic (me) returns Boolean; |
164 | ---Purpose : Returns True. |
165 | |
166 | |
167 | IsVPeriodic (me) returns Boolean; |
168 | ---Purpose : Returns False. |
169 | |
170 | |
6e33d3ce |
171 | UIso (me; U : Real) returns Curve; |
7fd59977 |
172 | ---Purpose : |
173 | -- The UIso curve is a Line. The location point of this line is |
174 | -- on the placement plane (XAxis, YAxis) of the surface. |
175 | -- This line is parallel to the axis of symmetry of the surface. |
176 | |
177 | |
6e33d3ce |
178 | VIso (me; V : Real) returns Curve; |
7fd59977 |
179 | ---Purpose : |
180 | -- The VIso curve is a circle. The start point of this circle |
181 | -- (U = 0) is defined with the "XAxis" of the surface. |
182 | -- The center of the circle is on the symmetry axis. |
183 | |
184 | |
185 | D0 (me; U, V : Real; P : out Pnt); |
186 | ---Purpose : |
187 | -- Computes the point P (U, V) on the surface. |
188 | -- P (U, V) = Loc + Radius * (cos (U) * XDir + sin (U) * YDir) + |
189 | -- V * ZDir |
190 | -- where Loc is the origin of the placement plane (XAxis, YAxis) |
191 | -- XDir is the direction of the XAxis and YDir the direction of |
192 | -- the YAxis. |
193 | |
194 | |
195 | D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec); |
196 | ---Purpose : |
197 | -- Computes the current point and the first derivatives in the |
198 | -- directions U and V. |
199 | |
200 | |
201 | D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec); |
202 | ---Purpose : |
203 | -- Computes the current point, the first and the second derivatives |
204 | -- in the directions U and V. |
205 | |
206 | |
207 | D3 (me; U, V : Real; P : out Pnt; |
208 | D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec); |
209 | ---Purpose : |
210 | -- Computes the current point, the first, the second and the |
211 | -- third derivatives in the directions U and V. |
212 | |
213 | |
214 | DN (me; U, V : Real; Nu, Nv : Integer) returns Vec |
215 | ---Purpose : |
216 | -- Computes the derivative of order Nu in the direction u and Nv |
217 | -- in the direction v. |
218 | raises RangeError; |
219 | ---Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0. |
220 | |
221 | |
222 | |
223 | Transform (me : mutable; T : Trsf); |
224 | ---Purpose: Applies the transformation T to this cylinder. |
6e33d3ce |
225 | Copy (me) returns like me; |
7fd59977 |
226 | ---Purpose: Creates a new object which is a copy of this cylinder. |
227 | fields |
228 | |
229 | radius : Real; |
230 | |
231 | end; |