0024624: Lost word in license statement in source files
[occt.git] / src / BRepFilletAPI / BRepFilletAPI_MakeFillet.cdl
CommitLineData
b311480e 1-- Created on: 1994-06-17
2-- Created by: Modeling
3-- Copyright (c) 1994-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
17class MakeFillet from BRepFilletAPI inherits LocalOperation from BRepFilletAPI
18
19 ---Purpose: Describes functions to build fillets on the broken edges of a shell or solid.
20 -- A MakeFillet object provides a framework for:
21 -- - initializing the construction algorithm with a given shape,
22 -- - acquiring the data characterizing the fillets,
23 -- - building the fillets and constructing the resulting shape, and
24 -- - consulting the result.
25
26
27uses
28
29 Array1OfPnt2d from TColgp,
30 Shape from GeomAbs,
31 Surface from Geom ,
32 Shape from TopoDS,
33 Face from TopoDS,
34 Edge from TopoDS,
35 Vertex from TopoDS,
36 Function from Law,
37 ListOfShape from TopTools,
38 SecHArray1 from ChFiDS,
39 ErrorStatus from ChFiDS,
40 FilBuilder from ChFi3d,
41 FilletShape from ChFi3d,
42 HBuilder from TopOpeBRepBuild,
43 MapOfShape from TopTools,
44 ShapeModification from BRepBuilderAPI
45
46raises
47 NotDone from StdFail ,
48 NoSuchObject from Standard
49is
50
51 Create(S : Shape from TopoDS;
52 FShape: FilletShape from ChFi3d = ChFi3d_Rational)
53 ---Purpose: Initializes the computation of the fillets.
54 -- <FShape> sets the type of fillet surface. The
55 -- default value is ChFi3d_Rational (classical nurbs
56 -- representation of circles). ChFi3d_QuasiAngular
57 -- corresponds to a nurbs representation of circles
58 -- which parameterisation matches the circle one.
59 -- ChFi3d_Polynomial corresponds to a polynomial
60 -- representation of circles.
61 ---Level: Public
62 returns MakeFillet from BRepFilletAPI;
63
64 SetParams(me : in out;
65 Tang, Tesp, T2d, TApp3d, TolApp2d, Fleche: Real from Standard)
66 ---Level: Advanced
67 is static;
68
69 SetContinuity(me : in out;
70 InternalContinuity : Shape from GeomAbs;
71 AngularTolerance : Real);
72 ---Purpose: Changes the parameters of continiuity
73 -- InternalContinuity to produce fillet'surfaces with
74 -- an continuity Ci (i=0,1 or 2).
75 -- By defaultInternalContinuity = GeomAbs_C1.
76 -- AngularTolerance is the G1 tolerance between fillet
77 -- and support'faces.
78
79
80
81 Add(me : in out; E : Edge from TopoDS)
82 ---Purpose: Adds a fillet contour in the builder (builds a
83 -- contour of tangent edges).
84 -- The Radius must be set after.
85 --
86 ---Level: Public
87 is static;
88
89 Add(me : in out; Radius : Real; E : Edge from TopoDS)
90 ---Purpose: Adds a fillet description in the builder
91 -- - builds a contour of tangent edges,
92 -- - sets the radius.
93 --
94 ---Level: Public
95 is static;
96
97 Add(me : in out; R1,R2 : Real; E : Edge from TopoDS)
98 ---Purpose: Adds a fillet description in the builder
99 -- - builds a contour of tangent edges,
100 -- - sets a linear radius evolution law between
101 -- the first and last vertex of the spine.
102 --
103 ---Level: Public
104 is static;
105
106 Add(me : in out; L : Function from Law; E : Edge from TopoDS)
107 ---Purpose: Adds a fillet description in the builder
108 -- - builds a contour of tangent edges,
109 -- - sest the radius evolution law.
110 --
111 ---Level: Public
112 is static;
113
114 Add(me : in out; UandR : Array1OfPnt2d from TColgp; E : Edge from TopoDS)
115 ---Purpose: Adds a fillet description in the builder
116 -- - builds a contour of tangent edges,
117 -- - sets the radius evolution law interpolating the values
118 -- given in the array UandR :
119 --
120 -- p2d.X() = relative parameter on the spine [0,1]
121 -- p2d.Y() = value of the radius.
122 --
123 ---Level: Public
124 is static;
125
126 SetRadius(me : in out;
127 Radius : Real from Standard;
128 IC : Integer from Standard;
129 IinC : Integer from Standard)
130 ---Purpose: Sets the parameters of the fillet
131 -- along the contour of index IC generated using the Add function
132 -- in the internal data structure of
133 -- this algorithm, where Radius is the radius of the fillet.
134 is static;
135
136 SetRadius(me : in out;
137 R1,R2 : Real from Standard;
138 IC : Integer from Standard;
139 IinC : Integer from Standard)
140 ---Purpose: Sets the parameters of the fillet
141 -- along the contour of index IC generated using the Add function
142 -- in the internal data structure of this algorithm, where the radius of the
143 -- fillet evolves according to a linear evolution law defined
144 -- from R1 to R2, between the first and last vertices of the contour of index IC.
145 is static;
146
147 SetRadius(me : in out;
148 L : Function from Law;
149 IC : Integer from Standard;
150 IinC : Integer from Standard)
151 ---Purpose: Sets the parameters of the fillet
152 -- along the contour of index IC generated using the Add function
153 -- in the internal data structure of this algorithm, where the radius of the
154 -- fillet evolves according to the evolution law L, between the
155 -- first and last vertices of the contour of index IC.
156 is static;
157
158 SetRadius(me : in out;
159 UandR : Array1OfPnt2d from TColgp;
160 IC : Integer from Standard;
161 IinC : Integer from Standard)
162 ---Purpose: Sets the parameters of the fillet
163 -- along the contour of index IC generated using the Add function
164 -- in the internal data structure of this algorithm,
165 -- where the radius of the fillet evolves according to the evolution law
166 -- which interpolates the set of parameter and radius pairs given
167 -- in the array UandR as follows:
168 -- - the X coordinate of a point in UandR defines a
169 -- relative parameter on the contour (i.e. a parameter between 0 and 1),
170 -- - the Y coordinate of a point in UandR gives the
171 -- corresponding value of the radius, and the radius evolves
172 -- between the first and last vertices of the contour of index IC.
173 is static;
174
175 ResetContour(me : in out;
176 IC : Integer from Standard)
177 ---Purpose: Erases the radius information on the contour of index
178 -- IC in the internal data structure of this algorithm.
179 -- Use the SetRadius function to reset this data.
180 -- Warning
181 -- Nothing is done if IC is outside the bounds of the table of contours.
182 is static;
183
184 IsConstant(me : in out;
185 IC : Integer from Standard)
186 returns Boolean from Standard
187 ---Purpose: Returns true if the radius of the fillet along the contour of index IC
188 -- in the internal data structure of this algorithm is constant,
189 -- Warning
190 -- False is returned if IC is outside the bounds of the table
191 -- of contours or if E does not belong to the contour of index IC.
192 is static;
193
194 Radius(me : in out;
195 IC : Integer from Standard)
196 returns Real from Standard
197 ---Purpose: Returns the radius of the fillet along the contour of index IC in the
198 -- internal data structure of this algorithm
199 -- Warning
200 -- - Use this function only if the radius is constant.
201 -- - -1. is returned if IC is outside the bounds of the
202 -- table of contours or if E does not belong to the contour of index IC.
203 is static;
204
205
206 IsConstant(me : in out;
207 IC : Integer from Standard;
208 E : Edge from TopoDS)
209 returns Boolean from Standard
210 ---Purpose: Returns true if the radius of the fillet along the edge E of the
211 -- contour of index IC in the internal data structure of
212 -- this algorithm is constant.
213 -- Warning
214 -- False is returned if IC is outside the bounds of the table
215 -- of contours or if E does not belong to the contour of index IC.
216 is static;
217
218 Radius(me : in out;
219 IC : Integer from Standard;
220 E : Edge from TopoDS)
221 returns Real from Standard
222 ---Purpose: Returns the radius of the fillet along the edge E of the contour of index
223 -- IC in the internal data structure of this algorithm.
224 -- Warning
225 -- - Use this function only if the radius is constant.
226 -- - -1 is returned if IC is outside the bounds of the
227 -- table of contours or if E does not belong to the contour of index IC.
228 is static;
229
230 SetRadius(me : in out;
231 Radius : Real;
232 IC : Integer from Standard;
233 E : Edge from TopoDS)
234 ---Purpose: Assigns Radius as the radius of the fillet on the edge E
235 is static;
236
237 SetRadius(me : in out;
238 Radius : Real;
239 IC : Integer from Standard;
240 V : Vertex from TopoDS)
241 --Purpose: Assigns Radius as the radius of the fillet on the vertex V.
242 -- These two functions are only used on contours where
243 -- the radius has not been defined. They enable radius
244 -- values to be assigned locally either to points on the
245 -- contour (in particular, the first and last vertices) or to
246 -- portions of the contour. During construction of the fillet,
247 -- an interpolation using the given values is carried out.
248 -- Warning
249 -- Nothing is done if:
250 -- - the edge E does not belong to the contour of index IC, or
251 -- - IC is outside the bound of the table of contours, or
252 is static;
253
254
255
256 GetBounds(me : in out;
257 IC : Integer from Standard;
258 E : Edge from TopoDS;
259 F,L : out Real from Standard)
260 returns Boolean from Standard;
261
262 GetLaw(me : in out;
263 IC : Integer from Standard;
264 E : Edge from TopoDS)
265 returns mutable Function from Law;
266
267 SetLaw(me : in out;
268 IC : Integer from Standard;
269 E : Edge from TopoDS;
270 L : Function from Law);
271
272
273
274 ------------------------------------------------------------------
275
276 SetFilletShape(me: in out; FShape: FilletShape from ChFi3d)
277 ---Purpose: Assigns FShape as the type of fillet shape built by this algorithm.
278 is static;
279
280 GetFilletShape(me)
281 ---Purpose: Returns the type of fillet shape built by this algorithm.
282 returns FilletShape from ChFi3d
283 is static;
284
285 NbContours(me)
286 ---Purpose: Returns the number of contours generated using the
287 -- Add function in the internal data structure of this algorithm.
288 returns Integer from Standard is static;
289
290 Contour(me; E : Edge from TopoDS)
291 ---Purpose: Returns the index of the contour in the internal data
292 -- structure of this algorithm which contains the edge E of the shape.
293 -- This function returns 0 if the edge E does not belong to any contour.
294 -- Warning
295 -- This index can change if a contour is removed from the
296 -- internal data structure of this algorithm using the function Remove.
297 returns Integer from Standard is static;
298
299 NbEdges(me; I : Integer from Standard)
300 ---Purpose: Returns the number of edges in the contour of index I in
301 -- the internal data structure of this algorithm.
302 -- Warning
303 -- Returns 0 if I is outside the bounds of the table of contours.
304 returns Integer from Standard
305 is static;
306
307 Edge(me; I,J : Integer from Standard)
308 ---Purpose: Returns the edge of index J in the contour of index I in
309 -- the internal data structure of this algorithm.
310 -- Warning
311 -- Returns a null shape if:
312 -- - I is outside the bounds of the table of contours, or
313 -- - J is outside the bounds of the table of edges of the index I contour.
314 ---C++: return const &
315 returns Edge from TopoDS
316 is static;
317
318 Remove(me : in out; E : Edge from TopoDS)
319 ---Purpose: Removes the contour in the internal data structure of
320 -- this algorithm which contains the edge E of the shape.
321 -- Warning
322 -- Nothing is done if the edge E does not belong to the
323 -- contour in the internal data structure of this algorithm.
324 is static;
325
326 Length(me; IC : Integer from Standard) returns Real from Standard
327 ---Purpose: Returns the length of the contour of index IC in the
328 -- internal data structure of this algorithm.
329 -- Warning
330 -- Returns -1. if IC is outside the bounds of the table of contours.
331 is static;
332
333 FirstVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
334 ---Purpose: Returns the first vertex of the contour of index IC
335 -- in the internal data structure of this algorithm.
336 -- Warning
337 -- Returns a null shape if IC is outside the bounds of the table of contours.
338 is static;
339
340 LastVertex(me; IC : Integer from Standard) returns Vertex from TopoDS
341 ---Purpose: Returns the last vertex of the contour of index IC
342 -- in the internal data structure of this algorithm.
343 -- Warning
344 -- Returns a null shape if IC is outside the bounds of the table of contours.
345 is static;
346
347 Abscissa(me;
348 IC : Integer from Standard;
349 V : Vertex from TopoDS)
350 returns Real from Standard
351 ---Purpose: Returns the curvilinear abscissa of the vertex V on the
352 -- contour of index IC in the internal data structure of this algorithm.
353 -- Warning
354 -- Returns -1. if:
355 -- - IC is outside the bounds of the table of contours, or
356 -- - V is not on the contour of index IC.
357 is static;
358
359 RelativeAbscissa(me;
360 IC : Integer from Standard;
361 V : Vertex from TopoDS)
362 returns Real from Standard
363 ---Purpose: Returns the relative curvilinear abscissa (i.e. between 0
364 -- and 1) of the vertex V on the contour of index IC in the
365 -- internal data structure of this algorithm.
366 -- Warning
367 -- Returns -1. if:
368 -- - IC is outside the bounds of the table of contours, or
369 -- - V is not on the contour of index IC.
370 is static;
371
372 ClosedAndTangent(me; IC : Integer from Standard)
373 returns Boolean from Standard
374 ---Purpose: Returns true if the contour of index IC in the internal
375 -- data structure of this algorithm is closed and tangential
376 -- at the point of closure.
377 -- Warning
378 -- Returns false if IC is outside the bounds of the table of contours.
379 is static;
380
381 Closed(me; IC : Integer from Standard)
382 returns Boolean from Standard
383 ---Purpose: Returns true if the contour of index IC in the internal
384 -- data structure of this algorithm is closed.
385 -- Warning
386 -- Returns false if IC is outside the bounds of the table of contours.
387 is static;
388
389 Build(me : in out)
390 is redefined;
391 ---Purpose: Builds the fillets on all the contours in the internal data
392 -- structure of this algorithm and constructs the resulting shape.
393 -- Use the function IsDone to verify that the filleted shape
394 -- is built. Use the function Shape to retrieve the filleted shape.
395 -- Warning
396 -- The construction of fillets implements highly complex
397 -- construction algorithms. Consequently, there may be
398 -- instances where the algorithm fails, for example if the
399 -- data defining the radius of the fillet is not compatible
400 -- with the geometry of the initial shape. There is no initial
401 -- analysis of errors and they only become evident at the
402 -- construction stage.
403 -- Additionally, in the current software release, the
404 -- following cases are not handled:
405 -- - the end point of the contour is the point of
406 -- intersection of 4 or more edges of the shape, or
407 -- - the intersection of the fillet with a face which limits
408 -- the contour is not fully contained in this face.
409
410 Reset(me : in out)
411 ---Purpose: Reinitializes this algorithm, thus canceling the effects of the Build function.
412 -- This function allows modifications to be made to the
413 -- contours and fillet parameters in order to rebuild the shape.
414 is static;
415
416 Builder(me) returns HBuilder from TopOpeBRepBuild
417 ---Purpose: Returns the internal topology building algorithm.
418 ---Level: Advanced
419 is static;
420
421
422 -------------------------------------------
423 -- Methods usefull for historical utilities --
424 -------------------------------------------
425 Generated (me: in out; EorV : Shape from TopoDS)
426 ---Purpose: Returns the list of shapes generated from the
427 -- shape <EorV>.
428 ---C++: return const &
429 ---Level: Public
430 returns ListOfShape from TopTools
431 is redefined virtual;
432
433
434 Modified (me: in out; F : Shape from TopoDS)
435 ---Purpose: Returns the list of shapes modified from the shape
436 -- <F>.
437 ---C++: return const &
438 ---Level: Public
439 returns ListOfShape from TopTools
440 is redefined virtual;
441
442
443 IsDeleted (me: in out; F : Shape from TopoDS)
444 returns Boolean
445 is redefined virtual;
446
447 -------------------------------------------
448 -- Methods usefull for BRepCtx utilities --
449 -------------------------------------------
450
451 NbSurfaces(me)
452 ---Purpose: returns the number of surfaces
453 -- after the shape creation.
454 ---Level: Public
455 returns Integer from Standard;
456
457
458 NewFaces(me: in out; I: Integer)
459 ---Purpose: Return the faces created for surface <I>.
460 ---C++: return const &
461 ---Level: Public
462 returns ListOfShape from TopTools;
463
464 -------------------------------
465 ---Methods for quick simulation
466 -------------------------------
467
468 Simulate(me : in out;
469 IC : Integer from Standard);
470
471 NbSurf(me; IC : Integer from Standard)
472 returns Integer from Standard;
473
474 Sect(me; IC, IS : Integer from Standard)
475 returns mutable SecHArray1 from ChFiDS;
476
477
478 -------------------------------------
479 --- Methods for managing errors
480 -------------------------------------
481
482 NbFaultyContours(me)
483 ---Purpose: Returns the number of contours where the computation
484 -- of the fillet failed
485 returns Integer from Standard is static;
486
487 FaultyContour(me; I : Integer from Standard)
488 ---Purpose: for each I in [1.. NbFaultyContours] returns the index IC of
489 -- the contour where the computation of the fillet failed.
490 -- the method NbEdges(IC) gives the number of edges in the contour IC
491 -- the method Edge(IC,ie) gives the edge number ie of the contour IC
492 returns Integer from Standard is static;
493
494 NbComputedSurfaces(me; IC : Integer from Standard)
495 ---Purpose: returns the number of surfaces which have been
496 -- computed on the contour IC
497 returns Integer from Standard is static;
498
499 ComputedSurface(me; IC, IS : Integer from Standard)
500 ---Purpose: returns the surface number IS concerning the contour IC
501 returns Surface from Geom is static;
502
503 NbFaultyVertices(me)
504 ---Purpose: returns the number of vertices where the computation failed
505 returns Integer from Standard is static;
506
507 FaultyVertex(me; IV : Integer from Standard)
508 ---Purpose: returns the vertex where the computation failed
509 returns Vertex from TopoDS is static;
510
511 HasResult(me) returns Boolean from Standard is static;
512 ---Purpose: returns true if a part of the result has been computed
513 -- if the filling in a corner failed a shape with a hole is returned
514
515 BadShape(me) returns Shape from TopoDS
516 ---Purpose: if (HasResult()) returns the partial result
517 raises NoSuchObject from Standard
518 is static;
519
520 StripeStatus(me;IC : Integer from Standard) returns ErrorStatus from ChFiDS
521 ---Purpose: returns the status concerning the contour IC in case of error
522 -- ChFiDS_Ok : the computation is Ok
523 -- ChFiDS_StartsolFailure : the computation can't start, perhaps the
524 -- the radius is too big
525 -- ChFiDS_TwistedSurface : the computation failed because of a twisted
526 -- surface
527 -- ChFiDS_WalkingFailure : there is a problem in the walking
528 -- ChFiDS_Error: other error different from above
529 is static;
530
531fields
532
533 myBuilder : FilBuilder from ChFi3d;
534 myMap : MapOfShape from TopTools;
535
536end MakeFillet;