1 -- Created on: 1998-08-26
2 -- Created by: Julia GERASIMOVA
3 -- Copyright (c) 1998-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
9 -- under the terms of the GNU Lesser General Public 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 Filling from BRepFill
19 ---Purpose: N-Side Filling
20 -- This algorithm avoids to build a face from:
21 -- * a set of edges defining the bounds of the face and some
22 -- constraints the surface support has to satisfy
23 -- * a set of edges and points defining some constraints
24 -- the support surface has to satisfy
25 -- * an initial surface to deform for satisfying the constraints
26 -- * a set of parameters to control the constraints.
28 -- The support surface of the face is computed by deformation
29 -- of the initial surface in order to satisfy the given constraints.
30 -- The set of bounding edges defines the wire of the face.
32 -- If no initial surface is given, the algorithm computes it
34 -- If the set of edges is not connected (Free constraint)
35 -- missing edges are automatically computed.
38 -- * If some constraints are not compatible
39 -- The algorithm does not take them into account.
40 -- So the constraints will not be satisfyed in an area containing
41 -- the incompatibilitries.
42 -- * The constraints defining the bound of the face have to be
43 -- entered in order to have a continuous wire.
45 -- Other Applications:
46 -- * Deformation of a face to satisfy internal constraints
47 -- * Deformation of a face to improve Gi continuity with
58 BuildPlateSurface from GeomPlate,
59 SequenceOfEdgeFaceAndOrder from BRepFill,
60 SequenceOfFaceAndOrder from BRepFill,
61 SequenceOfPointConstraint from GeomPlate,
62 SequenceOfShape from TopTools,
63 ListOfShape from TopTools,
64 DataMapOfShapeListOfShape from TopTools,
65 SequenceOfPnt from TColgp
73 Create( Degree : Integer from Standard = 3;
74 NbPtsOnCur : Integer from Standard = 15;
75 NbIter : Integer from Standard = 2;
76 Anisotropie : Boolean from Standard = Standard_False;
77 Tol2d : Real from Standard = 0.00001;
78 Tol3d : Real from Standard = 0.0001;
79 TolAng : Real from Standard = 0.01;
80 TolCurv : Real from Standard = 0.1;
81 MaxDeg : Integer from Standard = 8;
82 MaxSegments : Integer from Standard = 9 )
83 ---Purpose: Constructor
85 returns Filling from BRepFill;
88 SetConstrParam( me : in out; Tol2d : Real from Standard = 0.00001;
89 Tol3d : Real from Standard = 0.0001;
90 TolAng : Real from Standard = 0.01;
91 TolCurv : Real from Standard = 0.1 );
92 ---Purpose: Sets the values of Tolerances used to control the constraint.
94 -- Tol3d: it is the maximum distance allowed between the support surface
95 -- and the constraints
96 -- TolAng: it is the maximum angle allowed between the normal of the surface
97 -- and the constraints
98 -- TolCurv: it is the maximum difference of curvature allowed between
99 -- the surface and the constraint
101 SetResolParam( me : in out; Degree : Integer from Standard = 3;
102 NbPtsOnCur : Integer from Standard = 15;
103 NbIter : Integer from Standard = 2;
104 Anisotropie : Boolean from Standard = Standard_False );
105 ---Purpose: Sets the parameters used for resolution.
106 -- The default values of these parameters have been chosen for a good
107 -- ratio quality/performance.
108 -- Degree: it is the order of energy criterion to minimize for computing
109 -- the deformation of the surface.
110 -- The default value is 3
111 -- The recommanded value is i+2 where i is the maximum order of the
113 -- NbPtsOnCur: it is the average number of points for discretisation
115 -- NbIter: it is the maximum number of iterations of the process.
116 -- For each iteration the number of discretisation points is
120 SetApproxParam( me : in out; MaxDeg : Integer from Standard = 8;
121 MaxSegments : Integer from Standard = 9 );
122 ---Purpose: Sets the parameters used for approximation of the surface
126 LoadInitSurface( me : in out; aFace : Face from TopoDS );
127 ---Purpose: Loads the initial Surface
130 Add( me : in out; anEdge : Edge from TopoDS;
131 Order : Shape from GeomAbs;
132 IsBound : Boolean from Standard = Standard_True )
133 returns Integer from Standard
134 ---Purpose: Adds a new constraint which also defines an edge of the wire
136 -- Order: Order of the constraint:
137 -- GeomAbs_C0 : the surface has to pass by 3D representation
139 -- GeomAbs_G1 : the surface has to pass by 3D representation
140 -- of the edge and to respect tangency with the first
142 -- GeomAbs_G2 : the surface has to pass by 3D representation
143 -- of the edge and to respect tangency and curvature
144 -- with the first face of the edge.
145 raises ConstructionError from Standard;
146 -- if the edge has no representation on a face and Order is
147 -- GeomAbs_G1 or GeomAbs_G2.
149 Add( me : in out; anEdge : Edge from TopoDS;
150 Support : Face from TopoDS;
151 Order : Shape from GeomAbs;
152 IsBound : Boolean from Standard = Standard_True )
153 returns Integer from Standard
154 ---Purpose: Adds a new constraint which also defines an edge of the wire
156 -- Order: Order of the constraint:
157 -- GeomAbs_C0 : the surface has to pass by 3D representation
159 -- GeomAbs_G1 : the surface has to pass by 3D representation
160 -- of the edge and to respect tangency with the
162 -- GeomAbs_G2 : the surface has to pass by 3D representation
163 -- of the edge and to respect tangency and curvature
164 -- with the given face.
165 raises ConstructionError from Standard;
166 -- if the edge has no 2d representation on the given face
168 Add( me : in out; Support : Face from TopoDS;
169 Order : Shape from GeomAbs )
170 returns Integer from Standard;
171 ---Purpose: Adds a free constraint on a face. The corresponding edge has to
172 -- be automatically recomputed.
173 -- It is always a bound.
175 Add( me : in out; Point : Pnt from gp )
176 returns Integer from Standard;
177 ---Purpose: Adds a punctual constraint
179 Add( me : in out; U, V : Real from Standard;
180 Support : Face from TopoDS;
181 Order : Shape from GeomAbs )
182 returns Integer from Standard;
183 ---Purpose: Adds a punctual constraint.
186 AddConstraints( me : in out; SeqOfConstraints : SequenceOfEdgeFaceAndOrder from BRepFill )
187 ---Purpose: Adds constraints to builder
190 BuildWires( me : in out; EdgeList : in out ListOfShape from TopTools;
191 WireList : out ListOfShape from TopTools )
192 ---Purpose: Builds wires of maximum length
195 FindExtremitiesOfHoles( me; WireList : ListOfShape from TopTools;
196 VerSeq : out SequenceOfShape from TopTools )
197 ---Purpose: Finds extremities of future edges to fix the holes between wires.
198 -- Can properly operate only with convex contour
201 Build( me : in out );
202 ---Purpose: Builds the resulting faces
204 IsDone(me) returns Boolean from Standard;
206 Face(me) returns Face from TopoDS;
207 -- returns the resulting face
209 Generated (me: in out; S : Shape from TopoDS)
210 ---Purpose: Returns the list of shapes generated from the
212 ---C++: return const &
214 returns ListOfShape from TopTools;
216 G0Error(me) returns Real from Standard;
217 -- returns the max distance between the result and the constraints
219 G1Error(me) returns Real from Standard;
220 -- returns the max angle between the result and the constraints
222 G2Error(me) returns Real from Standard;
223 -- returns the max difference of curvature between the result and the constraints
226 G0Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
227 -- returns the max distance between the result and the constraint Index
229 G1Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
230 -- returns the max angle between the result and the constraint Index
232 G2Error( me : in out; Index : Integer from Standard ) returns Real from Standard;
233 -- returns the max difference of curvature between the result and the constraint Index
237 myBuilder : BuildPlateSurface from GeomPlate;
238 myBoundary : SequenceOfEdgeFaceAndOrder from BRepFill;
239 myConstraints : SequenceOfEdgeFaceAndOrder from BRepFill;
240 myFreeConstraints : SequenceOfFaceAndOrder from BRepFill;
241 myPoints : SequenceOfPointConstraint from GeomPlate;
243 myOldNewMap : DataMapOfShapeListOfShape from TopTools;
244 myGenerated : ListOfShape from TopTools;
246 myFace : Face from TopoDS;
248 myInitFace : Face from TopoDS;
251 myTol2d : Real from Standard;
252 myTol3d : Real from Standard;
253 myTolAng : Real from Standard;
254 myTolCurv : Real from Standard;
256 -- Parameters of approximation
257 myMaxDeg : Integer from Standard;
258 myMaxSegments : Integer from Standard;
260 -- Parameters of resolution
261 myDegree : Integer from Standard;
262 myNbPtsOnCur : Integer from Standard;
263 myNbIter : Integer from Standard;
264 myAnisotropie : Boolean from Standard;
266 myIsInitFaceGiven : Boolean from Standard;
268 myIsDone : Boolean from Standard;