b311480e |
1 | -- Created on: 1993-07-21 |
2 | -- Created by: Remi LEQUETTE |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class MakeTorus from BRepPrimAPI inherits MakeOneAxis from BRepPrimAPI |
18 | |
19 | ---Purpose: Describes functions to build tori or portions of tori. |
20 | -- A MakeTorus object provides a framework for: |
21 | -- - defining the construction of a torus, |
22 | -- - implementing the construction algorithm, and |
23 | -- - consulting the result. |
24 | |
25 | uses |
26 | Ax2 from gp, |
27 | Torus from BRepPrim, |
28 | OneAxis from BRepPrim |
29 | |
30 | raises |
31 | DomainError from Standard |
32 | |
33 | is |
34 | |
35 | Create(R1, R2 : Real) |
36 | returns MakeTorus from BRepPrimAPI |
37 | ---Purpose: Make a torus of radii R1 R2. |
38 | ---Level: Public |
39 | raises |
40 | DomainError from Standard; -- if R <= Precision::Confusion() |
41 | |
42 | Create(R1, R2, angle : Real) |
43 | returns MakeTorus from BRepPrimAPI |
44 | ---Purpose: Make a section of a torus of radii R1 R2. |
45 | ---Level: Public |
46 | raises |
47 | DomainError from Standard; -- if R <= Precision::Confusion() |
48 | |
49 | Create(R1, R2, angle1,angle2 : Real) |
50 | returns MakeTorus from BRepPrimAPI |
51 | ---Purpose: Make a torus of radii R2, R2 with angles on the |
52 | -- small circle. |
53 | ---Level: Public |
54 | raises |
55 | DomainError from Standard; -- if R <= Precision::Confusion() |
56 | |
57 | Create(R1, R2, angle1,angle2,angle : Real) |
58 | returns MakeTorus from BRepPrimAPI |
59 | ---Purpose: Make a torus of radii R2, R2 with angles on the |
60 | -- small circle. |
61 | ---Level: Public |
62 | raises |
63 | DomainError from Standard; -- if R <= Precision::Confusion() |
64 | |
65 | Create(Axes : Ax2 from gp; R1, R2 : Real) |
66 | returns MakeTorus from BRepPrimAPI |
67 | ---Purpose: Make a torus of radii R1 R2. |
68 | ---Level: Public |
69 | raises |
70 | DomainError from Standard; -- if H <= Precision::Confusion() |
71 | |
72 | Create(Axes : Ax2 from gp; R1, R2, angle : Real) |
73 | returns MakeTorus from BRepPrimAPI |
74 | ---Purpose: Make a section of a torus of radii R1 R2. |
75 | ---Level: Public |
76 | raises |
77 | DomainError from Standard; -- if H <= Precision::Confusion() |
78 | |
79 | Create(Axes : Ax2 from gp; R1, R2, angle1, angle2 : Real) |
80 | returns MakeTorus from BRepPrimAPI |
81 | ---Purpose: Make a torus of radii R1 R2. |
82 | ---Level: Public |
83 | raises |
84 | DomainError from Standard; -- if H <= Precision::Confusion() |
85 | |
86 | Create(Axes : Ax2 from gp; R1, R2, angle1, angle2, angle : Real) |
87 | returns MakeTorus from BRepPrimAPI |
88 | ---Purpose: Make a section of a torus of radii R1 R2. |
89 | ---Level: Public |
90 | raises |
91 | DomainError from Standard; -- if H <= Precision::Confusion() |
92 | |
93 | ---Purpose: For all algorithms The resulting shape is composed of |
94 | -- - a lateral toroidal face, |
95 | -- - two conical faces (defined by the equation v = angle1 and |
96 | -- v = angle2) if the sphere is truncated in the v parametric |
97 | -- direction (they may be cylindrical faces in some |
98 | -- particular conditions), and in case of a portion |
99 | -- of torus, two planar faces to close the shape.(in the planes |
100 | -- u = 0 and u = angle). |
101 | -- Notes: |
102 | -- - The u parameter corresponds to a rotation angle around the Z axis. |
103 | -- - The circle whose radius is equal to the minor radius, |
104 | -- located in the plane defined by the X axis and the Z axis, |
105 | -- centered on the X axis, on its positive side, and positioned |
106 | -- at a distance from the origin equal to the major radius, is |
107 | -- the reference circle of the torus. The rotation around an |
108 | -- axis parallel to the Y axis and passing through the center |
109 | -- of the reference circle gives the v parameter on the |
110 | -- reference circle. The X axis gives the origin of the v |
111 | -- parameter. Near 0, as v increases, the Z coordinate decreases. |
112 | |
113 | |
114 | OneAxis(me : in out) returns Address; |
115 | ---Purpose: Returns the algorithm. |
116 | ---Level: Advanced |
117 | |
118 | Torus(me : in out) returns Torus from BRepPrim |
119 | ---Purpose: Returns the algorithm. |
120 | -- |
121 | ---C++: return & |
122 | ---Level: Public |
123 | is static; |
124 | |
125 | |
126 | fields |
127 | myTorus : Torus from BRepPrim; |
128 | |
129 | end MakeTorus; |