7fd59977 |
1 | -- File: MakeCone.cdl |
2 | -- Created: Mon Sep 28 11:51:45 1992 |
3 | -- Author: Remi GILET |
4 | -- <reg@sdsun2> |
5 | ---Copyright: Matra Datavision 1992 |
6 | |
7 | class MakeConicalSurface from GC inherits Root from GC |
8 | |
9 | ---Purpose : This class implements the following algorithms used |
10 | -- to create a ConicalSurface from Geom. |
11 | -- * Create a ConicalSurface parallel to another and passing |
12 | -- through a point. |
13 | -- * Create a ConicalSurface parallel to another at a distance |
14 | -- <Dist>. |
15 | -- * Create a ConicalSurface by 4 points. |
16 | -- * Create a ConicalSurface by its axis and 2 points. |
17 | -- * Create a ConicalSurface by 2 points and 2 radius. |
18 | -- The local coordinate system of the ConicalSurface is defined |
19 | -- with an axis placement (see class ElementarySurface). |
20 | -- |
21 | -- The "ZAxis" is the symmetry axis of the ConicalSurface, |
22 | -- it gives the direction of increasing parametric value V. |
23 | -- The apex of the surface is on the negative side of this axis. |
24 | -- |
25 | -- The parametrization range is : |
26 | -- U [0, 2*PI], V ]-infinite, + infinite[ |
27 | -- |
28 | -- The "XAxis" and the "YAxis" define the placement plane of the |
29 | -- surface (Z = 0, and parametric value V = 0) perpendicular to |
30 | -- the symmetry axis. The "XAxis" defines the origin of the |
31 | -- parameter U = 0. The trigonometric sense gives the positive |
32 | -- orientation for the parameter U. |
33 | -- |
34 | -- When you create a ConicalSurface the U and V directions of |
35 | -- parametrization are such that at each point of the surface the |
36 | -- normal is oriented towards the "outside region". |
37 | |
38 | uses Pnt from gp, |
39 | Ax1 from gp, |
40 | Ax2 from gp, |
41 | Lin from gp, |
42 | Cone from gp, |
43 | ConicalSurface from Geom, |
44 | Real from Standard |
45 | |
46 | raises NotDone from StdFail |
47 | |
48 | is |
49 | |
50 | Create (A2 : Ax2 from gp ; |
51 | Ang : Real from Standard; |
52 | Radius : Real from Standard) returns MakeConicalSurface; |
53 | --- Purpose : |
54 | -- A2 defines the local coordinate system of the conical surface. |
55 | -- Ang is the conical surface semi-angle ]0, PI/2[. |
56 | -- Radius is the radius of the circle Viso in the placement plane |
57 | -- of the conical surface defined with "XAxis" and "YAxis". |
58 | -- The "ZDirection" of A2 defines the direction of the surface's |
59 | -- axis of symmetry. |
60 | -- If the location point of A2 is the apex of the surface |
61 | -- Radius = 0 . |
62 | -- At the creation the parametrization of the surface is defined |
63 | -- such that the normal Vector (N = D1U ^ D1V) is oriented towards |
64 | -- the "outside region" of the surface. |
65 | -- Status is "NegativeRadius" if Radius < 0.0 or "BadAngle" if |
66 | -- Ang < Resolution from gp or Ang >= PI/ - Resolution |
67 | |
68 | Create (C : Cone from gp) returns MakeConicalSurface; |
69 | --- Purpose : Creates a ConicalSurface from a non persistent Cone from package gp. |
70 | |
71 | Create(Cone : Cone from gp; |
72 | Point : Pnt from gp) returns MakeConicalSurface; |
73 | ---Purpose : Make a ConicalSurface from Geom <TheCone> parallel to another |
74 | -- ConicalSurface <Cone> and passing through a Pnt <Point>. |
75 | |
76 | Create(Cone : Cone from gp ; |
77 | Dist : Real from Standard) returns MakeConicalSurface; |
78 | ---Purpose : Make a ConicalSurface from Geom <TheCone> parallel to another |
79 | -- ConicalSurface <Cone> at the distance <Dist> which can |
80 | -- be greater or lower than zero. |
81 | |
82 | Create(P1 : Pnt from gp; |
83 | P2 : Pnt from gp; |
84 | P3 : Pnt from gp; |
85 | P4 : Pnt from gp) returns MakeConicalSurface; |
86 | ---Purpose : Make a ConicalSurface from Geom <TheCone> passing through 3 |
87 | -- Pnt <P1>,<P2>,<P3>. |
88 | -- Its axis is <P1P2> and the radius of its base is |
89 | -- the distance between <P3> and <P1P2>. |
90 | -- The distance between <P4> and <P1P2> is the radius of |
91 | -- the section passing through <P4>. |
92 | -- An error iss raised if <P1>,<P2>,<P3>,<P4> are |
93 | -- colinear or if <P3P4> is perpendicular to <P1P2> or |
94 | -- <P3P4> is colinear to <P1P2>. |
95 | |
96 | Create(Axis : Ax1 from gp; |
97 | P1,P2 : Pnt from gp) returns MakeConicalSurface; |
98 | ---Purpose: Make a ConicalSurface by its axis <Axis> and and two points. |
99 | |
100 | Create(Axis : Lin from gp; |
101 | P1,P2 : Pnt from gp) returns MakeConicalSurface; |
102 | ---Purpose: Make a ConicalSurface by its axis <Axis> and and two points. |
103 | |
104 | Create(P1 : Pnt from gp ; |
105 | P2 : Pnt from gp ; |
106 | R1 : Real from Standard; |
107 | R2 : Real from Standard) returns MakeConicalSurface; |
108 | ---Purpose: Make a ConicalSurface with two points and two radius. |
109 | -- The axis of the solution is the line passing through |
110 | -- <P1> and <P2>. |
111 | -- <R1> is the radius of the section passing through <P1> |
112 | -- and <R2> the radius of the section passing through <P2>. |
113 | |
114 | Value(me) returns ConicalSurface from Geom |
115 | raises NotDone |
116 | is static; |
117 | ---Purpose: Returns the constructed cone. |
118 | -- Exceptions |
119 | -- StdFail_NotDone if no cone is constructed. |
120 | ---C++: return const& |
121 | |
122 | Operator(me) returns ConicalSurface from Geom |
123 | is static; |
124 | ---C++: return const& |
125 | ---C++: alias "Standard_EXPORT operator Handle_Geom_ConicalSurface() const;" |
126 | |
127 | fields |
128 | |
129 | TheCone : ConicalSurface from Geom; |
130 | --The solution from Geom. |
131 | |
132 | end MakeConicalSurface; |