0023170: Bug of creating a full sphere face
[occt.git] / src / ElSLib / ElSLib.cdl
1 -- Created on: 1991-09-09
2 -- Created by: Michel Chauvat
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23
24
25 package ElSLib
26
27         --- Purpose :  Provides functions for basic geometric computation on
28         -- elementary surfaces.
29         -- This includes:
30         -- -   calculation of a point or derived vector on a surface
31         --   where the surface is provided by the gp package, or
32         --   defined in canonical form (as in the gp package), and
33         --   the point is defined with a parameter,
34         -- -   evaluation of the parameters corresponding to a
35         --   point on an elementary surface from gp,
36         -- -   calculation of isoparametric curves on an elementary
37         --   surface defined in canonical form (as in the gp package).
38         --  Notes:
39         -- -   ElSLib stands for Elementary Surfaces Library.
40         -- -   If the surfaces provided by the gp package are not
41         --   explicitly parameterized, they still have an implicit
42         --   parameterization, similar to that which they infer on
43         --   the equivalent Geom surfaces.
44         --  Note: ElSLib stands for Elementary Surfaces Library.
45
46 uses gp
47
48 is
49
50   Value (U, V : Real; Pl : Pln from gp)       
51     returns Pnt from gp;
52         ---Purpose:  For elementary surfaces from the gp package (planes,
53         -- cones, cylinders, spheres and tori), computes the point
54         -- of parameters (U, V).
55      
56   Value (U, V : Real; C : Cone from gp)       
57     returns Pnt from gp;
58         ---C++: inline
59
60   Value (U, V : Real; C : Cylinder from gp)   
61     returns Pnt from gp;
62         ---C++: inline
63
64   Value (U, V : Real; S : Sphere from gp)    
65     returns Pnt from gp;
66         ---C++: inline
67
68   Value (U,V : Real; T : Torus from gp)       
69     returns Pnt from gp;
70         ---C++: inline
71
72   DN (U, V : Real; Pl : Pln from gp; Nu, Nv : Integer)       
73     returns Vec from gp;
74         ---Purpose: For elementary surfaces from the gp package (planes,
75         -- cones, cylinders, spheres and tori), computes the
76         -- derivative vector of order Nu and Nv in the u and v
77         -- parametric directions respectively, at the point of
78         -- parameters (U, V).
79
80   DN (U, V : Real; C : Cone from gp; Nu, Nv : Integer)       
81     returns Vec from gp;
82         ---C++: inline
83
84   DN (U, V : Real; C : Cylinder from gp; Nu, Nv : Integer)   
85     returns Vec from gp;
86         ---C++: inline
87
88   DN (U, V : Real; S : Sphere from gp; Nu, Nv : Integer)     
89     returns Vec from gp;
90         ---C++: inline
91
92   DN (U, V : Real; T : Torus from gp; Nu, Nv : Integer)      
93     returns Vec from gp;
94         ---C++: inline
95
96   D0 (U, V : Real; Pl : Pln from gp; P : out Pnt from gp);
97         ---Purpose:  For elementary surfaces from the gp package (planes,
98         -- cones, cylinders, spheres and tori), computes the point P
99         -- of parameters (U, V).inline
100
101   D0 (U, V : Real; C : Cone from gp; P : out Pnt from gp);
102         ---C++: inline
103
104   D0 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp);
105         ---C++: inline
106
107   D0 (U, V : Real; S : Sphere from gp; P : out Pnt from gp);
108         ---C++: inline
109
110   D0 (U, V : Real; T : Torus from gp; P : out Pnt from gp);
111         ---C++: inline
112
113   D1 (U, V : Real; Pl : Pln from gp; P : out Pnt from gp;
114      Vu, Vv : out Vec from gp);
115         ---Purpose:
116         -- For elementary surfaces from the gp package (planes,
117         -- cones, cylinders, spheres and tori), computes:
118         -- -   the point P of parameters (U, V), and
119         -- -   the first derivative vectors Vu and Vv at this point in
120         --   the u and v parametric directions respectively.
121
122   D1 (U, V : Real; C : Cone from gp; P : out Pnt from gp;
123     Vu, Vv : out Vec from gp);
124         ---C++: inline
125
126   D1 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp;
127     Vu, Vv : out Vec from gp);
128         ---C++: inline
129
130   D1 (U, V : Real; S : Sphere from gp; P : out Pnt from gp;
131     Vu, Vv : out Vec from gp);
132         ---C++: inline
133
134   D1 (U, V : Real; T : Torus from gp; P : out Pnt from gp;
135     Vu, Vv : out Vec from gp);
136         ---C++: inline
137
138   D2 (U, V : Real; C : Cone from gp; P : out Pnt from gp;
139     Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
140         ---Purpose:
141         -- For elementary surfaces from the gp package (cones,
142         -- cylinders, spheres and tori), computes:
143         -- -   the point P of parameters (U, V), and
144         -- -   the first derivative vectors Vu and Vv at this point in
145         --   the u and v parametric directions respectively, and
146         -- -   the second derivative vectors Vuu, Vvv and Vuv at this point.
147
148   D2 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp;
149     Vu,Vv,Vuu,Vvv,Vuv : out Vec from gp);
150         ---C++: inline
151         
152   D2 (U, V : Real; S : Sphere from gp; P : out Pnt from gp;
153     Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
154         ---C++: inline
155
156   D2 (U, V : Real; T : Torus from gp; P : out Pnt from gp;
157     Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
158         ---C++: inline
159
160   D3 (U, V : Real; C : Cone from gp; P : out Pnt from gp; 
161       Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
162         ---Purpose:
163         -- For elementary surfaces from the gp package (cones,
164         -- cylinders, spheres and tori), computes:
165         -- -   the point P of parameters (U,V), and
166         -- -   the first derivative vectors Vu and Vv at this point in
167         --   the u and v parametric directions respectively, and
168         -- -   the second derivative vectors Vuu, Vvv and Vuv at
169         --   this point, and
170         -- -   the third derivative vectors Vuuu, Vvvv, Vuuv and
171         --   Vuvv at this point.
172
173   D3 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp; 
174       Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
175         ---C++: inline
176
177   D3 (U, V : Real; S : Sphere from gp; P : out Pnt from gp; 
178       Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
179         ---C++: inline
180
181   D3 (U, V : Real; T : Torus from gp; P : out Pnt from gp; 
182       Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
183         ---C++: inline
184
185
186
187         --- Purpose : Surface evaluation
188         --  The following functions compute the point and the
189         --  derivatives on elementary surfaces defined with their
190         --  geometric characterisitics. 
191         --  You don't need to create the surface to use these functions.
192         --  These functions are called by the previous  ones.
193         --- Example :
194         --  A cylinder is defined with its position and its radius. 
195
196
197
198   PlaneValue (U, V : Real; Pos : Ax3 from gp)                        
199     returns Pnt from gp;
200
201   CylinderValue (U, V : Real; Pos : Ax3 from gp; Radius : Real)      
202     returns Pnt from gp;
203
204   ConeValue (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real)  
205     returns Pnt from gp;
206
207   SphereValue (U, V : Real; Pos : Ax3 from gp; Radius : Real)        
208     returns Pnt from gp;
209
210   TorusValue (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real)
211      returns Pnt from gp;
212
213   PlaneDN (U, V : Real; Pos : Ax3 from gp; Nu, Nv : Integer)   
214     returns Vec from gp;
215
216   CylinderDN (U, V : Real; Pos: Ax3 from gp; Radius : Real; Nu, Nv : Integer)
217      returns Vec from gp;
218
219   ConeDN (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real; 
220           Nu, Nv : Integer)
221      returns Vec from gp;
222
223   SphereDN (U, V : Real; Pos: Ax3 from gp; Radius : Real; Nu, Nv : Integer)
224      returns Vec from gp;
225
226   TorusDN (U, V : Real; Pos: Ax3 from gp; MajorRadius, MinorRadius : Real;
227            Nu, Nv : Integer)
228      returns Vec from gp;
229
230   PlaneD0 (U, V : Real; Pos : Ax3 from gp; P : out Pnt from gp);
231
232   ConeD0 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
233           P : out Pnt from gp);
234
235   CylinderD0 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
236               P : out Pnt from gp);
237
238   SphereD0 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
239             P : out Pnt from gp);
240
241   TorusD0 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
242            P : out Pnt from gp);
243
244   PlaneD1 (U, V : Real; Pos : Ax3 from gp; P : out Pnt from gp; 
245            Vu, Vv : out Vec from gp);
246
247   ConeD1 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
248           P : out Pnt from gp; Vu, Vv : out Vec from gp);
249
250   CylinderD1 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
251               P : out Pnt from gp; Vu, Vv : out Vec from gp);
252
253   SphereD1 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
254             P : out Pnt from gp; Vu, Vv : out Vec from gp);
255
256   TorusD1 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
257            P : out Pnt from gp; Vu, Vv : out Vec from gp);
258
259   ConeD2 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
260           P : out Pnt from gp; Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
261
262   CylinderD2 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
263               P : out Pnt from gp; Vu,Vv,Vuu,Vvv,Vuv : out Vec from gp);
264         
265   SphereD2 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
266             P : out Pnt from gp; Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
267
268   TorusD2 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
269            P : out Pnt from gp; Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
270
271   ConeD3 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real; 
272           P : out Pnt from gp;
273           Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
274
275   CylinderD3 (U, V : Real; Pos : Ax3 from gp; Radius : Real; 
276               P : out Pnt from gp; 
277               Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
278
279   SphereD3 (U, V : Real; Pos : Ax3 from gp; Radius : Real; P : out Pnt from gp;
280             Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
281
282   TorusD3 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
283            P : out Pnt from gp; 
284            Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
285
286
287
288         --- Purpose :
289         --  The following functions compute the parametric values
290         --  corresponding to a given point on a elementary surface.
291         --  The point should be on the surface.
292       
293
294   Parameters (Pl : Pln from gp; P : Pnt from gp; U, V : out Real);
295         --- Purpose : parametrization
296         --  P (U, V) = 
297         --  Pl.Location() + U * Pl.XDirection() + V * Pl.YDirection()
298         ---C++: inline
299
300   
301   Parameters (C : Cylinder from gp; P : Pnt from gp; U, V : out Real);
302         --- Purpose : parametrization
303         --  P (U, V) = Location + V * ZDirection +
304         --  Radius * (Cos(U) * XDirection + Sin (U) * YDirection)
305         ---C++: inline
306
307
308   Parameters (C : Cone from gp; P : Pnt from gp; U, V : out Real);
309         --- Purpose : parametrization
310         --  P (U, V) =  Location + V * ZDirection +
311         --  (Radius + V * Tan (SemiAngle)) * 
312         --  (Cos(U) * XDirection + Sin(U) * YDirection)
313         ---C++: inline
314
315
316   Parameters (S : Sphere from gp; P : Pnt from gp; U, V : out Real);
317         --- Purpose : parametrization
318         --  P (U, V) = Location + 
319         --  Radius * Cos (V) * (Cos (U) * XDirection + Sin (U) * YDirection) +
320         --  Radius * Sin (V) * ZDirection
321         ---C++: inline
322
323
324   Parameters (T : Torus from gp; P : Pnt from gp; U, V : out Real);
325         --- Purpose : parametrization
326         --  P (U, V) = Location +
327         --  (MajorRadius + MinorRadius * Cos(U)) * 
328         --  (Cos(V) * XDirection - Sin(V) * YDirection) +
329         --  MinorRadius * Sin(U) * ZDirection
330         ---C++: inline
331
332
333   PlaneParameters (Pos: Ax3 from gp; P: Pnt from gp; U, V: out Real);
334         --- Purpose : parametrization
335         --  P (U, V) = 
336         --  Pl.Location() + U * Pl.XDirection() + V * Pl.YDirection()
337
338   
339   CylinderParameters (Pos: Ax3 from gp; Radius : Real; P: Pnt from gp;
340                       U, V: out Real);
341         --- Purpose : parametrization
342         --  P (U, V) = Location + V * ZDirection +
343         --  Radius * (Cos(U) * XDirection + Sin (U) * YDirection)
344
345
346   ConeParameters (Pos: Ax3 from gp; Radius, SAngle: Real; P: Pnt from gp;  
347                   U, V: out Real);
348         --- Purpose : parametrization
349         --  P (U, V) =  Location + V * ZDirection +
350         --  (Radius + V * Tan (SemiAngle)) * 
351         --  (Cos(U) * XDirection + Sin(U) * YDirection)
352
353
354   SphereParameters (Pos: Ax3 from gp; Radius: Real; P: Pnt from gp; 
355                     U, V: out Real);
356         --- Purpose : parametrization
357         --  P (U, V) = Location + 
358         --  Radius * Cos (V) * (Cos (U) * XDirection + Sin (U) * YDirection) +
359         --  Radius * Sin (V) * ZDirection
360
361
362   TorusParameters (Pos: Ax3 from gp; MajorRadius, MinorRadius: Real;
363                    P : Pnt from gp; U, V : out Real);
364         --- Purpose : parametrization
365         --  P (U, V) = Location +
366         --  (MajorRadius + MinorRadius * Cos(U)) * 
367         --  (Cos(V) * XDirection - Sin(V) * YDirection) +
368         --  MinorRadius * Sin(U) * ZDirection
369
370
371   PlaneUIso (Pos: Ax3 from gp; U : Real)
372         --- Purpose : compute the U Isoparametric gp_Lin of the plane.
373   returns Lin from gp;
374
375   
376   CylinderUIso (Pos: Ax3 from gp; Radius, U : Real)
377         --- Purpose : compute the U Isoparametric gp_Lin of the cylinder.
378   returns Lin from gp;
379
380
381   ConeUIso (Pos: Ax3 from gp; Radius, SAngle, U: Real)
382         --- Purpose : compute the U Isoparametric gp_Lin of the cone.
383   returns Lin from gp;
384
385
386   SphereUIso (Pos: Ax3 from gp; Radius, U : Real)
387         --- Purpose : compute the U Isoparametric gp_Circ of the sphere,
388         --  (the meridian is not trimmed).
389   returns Circ from gp;
390
391
392   TorusUIso (Pos: Ax3 from gp; MajorRadius, MinorRadius, U: Real)
393         --- Purpose : compute the U Isoparametric gp_Circ of the torus.
394   returns Circ from gp;
395
396
397   PlaneVIso (Pos: Ax3 from gp; V : Real)
398         --- Purpose : compute the V Isoparametric gp_Lin of the plane.
399   returns Lin from gp;
400
401   
402   CylinderVIso (Pos: Ax3 from gp; Radius, V : Real)
403         --- Purpose : compute the V Isoparametric gp_Circ of the cylinder.
404   returns Circ from gp;
405
406
407   ConeVIso (Pos: Ax3 from gp; Radius, SAngle, V : Real)
408         --- Purpose : compute the V Isoparametric gp_Circ of the cone.
409   returns Circ from gp;
410
411
412   SphereVIso (Pos: Ax3 from gp; Radius, V : Real)
413         --- Purpose : compute the V Isoparametric gp_Circ of the sphere,
414         --  (the meridian is not trimmed).
415   returns Circ from gp;
416
417
418   TorusVIso (Pos: Ax3 from gp; MajorRadius, MinorRadius, V : Real)
419         --- Purpose : compute the V Isoparametric gp_Circ of the torus.
420   returns Circ from gp;
421
422
423 end ElSLib;
424