1 -- Created on: 1993-03-10
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class SurfaceOfRevolution from Geom inherits SweptSurface from Geom
19 ---Purpose : Describes a surface of revolution (revolved surface).
20 -- Such a surface is obtained by rotating a curve (called
21 -- the "meridian") through a complete revolution about
22 -- an axis (referred to as the "axis of revolution"). The
23 -- curve and the axis must be in the same plane (the
24 -- "reference plane" of the surface).
25 -- Rotation around the axis of revolution in the
26 -- trigonometric sense defines the u parametric
27 -- direction. So the u parameter is an angle, and its
28 -- origin is given by the position of the meridian on the surface.
29 -- The parametric range for the u parameter is: [ 0, 2.*Pi ]
30 -- The v parameter is that of the meridian.
31 -- Note: A surface of revolution is built from a copy of the
32 -- original meridian. As a result the original meridian is
33 -- not modified when the surface is modified.
34 -- The form of a surface of revolution is typically a
35 -- general revolution surface
36 -- (GeomAbs_RevolutionForm). It can be:
37 -- - a conical surface, if the meridian is a line or a
38 -- trimmed line (GeomAbs_ConicalForm),
39 -- - a cylindrical surface, if the meridian is a line or a
40 -- trimmed line parallel to the axis of revolution
41 -- (GeomAbs_CylindricalForm),
42 -- - a planar surface if the meridian is a line or a
43 -- trimmed line perpendicular to the axis of revolution
44 -- of the surface (GeomAbs_PlanarForm),
45 -- - a toroidal surface, if the meridian is a circle or a
46 -- trimmed circle (GeomAbs_ToroidalForm), or
47 -- - a spherical surface, if the meridian is a circle, the
48 -- center of which is located on the axis of the
49 -- revolved surface (GeomAbs_SphericalForm).
51 -- Be careful not to construct a surface of revolution
52 -- where the curve and the axis or revolution are not
53 -- defined in the same plane. If you do not have a
54 -- correct configuration, you can correct your initial
55 -- curve, using a cylindrical projection in the reference plane.
69 BSplineCurve from Geom
71 raises ConstructionError from Standard,
72 RangeError from Standard,
73 UndefinedDerivative from Geom
79 Create (C : Curve; A1 : Ax1) returns SurfaceOfRevolution;
81 -- C : is the meridian or the referenced curve.
82 -- A1 is the axis of revolution.
83 -- The form of a SurfaceOfRevolution can be :
84 -- . a general revolution surface (RevolutionForm),
85 -- . a conical surface if the meridian is a line or a trimmed line
87 -- . a cylindrical surface if the meridian is a line or a trimmed
88 -- line parallel to the revolution axis (CylindricalForm),
89 -- . a planar surface if the meridian is a line perpendicular to
90 -- the revolution axis of the surface (PlanarForm).
91 -- . a spherical surface,
92 -- . a toroidal surface,
93 -- . a quadric surface.
95 -- It is not checked that the curve C is planar and that the
96 -- surface axis is in the plane of the curve.
97 -- It is not checked that the revolved curve C doesn't
101 SetAxis (me : mutable; A1 : Ax1);
102 ---Purpose : Changes the axis of revolution.
104 -- It is not checked that the axis is in the plane of the
108 SetDirection (me : mutable; V : Dir);
109 ---Purpose : Changes the direction of the revolution axis.
111 -- It is not checked that the axis is in the plane of the
116 SetBasisCurve (me : mutable; C : Curve);
117 ---Purpose : Changes the revolved curve of the surface.
119 -- It is not checked that the curve C is planar and that the
120 -- surface axis is in the plane of the curve.
121 -- It is not checked that the revolved curve C doesn't
125 SetLocation (me : mutable; P : Pnt);
126 ---Purpose : Changes the location point of the revolution axis.
128 -- It is not checked that the axis is in the plane of the
132 Axis (me) returns Ax1;
133 ---Purpose : Returns the revolution axis of the surface.
136 Location (me) returns Pnt;
138 -- Returns the location point of the axis of revolution.
139 ---C++: return const&
142 ReferencePlane (me) returns Ax2
144 -- Computes the position of the reference plane of the surface
145 -- defined by the basis curve and the symmetry axis.
146 -- The location point is the location point of the revolution's
147 -- axis, the XDirection of the plane is given by the revolution's
148 -- axis and the orientation of the normal to the plane is given
149 -- by the sense of revolution.
150 raises ConstructionError;
152 -- Raised if the revolved curve is not planar or if the revolved
153 -- curve and the symmetry axis are not in the same plane or if
154 -- the maximum of distance between the axis and the revolved
155 -- curve is lower or equal to Resolution from gp.
158 UReverse (me : mutable);
159 ---Purpose : Changes the orientation of this surface of revolution
160 -- in the u parametric direction. The bounds of the
161 -- surface are not changed but the given parametric
162 -- direction is reversed. Hence the orientation of the
163 -- surface is reversed.
165 -- - UReverse reverses the direction of the axis of
166 -- revolution of this surface,
169 UReversedParameter ( me; U : Real) returns Real;
170 ---Purpose: Computes the u parameter on the modified
171 -- surface, when reversing its u parametric
172 -- direction, for any point of u parameter U on this surface of revolution.
173 -- In the case of a revolved surface:
174 -- - UReversedParameter returns 2.*Pi - U
177 VReverse (me : mutable);
178 ---Purpose : Changes the orientation of this surface of revolution
179 -- in the v parametric direction. The bounds of the
180 -- surface are not changed but the given parametric
181 -- direction is reversed. Hence the orientation of the
182 -- surface is reversed.
184 -- - VReverse reverses the meridian of this surface of revolution.
186 VReversedParameter (me; V : Real) returns Real;
187 ---Purpose: Computes the v parameter on the modified
188 -- surface, when reversing its v parametric
189 -- direction, for any point of v parameter V on this surface of revolution.
190 -- In the case of a revolved surface:
191 -- - VReversedParameter returns the reversed
192 -- parameter given by the function
193 -- ReversedParameter called with V on the meridian.
195 TransformParameters(me; U,V : in out Real; T : Trsf from gp)
196 ---Purpose: Computes the parameters on the transformed surface for
197 -- the transform of the point of parameters U,V on <me>.
199 -- me->Transformed(T)->Value(U',V')
201 -- is the same point as
203 -- me->Value(U,V).Transformed(T)
205 -- Where U',V' are the new values of U,V after calling
207 -- me->TranformParameters(U,V,T)
209 -- This methods multiplies V by
210 -- BasisCurve()->ParametricTransformation(T)
213 ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp
214 ---Purpose: Returns a 2d transformation used to find the new
215 -- parameters of a point on the transformed surface.
217 -- me->Transformed(T)->Value(U',V')
219 -- is the same point as
221 -- me->Value(U,V).Transformed(T)
223 -- Where U',V' are obtained by transforming U,V with
224 -- th 2d transformation returned by
226 -- me->ParametricTransformation(T)
228 -- This methods returns a scale centered on the
229 -- U axis with BasisCurve()->ParametricTransformation(T)
232 Bounds (me; U1, U2, V1, V2 : out Real);
233 ---Purpose : Returns the parametric bounds U1, U2 , V1 and V2 of this surface.
234 -- A surface of revolution is always complete, so U1 = 0, U2 = 2*PI.
237 IsUClosed (me) returns Boolean;
238 ---Purpose : IsUClosed always returns true.
241 IsVClosed (me) returns Boolean;
242 ---Purpose : IsVClosed returns true if the meridian of this
243 -- surface of revolution is closed.
246 IsCNu (me; N : Integer) returns Boolean;
247 ---Purpose : IsCNu always returns true.
250 IsCNv (me; N : Integer) returns Boolean
251 ---Purpose : IsCNv returns true if the degree of continuity of the
252 -- meridian of this surface of revolution is at least N.
254 ---Purpose : Raised if N < 0.
257 IsUPeriodic (me) returns Boolean;
258 ---Purpose : Returns True.
261 IsVPeriodic (me) returns Boolean;
262 ---Purpose : IsVPeriodic returns true if the meridian of this
263 -- surface of revolution is periodic.
266 UIso (me; U : Real) returns Curve;
267 ---Purpose : Computes the U isoparametric curve of this surface
268 -- of revolution. It is the curve obtained by rotating the
269 -- meridian through an angle U about the axis of revolution.
272 VIso (me; V : Real) returns Curve;
273 ---Purpose : Computes the U isoparametric curve of this surface
274 -- of revolution. It is the curve obtained by rotating the
275 -- meridian through an angle U about the axis of revolution.
278 D0 (me; U, V : Real; P : out Pnt);
279 ---Purpose : Computes the point P (U, V) on the surface.
280 -- U is the angle of the rotation around the revolution axis.
281 -- The direction of this axis gives the sense of rotation.
282 -- V is the parameter of the revolved curve.
285 D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec)
287 -- Computes the current point and the first derivatives
288 -- in the directions U and V.
289 raises UndefinedDerivative;
290 ---Purpose : Raised if the continuity of the surface is not C1.
293 D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec)
295 -- Computes the current point, the first and the second derivatives
296 -- in the directions U and V.
297 raises UndefinedDerivative;
298 ---Purpose : Raised if the continuity of the surface is not C2.
301 D3 (me; U, V : Real; P : out Pnt;
302 D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec)
304 -- Computes the current point, the first,the second and the third
305 -- derivatives in the directions U and V.
306 raises UndefinedDerivative;
307 ---Purpose : Raised if the continuity of the surface is not C3.
310 DN (me; U, V : Real; Nu, Nv : Integer)
312 -- Computes the derivative of order Nu in the direction u and
313 -- Nv in the direction v.
315 raises UndefinedDerivative,
317 -- Raised if the continuity of the surface is not CNu in the u
318 -- direction and CNv in the v direction.
320 ---Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
324 ---Purpose : The following functions evaluates the local
325 -- derivatives on surface. Useful to manage discontinuities
327 -- if Side = 1 -> P = S( U+,V )
328 -- if Side = -1 -> P = S( U-,V )
329 -- else P is betveen discontinuities
330 -- can be evaluated using methods of
331 -- global evaluations P = S( U ,V )
333 LocalD0 (me; U, V : Real; USide : Integer;
336 LocalD1 (me; U, V : Real; USide : Integer;
337 P : out Pnt; D1U, D1V : out Vec);
339 LocalD2 (me; U, V : Real; USide : Integer;
340 P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec);
342 LocalD3 (me; U, V : Real; USide : Integer;
343 P : out Pnt; D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV :
346 LocalDN (me; U, V : Real; USide : Integer;
350 Transform (me : mutable; T : Trsf);
351 ---Purpose: Applies the transformation T to this surface of revolution.
352 Copy (me) returns like me;
353 ---Purpose: Creates a new object which is a copy of this surface of revolution.