Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 1998-08-26 |
2 | -- Created by: Julia GERASIMOVA | |
3 | -- Copyright (c) 1998-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 MakeFilling from BRepOffsetAPI inherits MakeShape from BRepBuilderAPI | |
18 | ||
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 of the face 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. | |
27 | -- | |
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. | |
31 | -- | |
32 | -- If no initial surface is given, the algorithm computes it | |
33 | -- automatically. | |
34 | -- If the set of edges is not connected (Free constraint) | |
35 | -- missing edges are automatically computed. | |
36 | -- | |
37 | -- Limitations: | |
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. | |
44 | -- | |
45 | -- Other Applications: | |
46 | -- * Deformation of a face to satisfy internal constraints | |
47 | -- * Deformation of a face to improve Gi continuity with | |
48 | -- connected faces | |
49 | ||
50 | ---Level: Advanced | |
51 | ||
52 | uses | |
53 | Shape from TopoDS, | |
54 | Edge from TopoDS, | |
55 | Face from TopoDS, | |
56 | Pnt from gp, | |
57 | Shape from GeomAbs, | |
01697018 | 58 | ListOfShape from TopTools, |
7fd59977 | 59 | Filling from BRepFill |
60 | ||
61 | raises | |
62 | NotDone, | |
63 | OutOfRange, | |
64 | ConstructionError | |
65 | ||
66 | is | |
67 | Create( Degree : Integer from Standard = 3; | |
68 | NbPtsOnCur : Integer from Standard = 15; | |
69 | NbIter : Integer from Standard = 2; | |
70 | Anisotropie : Boolean from Standard = Standard_False; | |
71 | Tol2d : Real from Standard = 0.00001; | |
72 | Tol3d : Real from Standard = 0.0001; | |
73 | TolAng : Real from Standard = 0.01; | |
74 | TolCurv : Real from Standard = 0.1; | |
75 | MaxDeg : Integer from Standard = 8; | |
76 | MaxSegments : Integer from Standard = 9 ) | |
77 | ---Purpose: Constructs a wire filling object defined by | |
78 | -- - the energy minimizing criterion Degree | |
79 | -- - the number of points on the curve NbPntsOnCur | |
80 | -- - the number of iterations NbIter | |
81 | -- - the Boolean Anisotropie | |
82 | -- - the 2D tolerance Tol2d | |
83 | -- - the 3D tolerance Tol3d | |
84 | -- - the angular tolerance TolAng | |
85 | -- - the tolerance for curvature TolCur | |
86 | -- - the highest polynomial degree MaxDeg | |
87 | -- - the greatest number of segments MaxSeg. | |
88 | -- If the Boolean Anistropie is true, the algorithm's | |
89 | -- performance is better in cases where the ratio of the | |
90 | -- length U and the length V indicate a great difference | |
91 | -- between the two. In other words, when the surface is, for | |
92 | -- example, extremely long. | |
93 | returns MakeFilling from BRepOffsetAPI; | |
94 | ||
95 | ||
96 | SetConstrParam( me : in out; Tol2d : Real from Standard = 0.00001; | |
97 | Tol3d : Real from Standard = 0.0001; | |
98 | TolAng : Real from Standard = 0.01; | |
99 | TolCurv : Real from Standard = 0.1 ); | |
100 | ---Purpose: Sets the values of Tolerances used to control the constraint. | |
101 | -- Tol2d: | |
102 | -- Tol3d: it is the maximum distance allowed between the support surface | |
103 | -- and the constraints | |
104 | -- TolAng: it is the maximum angle allowed between the normal of the surface | |
105 | -- and the constraints | |
106 | -- TolCurv: it is the maximum difference of curvature allowed between | |
107 | -- the surface and the constraint | |
108 | ||
109 | SetResolParam( me : in out; Degree : Integer from Standard = 3; | |
110 | NbPtsOnCur : Integer from Standard = 15; | |
111 | NbIter : Integer from Standard = 2; | |
112 | Anisotropie : Boolean from Standard = Standard_False ); | |
113 | ---Purpose: Sets the parameters used for resolution. | |
114 | -- The default values of these parameters have been chosen for a good | |
115 | -- ratio quality/performance. | |
116 | -- Degree: it is the order of energy criterion to minimize for computing | |
117 | -- the deformation of the surface. | |
118 | -- The default value is 3 | |
119 | -- The recommanded value is i+2 where i is the maximum order of the | |
120 | -- constraints. | |
121 | -- NbPtsOnCur: it is the average number of points for discretisation | |
122 | -- of the edges. | |
123 | -- NbIter: it is the maximum number of iterations of the process. | |
124 | -- For each iteration the number of discretisation points is | |
125 | -- increased. | |
126 | -- Anisotropie: | |
127 | ||
128 | SetApproxParam( me : in out; MaxDeg : Integer from Standard = 8; | |
129 | MaxSegments : Integer from Standard = 9 ); | |
130 | ---Purpose: Sets the parameters used to approximate the filling | |
131 | -- surface. These include: | |
132 | -- - MaxDeg - the highest degree which the polynomial | |
133 | -- defining the filling surface can have | |
134 | -- - MaxSegments - the greatest number of segments | |
135 | -- which the filling surface can have. | |
136 | ||
137 | ||
138 | LoadInitSurface( me : in out; Surf : Face from TopoDS ); | |
139 | ---Purpose: Loads the initial surface Surf to | |
140 | -- begin the construction of the surface. | |
141 | -- This optional function is useful if the surface resulting from | |
142 | -- construction for the algorithm is likely to be complex. | |
143 | -- The support surface of the face under construction is computed by a | |
144 | -- deformation of Surf which satisfies the given constraints. | |
145 | -- The set of bounding edges defines the wire of the face. | |
146 | -- If no initial surface is given, the algorithm computes it | |
147 | -- automatically. If the set of edges is not connected (Free constraint), | |
148 | -- missing edges are automatically computed. | |
ba418145 | 149 | -- Important: the initial surface must have orthogonal local coordinates, |
150 | -- i.e. partial derivatives dS/du and dS/dv must be orthogonal | |
151 | -- at each point of surface. | |
152 | -- If this condition breaks, distortions of resulting surface | |
153 | -- are possible. | |
7fd59977 | 154 | |
155 | ||
156 | Add( me : in out; Constr : Edge from TopoDS; | |
157 | Order : Shape from GeomAbs; | |
158 | IsBound : Boolean from Standard = Standard_True ) | |
159 | returns Integer from Standard | |
160 | ---Purpose: Adds a new constraint which also defines an edge of the wire | |
161 | -- of the face | |
162 | -- Order: Order of the constraint: | |
163 | -- GeomAbs_C0 : the surface has to pass by 3D representation | |
164 | -- of the edge | |
165 | -- GeomAbs_G1 : the surface has to pass by 3D representation | |
166 | -- of the edge and to respect tangency with the first | |
167 | -- face of the edge | |
168 | -- GeomAbs_G2 : the surface has to pass by 3D representation | |
169 | -- of the edge and to respect tangency and curvature | |
170 | -- with the first face of the edge. | |
171 | -- Raises ConstructionError if the edge has no representation on a face and Order is | |
172 | -- GeomAbs_G1 or GeomAbs_G2. | |
173 | raises ConstructionError from Standard; | |
174 | ||
175 | ||
176 | Add( me : in out; Constr : Edge from TopoDS; | |
177 | Support : Face from TopoDS; | |
178 | Order : Shape from GeomAbs; | |
179 | IsBound : Boolean from Standard = Standard_True ) | |
180 | returns Integer from Standard | |
181 | ---Purpose: Adds a new constraint which also defines an edge of the wire | |
182 | -- of the face | |
183 | -- Order: Order of the constraint: | |
184 | -- GeomAbs_C0 : the surface has to pass by 3D representation | |
185 | -- of the edge | |
186 | -- GeomAbs_G1 : the surface has to pass by 3D representation | |
187 | -- of the edge and to respect tangency with the | |
188 | -- given face | |
189 | -- GeomAbs_G2 : the surface has to pass by 3D representation | |
190 | -- of the edge and to respect tangency and curvature | |
191 | -- with the given face. | |
192 | -- Raises ConstructionError if the edge has no 2d representation on the given face | |
193 | raises ConstructionError from Standard; | |
194 | ||
195 | Add( me : in out; Support : Face from TopoDS; | |
196 | Order : Shape from GeomAbs ) | |
197 | returns Integer from Standard; | |
198 | ---Purpose: Adds a free constraint on a face. The corresponding edge has to | |
199 | -- be automatically recomputed. It is always a bound. | |
200 | ||
201 | Add( me : in out; Point : Pnt from gp ) | |
202 | returns Integer from Standard; | |
203 | ---Purpose: Adds a punctual constraint. | |
204 | ||
205 | Add( me : in out; U, V : Real from Standard; | |
206 | Support : Face from TopoDS; | |
207 | Order : Shape from GeomAbs ) | |
208 | returns Integer from Standard; | |
209 | ---Purpose: Adds a punctual constraint. | |
210 | ||
211 | ||
212 | Build( me : in out ) | |
213 | ---Purpose: Builds the resulting faces | |
214 | is redefined; | |
215 | ||
216 | IsDone(me) returns Boolean from Standard | |
217 | is redefined; | |
218 | --- Purpose: Tests whether computation of the filling plate has been completed. | |
219 | ||
01697018 J |
220 | Generated (me: in out; S : Shape from TopoDS) |
221 | ---Purpose: Returns the list of shapes generated from the | |
222 | -- shape <S>. | |
223 | ---C++: return const & | |
224 | ---Level: Public | |
225 | returns ListOfShape from TopTools | |
226 | is redefined; | |
227 | ||
7fd59977 | 228 | G0Error(me) returns Real from Standard; |
229 | --- Purpose: Returns the maximum distance between the result and | |
230 | -- the constraints. This is set at construction time. | |
231 | ||
232 | G1Error(me) returns Real from Standard; | |
233 | ---Purpose: Returns the maximum angle between the result and the | |
234 | -- constraints. This is set at construction time. | |
235 | ||
236 | G2Error(me) returns Real from Standard; | |
237 | ---Purpose: Returns the maximum angle between the result and the | |
238 | -- constraints. This is set at construction time. | |
239 | ||
240 | G0Error( me : in out; Index : Integer from Standard ) returns Real from Standard; | |
241 | ---Purpose: Returns the maximum distance attained between the | |
242 | -- result and the constraint Index. This is set at construction time. | |
243 | ||
244 | G1Error( me : in out; Index : Integer from Standard ) returns Real from Standard; | |
245 | ---Purpose: Returns the maximum angle between the result and the | |
246 | -- constraints. This is set at construction time. | |
247 | ||
248 | G2Error( me : in out; Index : Integer from Standard ) returns Real from Standard; | |
249 | ---Purpose: Returns the greatest difference in curvature found | |
250 | -- between the result and the constraint Index. | |
251 | ||
252 | fields | |
253 | ||
254 | myFilling : Filling from BRepFill; | |
255 | ||
256 | end MakeFilling; |