1 -- Created on: 1993-03-10
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 class ConicalSurface from Geom inherits ElementarySurface from Geom
25 ---Purpose : Describes a cone.
26 -- A cone is defined by the half-angle at its apex, and
27 -- is positioned in space by a coordinate system (a
28 -- gp_Ax3 object) and a reference radius as follows:
29 -- - The "main Axis" of the coordinate system is the
30 -- axis of revolution of the cone.
31 -- - The plane defined by the origin, the "X Direction"
32 -- and the "Y Direction" of the coordinate system is
33 -- the reference plane of the cone. The intersection
34 -- of the cone with this reference plane is a circle of
35 -- radius equal to the reference radius.
36 -- - The apex of the cone is on the negative side of
37 -- the "main Axis" of the coordinate system if the
38 -- half-angle is positive, and on the positive side if
39 -- the half-angle is negative.
40 -- This coordinate system is the "local coordinate
41 -- system" of the cone. The following apply:
42 -- - Rotation around its "main Axis", in the
43 -- trigonometric sense given by the "X Direction"
44 -- and the "Y Direction", defines the u parametric direction.
45 -- - Its "X Axis" gives the origin for the u parameter.
46 -- - Its "main Direction" is the v parametric direction of the cone.
47 -- - Its origin is the origin of the v parameter.
48 -- The parametric range of the two parameters is:
49 -- - [ 0, 2.*Pi ] for u, and - ] -infinity, +infinity [ for v
50 -- The parametric equation of the cone is: P(u, v) =
51 -- O + (R + v*sin(Ang)) * (cos(u)*XDir + sin(u)*YDir) + v*cos(Ang)*ZDir where:
52 -- - O, XDir, YDir and ZDir are respectively
53 -- the origin, the "X Direction", the "Y Direction" and
54 -- the "Z Direction" of the cone's local coordinate system,
55 -- - Ang is the half-angle at the apex of the cone, and
56 -- - R is the reference radius.
68 raises ConstructionError from Standard,
69 RangeError from Standard
73 Create (A3 : Ax3; Ang : Real; Radius : Real)
74 returns mutable ConicalSurface
76 -- A3 defines the local coordinate system of the conical surface.
77 -- Ang is the conical surface semi-angle ]0, PI/2[.
78 -- Radius is the radius of the circle Viso in the placement plane
79 -- of the conical surface defined with "XAxis" and "YAxis".
80 -- The "ZDirection" of A3 defines the direction of the surface's
82 -- If the location point of A3 is the apex of the surface
84 -- At the creation the parametrization of the surface is defined
85 -- such that the normal Vector (N = D1U ^ D1V) is oriented towards
86 -- the "outside region" of the surface.
87 raises ConstructionError;
89 -- Raised if Radius < 0.0 or Ang < Resolution from gp or
90 -- Ang >= PI/2 - Resolution
93 Create (C : Cone) returns mutable ConicalSurface;
95 -- Creates a ConicalSurface from a non transient Cone from
99 SetCone (me : mutable; C : Cone);
101 -- Set <me> so that <me> has the same geometric properties as C.
104 SetRadius (me : mutable; R : Real)
106 -- Changes the radius of the conical surface in the placement
107 -- plane (Z = 0, V = 0). The local coordinate system is not
109 raises ConstructionError;
110 ---Purpose : Raised if R < 0.0
113 SetSemiAngle (me : mutable; Ang : Real)
115 -- Changes the semi angle of the conical surface.
116 raises ConstructionError;
118 -- Raised if Ang < Resolution or Ang >= PI/2 - Resolution
121 Cone (me) returns Cone;
123 -- returns a non transient cone with the same geometric properties
127 UReversedParameter (me; U : Real ) returns Real;
128 ---Purpose: return 2.PI - U.
131 VReversedParameter (me; V : Real ) returns Real;
132 ---Purpose: Computes the u (or v) parameter on the modified
133 -- surface, when reversing its u (or v) parametric
134 -- direction, for any point of u parameter U (or of v
135 -- parameter V) on this cone.
136 -- In the case of a cone, these functions return respectively:
140 VReverse (me : mutable)
141 ---Purpose : Changes the orientation of this cone in the v
142 -- parametric direction. The bounds of the surface are
143 -- not changed but the v parametric direction is reversed.
144 -- As a consequence, for a cone:
145 -- - the "main Direction" of the local coordinate system
147 -- - the half-angle at the apex is inverted.
150 TransformParameters(me; U,V : in out Real; T : Trsf from gp)
151 ---Purpose: Computes the parameters on the transformed surface for
152 -- the transform of the point of parameters U,V on <me>.
154 -- me->Transformed(T)->Value(U',V')
156 -- is the same point as
158 -- me->Value(U,V).Transformed(T)
160 -- Where U',V' are the new values of U,V after calling
162 -- me->TranformParameters(U,V,T)
164 -- This methods multiplies V by T.ScaleFactor()
167 ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp
168 ---Purpose: Returns a 2d transformation used to find the new
169 -- parameters of a point on the transformed surface.
171 -- me->Transformed(T)->Value(U',V')
173 -- is the same point as
175 -- me->Value(U,V).Transformed(T)
177 -- Where U',V' are obtained by transforming U,V with
178 -- th 2d transformation returned by
180 -- me->ParametricTransformation(T)
182 -- This methods returns a scale centered on the
183 -- U axis with T.ScaleFactor
186 Apex (me) returns Pnt;
187 ---Purpose : Computes the apex of this cone. It is on the negative
188 -- side of the axis of revolution of this cone if the
189 -- half-angle at the apex is positive, and on the positive
190 -- side of the "main Axis" if the half-angle is negative.
194 Bounds (me; U1, U2, V1, V2 : out Real);
196 -- The conical surface is infinite in the V direction so
197 -- V1 = Realfirst from Standard and V2 = RealLast.
198 -- U1 = 0 and U2 = 2*PI.
201 Coefficients (me; A1, A2, A3, B1, B2, B3, C1, C2, C3, D : out Real);
203 -- Returns the coefficients of the implicit equation of the
204 -- quadric in the absolute cartesian coordinate system :
205 -- These coefficients are normalized.
206 -- A1.X**2 + A2.Y**2 + A3.Z**2 + 2.(B1.X.Y + B2.X.Z + B3.Y.Z) +
207 -- 2.(C1.X + C2.Y + C3.Z) + D = 0.0
210 RefRadius (me) returns Real;
211 ---Purpose : Returns the reference radius of this cone.
212 -- The reference radius is the radius of the circle formed
213 -- by the intersection of this cone and its reference
214 -- plane (i.e. the plane defined by the origin, "X
215 -- Direction" and "Y Direction" of the local coordinate
216 -- system of this cone).
217 -- If the apex of this cone is on the origin of the local
218 -- coordinate system of this cone, the returned value is 0.
221 SemiAngle (me) returns Real;
223 -- returns the semi-angle of the conical surface ]0.0, PI/2[.
226 IsUClosed (me) returns Boolean;
227 ---Purpose : returns True.
230 IsVClosed (me) returns Boolean;
231 ---Purpose : returns False.
234 IsUPeriodic (me) returns Boolean;
235 ---Purpose : Returns True.
238 IsVPeriodic (me) returns Boolean;
239 ---Purpose : Returns False.
242 UIso (me; U : Real) returns mutable Curve;
243 ---Purpose : Builds the U isoparametric line of this cone. The
244 -- origin of this line is on the reference plane of this
245 -- cone (i.e. the plane defined by the origin, "X Direction"
246 -- and "Y Direction" of the local coordinate system of this cone).
249 VIso (me; V : Real) returns mutable Curve;
250 ---Purpose : Builds the V isoparametric circle of this cone. It is the
251 -- circle on this cone, located in the plane of Z
252 -- coordinate V*cos(Semi-Angle) in the local coordinate system of this
253 -- cone. The "Axis" of this circle is the axis of revolution
254 -- of this cone. Its starting point is defined by the "X
255 -- Direction" of this cone.
257 -- If the V isoparametric circle is close to the apex of
258 -- this cone, the radius of the circle becomes very small.
259 -- It is possible to have a circle with radius equal to 0.0.
263 D0 (me; U, V : Real; P : out Pnt);
265 -- Computes the point P (U, V) on the surface.
267 -- (RefRadius + V * sin (Semi-Angle)) * (cos (U) * XDir + sin (U) * YDir) +
268 -- V * cos (Semi-Angle) * ZDir
269 -- where Loc is the origin of the placement plane (XAxis, YAxis)
270 -- XDir is the direction of the XAxis and YDir the direction of
274 D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec);
276 -- Computes the current point and the first derivatives in the
277 -- directions U and V.
280 D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec);
282 -- Computes the current point, the first and the second derivatives
283 -- in the directions U and V.
286 D3 (me; U, V : Real; P : out Pnt;
287 D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV :out Vec);
289 -- Computes the current point, the first,the second and the third
290 -- derivatives in the directions U and V.
293 DN (me; U, V : Real; Nu, Nv : Integer) returns Vec
294 ---Purpose: Computes the derivative of order Nu in the u
295 -- parametric direction, and Nv in the v parametric
296 -- direction at the point of parameters (U, V) of this cone.
298 -- Standard_RangeError if:
299 -- - Nu + Nv is less than 1,
300 -- - Nu or Nv is negative.
304 Transform (me : mutable; T : Trsf);
305 ---Purpose: Applies the transformation T to this cone.
306 Copy (me) returns mutable like me;
308 ---Purpose: Creates a new object which is a copy of this cone.