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 ConicalSurface from Geom inherits ElementarySurface from Geom
19 ---Purpose : Describes a cone.
20 -- A cone is defined by the half-angle at its apex, and
21 -- is positioned in space by a coordinate system (a
22 -- gp_Ax3 object) and a reference radius as follows:
23 -- - The "main Axis" of the coordinate system is the
24 -- axis of revolution of the cone.
25 -- - The plane defined by the origin, the "X Direction"
26 -- and the "Y Direction" of the coordinate system is
27 -- the reference plane of the cone. The intersection
28 -- of the cone with this reference plane is a circle of
29 -- radius equal to the reference radius.
30 -- - The apex of the cone is on the negative side of
31 -- the "main Axis" of the coordinate system if the
32 -- half-angle is positive, and on the positive side if
33 -- the half-angle is negative.
34 -- This coordinate system is the "local coordinate
35 -- system" of the cone. The following apply:
36 -- - Rotation around its "main Axis", in the
37 -- trigonometric sense given by the "X Direction"
38 -- and the "Y Direction", defines the u parametric direction.
39 -- - Its "X Axis" gives the origin for the u parameter.
40 -- - Its "main Direction" is the v parametric direction of the cone.
41 -- - Its origin is the origin of the v parameter.
42 -- The parametric range of the two parameters is:
43 -- - [ 0, 2.*Pi ] for u, and - ] -infinity, +infinity [ for v
44 -- The parametric equation of the cone is: P(u, v) =
45 -- O + (R + v*sin(Ang)) * (cos(u)*XDir + sin(u)*YDir) + v*cos(Ang)*ZDir where:
46 -- - O, XDir, YDir and ZDir are respectively
47 -- the origin, the "X Direction", the "Y Direction" and
48 -- the "Z Direction" of the cone's local coordinate system,
49 -- - Ang is the half-angle at the apex of the cone, and
50 -- - R is the reference radius.
62 raises ConstructionError from Standard,
63 RangeError from Standard
67 Create (A3 : Ax3; Ang : Real; Radius : Real)
68 returns ConicalSurface
70 -- A3 defines the local coordinate system of the conical surface.
71 -- Ang is the conical surface semi-angle ]0, PI/2[.
72 -- Radius is the radius of the circle Viso in the placement plane
73 -- of the conical surface defined with "XAxis" and "YAxis".
74 -- The "ZDirection" of A3 defines the direction of the surface's
76 -- If the location point of A3 is the apex of the surface
78 -- At the creation the parametrization of the surface is defined
79 -- such that the normal Vector (N = D1U ^ D1V) is oriented towards
80 -- the "outside region" of the surface.
81 raises ConstructionError;
83 -- Raised if Radius < 0.0 or Ang < Resolution from gp or
84 -- Ang >= PI/2 - Resolution
87 Create (C : Cone) returns ConicalSurface;
89 -- Creates a ConicalSurface from a non transient Cone from
93 SetCone (me : mutable; C : Cone);
95 -- Set <me> so that <me> has the same geometric properties as C.
98 SetRadius (me : mutable; R : Real)
100 -- Changes the radius of the conical surface in the placement
101 -- plane (Z = 0, V = 0). The local coordinate system is not
103 raises ConstructionError;
104 ---Purpose : Raised if R < 0.0
107 SetSemiAngle (me : mutable; Ang : Real)
109 -- Changes the semi angle of the conical surface.
110 raises ConstructionError;
112 -- Raised if Ang < Resolution or Ang >= PI/2 - Resolution
115 Cone (me) returns Cone;
117 -- returns a non transient cone with the same geometric properties
121 UReversedParameter (me; U : Real ) returns Real;
122 ---Purpose: return 2.PI - U.
125 VReversedParameter (me; V : Real ) returns Real;
126 ---Purpose: Computes the u (or v) parameter on the modified
127 -- surface, when reversing its u (or v) parametric
128 -- direction, for any point of u parameter U (or of v
129 -- parameter V) on this cone.
130 -- In the case of a cone, these functions return respectively:
134 VReverse (me : mutable)
135 ---Purpose : Changes the orientation of this cone in the v
136 -- parametric direction. The bounds of the surface are
137 -- not changed but the v parametric direction is reversed.
138 -- As a consequence, for a cone:
139 -- - the "main Direction" of the local coordinate system
141 -- - the half-angle at the apex is inverted.
144 TransformParameters(me; U,V : in out Real; T : Trsf from gp)
145 ---Purpose: Computes the parameters on the transformed surface for
146 -- the transform of the point of parameters U,V on <me>.
148 -- me->Transformed(T)->Value(U',V')
150 -- is the same point as
152 -- me->Value(U,V).Transformed(T)
154 -- Where U',V' are the new values of U,V after calling
156 -- me->TranformParameters(U,V,T)
158 -- This methods multiplies V by T.ScaleFactor()
161 ParametricTransformation(me; T : Trsf from gp) returns GTrsf2d from gp
162 ---Purpose: Returns a 2d transformation used to find the new
163 -- parameters of a point on the transformed surface.
165 -- me->Transformed(T)->Value(U',V')
167 -- is the same point as
169 -- me->Value(U,V).Transformed(T)
171 -- Where U',V' are obtained by transforming U,V with
172 -- th 2d transformation returned by
174 -- me->ParametricTransformation(T)
176 -- This methods returns a scale centered on the
177 -- U axis with T.ScaleFactor
180 Apex (me) returns Pnt;
181 ---Purpose : Computes the apex of this cone. It is on the negative
182 -- side of the axis of revolution of this cone if the
183 -- half-angle at the apex is positive, and on the positive
184 -- side of the "main Axis" if the half-angle is negative.
188 Bounds (me; U1, U2, V1, V2 : out Real);
190 -- The conical surface is infinite in the V direction so
191 -- V1 = Realfirst from Standard and V2 = RealLast.
192 -- U1 = 0 and U2 = 2*PI.
195 Coefficients (me; A1, A2, A3, B1, B2, B3, C1, C2, C3, D : out Real);
197 -- Returns the coefficients of the implicit equation of the
198 -- quadric in the absolute cartesian coordinate system :
199 -- These coefficients are normalized.
200 -- A1.X**2 + A2.Y**2 + A3.Z**2 + 2.(B1.X.Y + B2.X.Z + B3.Y.Z) +
201 -- 2.(C1.X + C2.Y + C3.Z) + D = 0.0
204 RefRadius (me) returns Real;
205 ---Purpose : Returns the reference radius of this cone.
206 -- The reference radius is the radius of the circle formed
207 -- by the intersection of this cone and its reference
208 -- plane (i.e. the plane defined by the origin, "X
209 -- Direction" and "Y Direction" of the local coordinate
210 -- system of this cone).
211 -- If the apex of this cone is on the origin of the local
212 -- coordinate system of this cone, the returned value is 0.
215 SemiAngle (me) returns Real;
217 -- returns the semi-angle of the conical surface ]0.0, PI/2[.
220 IsUClosed (me) returns Boolean;
221 ---Purpose : returns True.
224 IsVClosed (me) returns Boolean;
225 ---Purpose : returns False.
228 IsUPeriodic (me) returns Boolean;
229 ---Purpose : Returns True.
232 IsVPeriodic (me) returns Boolean;
233 ---Purpose : Returns False.
236 UIso (me; U : Real) returns Curve;
237 ---Purpose : Builds the U isoparametric line of this cone. The
238 -- origin of this line is on the reference plane of this
239 -- cone (i.e. the plane defined by the origin, "X Direction"
240 -- and "Y Direction" of the local coordinate system of this cone).
243 VIso (me; V : Real) returns Curve;
244 ---Purpose : Builds the V isoparametric circle of this cone. It is the
245 -- circle on this cone, located in the plane of Z
246 -- coordinate V*cos(Semi-Angle) in the local coordinate system of this
247 -- cone. The "Axis" of this circle is the axis of revolution
248 -- of this cone. Its starting point is defined by the "X
249 -- Direction" of this cone.
251 -- If the V isoparametric circle is close to the apex of
252 -- this cone, the radius of the circle becomes very small.
253 -- It is possible to have a circle with radius equal to 0.0.
257 D0 (me; U, V : Real; P : out Pnt);
259 -- Computes the point P (U, V) on the surface.
261 -- (RefRadius + V * sin (Semi-Angle)) * (cos (U) * XDir + sin (U) * YDir) +
262 -- V * cos (Semi-Angle) * ZDir
263 -- where Loc is the origin of the placement plane (XAxis, YAxis)
264 -- XDir is the direction of the XAxis and YDir the direction of
268 D1 (me; U, V : Real; P : out Pnt; D1U, D1V : out Vec);
270 -- Computes the current point and the first derivatives in the
271 -- directions U and V.
274 D2 (me; U, V : Real; P : out Pnt; D1U, D1V, D2U, D2V, D2UV : out Vec);
276 -- Computes the current point, the first and the second derivatives
277 -- in the directions U and V.
280 D3 (me; U, V : Real; P : out Pnt;
281 D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV :out Vec);
283 -- Computes the current point, the first,the second and the third
284 -- derivatives in the directions U and V.
287 DN (me; U, V : Real; Nu, Nv : Integer) returns Vec
288 ---Purpose: Computes the derivative of order Nu in the u
289 -- parametric direction, and Nv in the v parametric
290 -- direction at the point of parameters (U, V) of this cone.
292 -- Standard_RangeError if:
293 -- - Nu + Nv is less than 1,
294 -- - Nu or Nv is negative.
298 Transform (me : mutable; T : Trsf);
299 ---Purpose: Applies the transformation T to this cone.
300 Copy (me) returns like me;
302 ---Purpose: Creates a new object which is a copy of this cone.