0023024: Update headers of OCCT files
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_MakeFace.cdl
CommitLineData
b311480e 1-- Created on: 1993-07-12
2-- Created by: Remi LEQUETTE
3-- Copyright (c) 1993-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
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.
10--
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.
13--
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.
20
7fd59977 21-- xab: 29Nov96 correction de doc
7fd59977 22
23
24class MakeFace from BRepBuilderAPI inherits MakeShape from BRepBuilderAPI
25
26 ---Purpose: Provides methods to build faces.
27 --
28 -- A face may be built :
29 --
30 -- * From a surface.
31 --
32 -- - Elementary surface from gp.
33 --
34 -- - Surface from Geom.
35 --
36 -- * From a surface and U,V values.
37 --
38 -- * From a wire.
39 --
40 -- - Find the surface automatically if possible.
41 --
42 -- * From a surface and a wire.
43 --
44 -- - A flag Inside is given, when this flag is True
45 -- the wire is oriented to bound a finite area on
46 -- the surface.
47 --
48 -- * From a face and a wire.
49 --
50 -- - The new wire is a perforation.
51
52uses
53 Pln from gp,
54 Cylinder from gp,
55 Cone from gp,
56 Sphere from gp,
57 Torus from gp,
58 Surface from Geom,
59 Face from TopoDS,
60 Wire from TopoDS,
61 FaceError from BRepBuilderAPI,
62 MakeFace from BRepLib
63
64raises
65 NotDone from StdFail
66
67is
68
69 Create
70 ---Purpose: Not done.
71 ---Level: Public
72 returns MakeFace from BRepBuilderAPI;
73
74 Create(F : Face from TopoDS)
75 ---Purpose: Load a face. Usefull to add wires.
76 ---Level: Public
77 returns MakeFace from BRepBuilderAPI;
78
79 ----------------------------------------------
80 -- From a surface
81 ----------------------------------------------
82
83 Create(P : Pln from gp)
84 ---Purpose: Make a face from a plane.
85 ---Level: Public
86 returns MakeFace from BRepBuilderAPI;
87
88 Create(C : Cylinder from gp)
89 ---Purpose: Make a face from a cylinder.
90 ---Level: Public
91 returns MakeFace from BRepBuilderAPI;
92
93 Create(C : Cone from gp)
94 ---Purpose: Make a face from a cone.
95 ---Level: Public
96 returns MakeFace from BRepBuilderAPI;
97
98 Create(S : Sphere from gp)
99 ---Purpose: Make a face from a sphere.
100 ---Level: Public
101 returns MakeFace from BRepBuilderAPI;
102
103 Create(C : Torus from gp)
104 ---Purpose: Make a face from a torus.
105 ---Level: Public
106 returns MakeFace from BRepBuilderAPI;
107
1c72dff6
S
108 Create(S : Surface from Geom; TolDegen : Real)
109 ---Purpose: Make a face from a Surface. Accepts tolerance value (TolDegen)
110 -- for resolution of degenerated edges.
111 ---Level: Public
7fd59977 112 returns MakeFace from BRepBuilderAPI;
113
114 ----------------------------------------------
115 -- From a surface and U,V values
116 ----------------------------------------------
117
118 Create(P : Pln from gp; UMin, UMax, VMin, VMax : Real)
119 ---Purpose: Make a face from a plane.
120 ---Level: Public
121 returns MakeFace from BRepBuilderAPI;
122
123 Create(C : Cylinder from gp; UMin, UMax, VMin, VMax : Real)
124 ---Purpose: Make a face from a cylinder.
125 ---Level: Public
126 returns MakeFace from BRepBuilderAPI;
127
128 Create(C : Cone from gp; UMin, UMax, VMin, VMax : Real)
129 ---Purpose: Make a face from a cone.
130 ---Level: Public
131 returns MakeFace from BRepBuilderAPI;
132
133 Create(S : Sphere from gp; UMin, UMax, VMin, VMax : Real)
134 ---Purpose: Make a face from a sphere.
135 ---Level: Public
136 returns MakeFace from BRepBuilderAPI;
137
138 Create(C : Torus from gp; UMin, UMax, VMin, VMax : Real)
139 ---Purpose: Make a face from a torus.
140 ---Level: Public
141 returns MakeFace from BRepBuilderAPI;
142
1c72dff6
S
143 Create(S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : Real)
144 ---Purpose: Make a face from a Surface. Accepts tolerance value (TolDegen)
145 -- for resolution of degenerated edges.
146 ---Level: Public
7fd59977 147 returns MakeFace from BRepBuilderAPI;
148
149 ----------------------------------------------
150 -- From a wire
151 ----------------------------------------------
152
153 Create(W : Wire from TopoDS;
154 OnlyPlane : Boolean from Standard = Standard_False)
155 ---Purpose: Find a surface from the wire and make a face.
156 -- if <OnlyPlane> is true, the computed surface will be
157 -- a plane. If it is not possible to find a plane, the
158 -- flag NotDone will be set.
159 ---Level: Public
160 returns MakeFace from BRepBuilderAPI;
161
162 ----------------------------------------------
163 -- From a surface and a wire
164 ----------------------------------------------
165
166 Create(P : Pln from gp; W : Wire from TopoDS;
167 Inside : Boolean = Standard_True)
168 ---Purpose: Make a face from a plane and a wire.
169 ---Level: Public
170 returns MakeFace from BRepBuilderAPI;
171
172 Create(C : Cylinder from gp; W : Wire from TopoDS;
173 Inside : Boolean = Standard_True)
174 ---Purpose: Make a face from a cylinder and a wire.
175 ---Level: Public
176 returns MakeFace from BRepBuilderAPI;
177
178 Create(C : Cone from gp; W : Wire from TopoDS;
179 Inside : Boolean = Standard_True)
180 ---Purpose: Make a face from a cone and a wire.
181 ---Level: Public
182 returns MakeFace from BRepBuilderAPI;
183
184 Create(S : Sphere from gp; W : Wire from TopoDS;
185 Inside : Boolean = Standard_True)
186 ---Purpose: Make a face from a sphere and a wire.
187 ---Level: Public
188 returns MakeFace from BRepBuilderAPI;
189
190 Create(C : Torus from gp; W : Wire from TopoDS;
191 Inside : Boolean = Standard_True)
192 ---Purpose: Make a face from a torus and a wire.
193 ---Level: Public
194 returns MakeFace from BRepBuilderAPI;
195
196 Create(S : Surface from Geom; W : Wire from TopoDS;
197 Inside : Boolean = Standard_True)
198 ---Purpose: Make a face from a Surface and a wire.
199 ---Level: Public
200 returns MakeFace from BRepBuilderAPI;
201
202 ----------------------------------------------
203 -- From face and wire.
204 ----------------------------------------------
205
206 Create(F : Face from TopoDS; W : Wire from TopoDS)
207 ---Purpose: Adds the wire <W> in the face <F>
208 ---Level: Public
209 returns MakeFace from BRepBuilderAPI;
210
211 ---Purpose: A general method to create a face is to give
212 -- - a surface S as the support (the geometric domain) of the face,
213 -- - and a wire W to bound it.
214 -- The bounds of the face can also be defined by four parameter values
215 -- umin, umax, vmin, vmax which determine isoparametric limitations on
216 -- the parametric space of the surface. In this way, a patch is
217 -- defined. The parameter values are optional. If they are omitted, the
218 -- natural bounds of the surface are used. A wire is automatically
219 -- built using the defined bounds. Up to four edges and four vertices
220 -- are created with this wire (no edge is created when the
221 -- corresponding parameter value is infinite).
222 -- Wires can then be added using the function Add to define other
223 -- restrictions on the face. These restrictions represent holes. More
224 -- than one wire may be added by this way, provided that the wires do
225 -- not cross each other and that they define only one area on the
226 -- surface. (Be careful, however, as this is not checked).
227 -- Forbidden addition of wires
228 -- Note that in this schema, the third case is valid if edges of the
229 -- wire W are declared internal to the face. As a result, these edges
230 -- are no longer bounds of the face.
231 -- A default tolerance (Precision::Confusion()) is given to the face,
232 -- this tolerance may be increased during construction of the face
233 -- using various algorithms.
234 -- Rules applied to the arguments
235 -- For the surface:
236 -- - The surface must not be a 'null handle'.
237 -- - If the surface is a trimmed surface, the basis surface is used.
238 -- - For the wire: the wire is composed of connected edges, each
239 -- edge having a parametric curve description in the parametric
240 -- domain of the surface; in other words, as a pcurve.
241 -- For the parameters:
242 -- - The parameter values must be in the parametric range of the
243 -- surface (or the basis surface, if the surface is trimmed). If this
244 -- condition is not satisfied, the face is not built, and the Error
245 -- function will return BRepBuilderAPI_ParametersOutOfRange.
246 -- - The bounding parameters p1 and p2 are adjusted on a periodic
247 -- surface in a given parametric direction by adding or subtracting
248 -- the period to obtain p1 in the parametric range of the surface and
249 -- such p2, that p2 - p1 <= Period, where Period is the period of the
250 -- surface in this parametric direction.
251 -- - A parameter value may be infinite. There will be no edge and
252 -- no vertex in the corresponding direction.
253
254
255 Init(me : in out; F : Face from TopoDS)
256 ---Purpose: Initializes (or reinitializes) the
257 -- construction of a face by creating a new object which is a copy of
258 -- the face F, in order to add wires to it, using the function Add.
259 -- Note: this complete copy of the geometry is only required if you
260 -- want to work on the geometries of the two faces independently.
261 is static;
262
1c72dff6
S
263 Init(me : in out; S : Surface from Geom; Bound : Boolean; TolDegen : Real)
264 ---Purpose: Initializes (or reinitializes) the construction of a face on
265 -- the surface S. If Bound is true, a wire is
266 -- automatically created from the natural bounds of the
267 -- surface S and added to the face in order to bound it. If
268 -- Bound is false, no wire is added. This option is used
269 -- when real bounds are known. These will be added to
270 -- the face after this initialization, using the function Add.
271 -- TolDegen parameter is used for resolution of degenerated edges
272 -- if calculation of natural bounds is turned on.
273 is static;
274
275 Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : Real)
276 ---Purpose: Initializes (or reinitializes) the construction of a face on
277 -- the surface S, limited in the u parametric direction by
278 -- the two parameter values UMin and UMax and in the
279 -- v parametric direction by the two parameter values VMin and VMax.
280 -- Warning
281 -- Error returns:
282 -- - BRepBuilderAPI_ParametersOutOfRange
283 -- when the parameters given are outside the bounds of the
284 -- surface or the basis surface of a trimmed surface.
285 -- TolDegen parameter is used for resolution of degenerated edges.
7fd59977 286 is static;
287
288 Add(me : in out; W : Wire from TopoDS)
289 ---Purpose: Adds the wire W to the constructed face as a hole.
290 -- Warning
291 -- W must not cross the other bounds of the face, and all
292 -- the bounds must define only one area on the surface.
293 -- (Be careful, however, as this is not checked.)
294 -- Example
295 -- // a cylinder
296 -- gp_Cylinder C = ..;
297 -- // a wire
298 -- TopoDS_Wire W = ...;
299 -- BRepBuilderAPI_MakeFace MF(C);
300 -- MF.Add(W);
301 -- TopoDS_Face F = MF;
302 is static;
303
304
305 ----------------------------------------------
306 -- Results
307 ----------------------------------------------
308
309 IsDone(me) returns Boolean
310 ---Purpose: Returns true if this algorithm has a valid face.
311 is redefined;
312
313 Error(me) returns FaceError from BRepBuilderAPI
314 ---Purpose: Returns the construction status
315 -- BRepBuilderAPI_FaceDone if the face is built, or
316 -- - another value of the BRepBuilderAPI_FaceError
317 -- enumeration indicating why the construction failed, in
318 -- particular when the given parameters are outside the
319 -- bounds of the surface.
320 is static;
321
322 Face(me) returns Face from TopoDS
323 ---C++: return const &
324 ---C++: alias "Standard_EXPORT operator TopoDS_Face() const;"
325 ---Purpose: Returns the constructed face.
326 -- Exceptions
327 -- StdFail_NotDone if no face is built.
328 raises
329 NotDone from StdFail
330 is static;
331
332fields
333 myMakeFace : MakeFace from BRepLib;
334
335end MakeFace;