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