2 -- Created: Mon Sep 9 16:39:42 1991
3 -- Author: Michel Chauvat
4 ---Copyright: Matra Datavision 1991
11 --- Purpose : Provides functions for basic geometric computation on
12 -- elementary surfaces.
14 -- - calculation of a point or derived vector on a surface
15 -- where the surface is provided by the gp package, or
16 -- defined in canonical form (as in the gp package), and
17 -- the point is defined with a parameter,
18 -- - evaluation of the parameters corresponding to a
19 -- point on an elementary surface from gp,
20 -- - calculation of isoparametric curves on an elementary
21 -- surface defined in canonical form (as in the gp package).
23 -- - ElSLib stands for Elementary Surfaces Library.
24 -- - If the surfaces provided by the gp package are not
25 -- explicitly parameterized, they still have an implicit
26 -- parameterization, similar to that which they infer on
27 -- the equivalent Geom surfaces.
28 -- Note: ElSLib stands for Elementary Surfaces Library.
34 Value (U, V : Real; Pl : Pln from gp)
36 ---Purpose: For elementary surfaces from the gp package (planes,
37 -- cones, cylinders, spheres and tori), computes the point
38 -- of parameters (U, V).
40 Value (U, V : Real; C : Cone from gp)
44 Value (U, V : Real; C : Cylinder from gp)
48 Value (U, V : Real; S : Sphere from gp)
52 Value (U,V : Real; T : Torus from gp)
56 DN (U, V : Real; Pl : Pln from gp; Nu, Nv : Integer)
58 ---Purpose: For elementary surfaces from the gp package (planes,
59 -- cones, cylinders, spheres and tori), computes the
60 -- derivative vector of order Nu and Nv in the u and v
61 -- parametric directions respectively, at the point of
64 DN (U, V : Real; C : Cone from gp; Nu, Nv : Integer)
68 DN (U, V : Real; C : Cylinder from gp; Nu, Nv : Integer)
72 DN (U, V : Real; S : Sphere from gp; Nu, Nv : Integer)
76 DN (U, V : Real; T : Torus from gp; Nu, Nv : Integer)
80 D0 (U, V : Real; Pl : Pln from gp; P : out Pnt from gp);
81 ---Purpose: For elementary surfaces from the gp package (planes,
82 -- cones, cylinders, spheres and tori), computes the point P
83 -- of parameters (U, V).inline
85 D0 (U, V : Real; C : Cone from gp; P : out Pnt from gp);
88 D0 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp);
91 D0 (U, V : Real; S : Sphere from gp; P : out Pnt from gp);
94 D0 (U, V : Real; T : Torus from gp; P : out Pnt from gp);
97 D1 (U, V : Real; Pl : Pln from gp; P : out Pnt from gp;
98 Vu, Vv : out Vec from gp);
100 -- For elementary surfaces from the gp package (planes,
101 -- cones, cylinders, spheres and tori), computes:
102 -- - the point P of parameters (U, V), and
103 -- - the first derivative vectors Vu and Vv at this point in
104 -- the u and v parametric directions respectively.
106 D1 (U, V : Real; C : Cone from gp; P : out Pnt from gp;
107 Vu, Vv : out Vec from gp);
110 D1 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp;
111 Vu, Vv : out Vec from gp);
114 D1 (U, V : Real; S : Sphere from gp; P : out Pnt from gp;
115 Vu, Vv : out Vec from gp);
118 D1 (U, V : Real; T : Torus from gp; P : out Pnt from gp;
119 Vu, Vv : out Vec from gp);
122 D2 (U, V : Real; C : Cone from gp; P : out Pnt from gp;
123 Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
125 -- For elementary surfaces from the gp package (cones,
126 -- cylinders, spheres and tori), computes:
127 -- - the point P of parameters (U, V), and
128 -- - the first derivative vectors Vu and Vv at this point in
129 -- the u and v parametric directions respectively, and
130 -- - the second derivative vectors Vuu, Vvv and Vuv at this point.
132 D2 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp;
133 Vu,Vv,Vuu,Vvv,Vuv : out Vec from gp);
136 D2 (U, V : Real; S : Sphere from gp; P : out Pnt from gp;
137 Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
140 D2 (U, V : Real; T : Torus from gp; P : out Pnt from gp;
141 Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
144 D3 (U, V : Real; C : Cone from gp; P : out Pnt from gp;
145 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
147 -- For elementary surfaces from the gp package (cones,
148 -- cylinders, spheres and tori), computes:
149 -- - the point P of parameters (U,V), and
150 -- - the first derivative vectors Vu and Vv at this point in
151 -- the u and v parametric directions respectively, and
152 -- - the second derivative vectors Vuu, Vvv and Vuv at
154 -- - the third derivative vectors Vuuu, Vvvv, Vuuv and
155 -- Vuvv at this point.
157 D3 (U, V : Real; C : Cylinder from gp; P : out Pnt from gp;
158 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
161 D3 (U, V : Real; S : Sphere from gp; P : out Pnt from gp;
162 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
165 D3 (U, V : Real; T : Torus from gp; P : out Pnt from gp;
166 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
171 --- Purpose : Surface evaluation
172 -- The following functions compute the point and the
173 -- derivatives on elementary surfaces defined with their
174 -- geometric characterisitics.
175 -- You don't need to create the surface to use these functions.
176 -- These functions are called by the previous ones.
178 -- A cylinder is defined with its position and its radius.
182 PlaneValue (U, V : Real; Pos : Ax3 from gp)
185 CylinderValue (U, V : Real; Pos : Ax3 from gp; Radius : Real)
188 ConeValue (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real)
191 SphereValue (U, V : Real; Pos : Ax3 from gp; Radius : Real)
194 TorusValue (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real)
197 PlaneDN (U, V : Real; Pos : Ax3 from gp; Nu, Nv : Integer)
200 CylinderDN (U, V : Real; Pos: Ax3 from gp; Radius : Real; Nu, Nv : Integer)
203 ConeDN (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
207 SphereDN (U, V : Real; Pos: Ax3 from gp; Radius : Real; Nu, Nv : Integer)
210 TorusDN (U, V : Real; Pos: Ax3 from gp; MajorRadius, MinorRadius : Real;
214 PlaneD0 (U, V : Real; Pos : Ax3 from gp; P : out Pnt from gp);
216 ConeD0 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
217 P : out Pnt from gp);
219 CylinderD0 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
220 P : out Pnt from gp);
222 SphereD0 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
223 P : out Pnt from gp);
225 TorusD0 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
226 P : out Pnt from gp);
228 PlaneD1 (U, V : Real; Pos : Ax3 from gp; P : out Pnt from gp;
229 Vu, Vv : out Vec from gp);
231 ConeD1 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
232 P : out Pnt from gp; Vu, Vv : out Vec from gp);
234 CylinderD1 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
235 P : out Pnt from gp; Vu, Vv : out Vec from gp);
237 SphereD1 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
238 P : out Pnt from gp; Vu, Vv : out Vec from gp);
240 TorusD1 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
241 P : out Pnt from gp; Vu, Vv : out Vec from gp);
243 ConeD2 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
244 P : out Pnt from gp; Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
246 CylinderD2 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
247 P : out Pnt from gp; Vu,Vv,Vuu,Vvv,Vuv : out Vec from gp);
249 SphereD2 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
250 P : out Pnt from gp; Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
252 TorusD2 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
253 P : out Pnt from gp; Vu, Vv, Vuu, Vvv, Vuv : out Vec from gp);
255 ConeD3 (U, V : Real; Pos : Ax3 from gp; Radius, SAngle : Real;
257 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
259 CylinderD3 (U, V : Real; Pos : Ax3 from gp; Radius : Real;
261 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
263 SphereD3 (U, V : Real; Pos : Ax3 from gp; Radius : Real; P : out Pnt from gp;
264 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
266 TorusD3 (U, V : Real; Pos : Ax3 from gp; MajorRadius, MinorRadius : Real;
268 Vu, Vv, Vuu, Vvv, Vuv, Vuuu, Vvvv, Vuuv, Vuvv : out Vec from gp);
273 -- The following functions compute the parametric values
274 -- corresponding to a given point on a elementary surface.
275 -- The point should be on the surface.
278 Parameters (Pl : Pln from gp; P : Pnt from gp; U, V : out Real);
279 --- Purpose : parametrization
281 -- Pl.Location() + U * Pl.XDirection() + V * Pl.YDirection()
285 Parameters (C : Cylinder from gp; P : Pnt from gp; U, V : out Real);
286 --- Purpose : parametrization
287 -- P (U, V) = Location + V * ZDirection +
288 -- Radius * (Cos(U) * XDirection + Sin (U) * YDirection)
292 Parameters (C : Cone from gp; P : Pnt from gp; U, V : out Real);
293 --- Purpose : parametrization
294 -- P (U, V) = Location + V * ZDirection +
295 -- (Radius + V * Tan (SemiAngle)) *
296 -- (Cos(U) * XDirection + Sin(U) * YDirection)
300 Parameters (S : Sphere from gp; P : Pnt from gp; U, V : out Real);
301 --- Purpose : parametrization
302 -- P (U, V) = Location +
303 -- Radius * Cos (V) * (Cos (U) * XDirection + Sin (U) * YDirection) +
304 -- Radius * Sin (V) * ZDirection
308 Parameters (T : Torus from gp; P : Pnt from gp; U, V : out Real);
309 --- Purpose : parametrization
310 -- P (U, V) = Location +
311 -- (MajorRadius + MinorRadius * Cos(U)) *
312 -- (Cos(V) * XDirection - Sin(V) * YDirection) +
313 -- MinorRadius * Sin(U) * ZDirection
317 PlaneParameters (Pos: Ax3 from gp; P: Pnt from gp; U, V: out Real);
318 --- Purpose : parametrization
320 -- Pl.Location() + U * Pl.XDirection() + V * Pl.YDirection()
323 CylinderParameters (Pos: Ax3 from gp; Radius : Real; P: Pnt from gp;
325 --- Purpose : parametrization
326 -- P (U, V) = Location + V * ZDirection +
327 -- Radius * (Cos(U) * XDirection + Sin (U) * YDirection)
330 ConeParameters (Pos: Ax3 from gp; Radius, SAngle: Real; P: Pnt from gp;
332 --- Purpose : parametrization
333 -- P (U, V) = Location + V * ZDirection +
334 -- (Radius + V * Tan (SemiAngle)) *
335 -- (Cos(U) * XDirection + Sin(U) * YDirection)
338 SphereParameters (Pos: Ax3 from gp; Radius: Real; P: Pnt from gp;
340 --- Purpose : parametrization
341 -- P (U, V) = Location +
342 -- Radius * Cos (V) * (Cos (U) * XDirection + Sin (U) * YDirection) +
343 -- Radius * Sin (V) * ZDirection
346 TorusParameters (Pos: Ax3 from gp; MajorRadius, MinorRadius: Real;
347 P : Pnt from gp; U, V : out Real);
348 --- Purpose : parametrization
349 -- P (U, V) = Location +
350 -- (MajorRadius + MinorRadius * Cos(U)) *
351 -- (Cos(V) * XDirection - Sin(V) * YDirection) +
352 -- MinorRadius * Sin(U) * ZDirection
355 PlaneUIso (Pos: Ax3 from gp; U : Real)
356 --- Purpose : compute the U Isoparametric gp_Lin of the plane.
360 CylinderUIso (Pos: Ax3 from gp; Radius, U : Real)
361 --- Purpose : compute the U Isoparametric gp_Lin of the cylinder.
365 ConeUIso (Pos: Ax3 from gp; Radius, SAngle, U: Real)
366 --- Purpose : compute the U Isoparametric gp_Lin of the cone.
370 SphereUIso (Pos: Ax3 from gp; Radius, U : Real)
371 --- Purpose : compute the U Isoparametric gp_Circ of the sphere,
372 -- (the meridian is not trimmed).
373 returns Circ from gp;
376 TorusUIso (Pos: Ax3 from gp; MajorRadius, MinorRadius, U: Real)
377 --- Purpose : compute the U Isoparametric gp_Circ of the torus.
378 returns Circ from gp;
381 PlaneVIso (Pos: Ax3 from gp; V : Real)
382 --- Purpose : compute the V Isoparametric gp_Lin of the plane.
386 CylinderVIso (Pos: Ax3 from gp; Radius, V : Real)
387 --- Purpose : compute the V Isoparametric gp_Circ of the cylinder.
388 returns Circ from gp;
391 ConeVIso (Pos: Ax3 from gp; Radius, SAngle, V : Real)
392 --- Purpose : compute the V Isoparametric gp_Circ of the cone.
393 returns Circ from gp;
396 SphereVIso (Pos: Ax3 from gp; Radius, V : Real)
397 --- Purpose : compute the V Isoparametric gp_Circ of the sphere,
398 -- (the meridian is not trimmed).
399 returns Circ from gp;
402 TorusVIso (Pos: Ax3 from gp; MajorRadius, MinorRadius, V : Real)
403 --- Purpose : compute the V Isoparametric gp_Circ of the torus.
404 returns Circ from gp;