b311480e |
1 | -- Created on: 1993-12-15 |
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 | package BRepLib |
18 | |
19 | ---Purpose: The BRepLib package provides general utilities for |
20 | -- BRep. |
21 | -- |
22 | -- * FindSurface : Class to compute a surface through |
23 | -- a set of edges. |
24 | -- |
25 | -- * Compute missing 3d curve on an edge. |
26 | |
27 | uses |
28 | Standard, |
29 | StdFail, |
30 | gp, |
31 | Geom, |
32 | GeomAbs, |
33 | Geom2d, |
34 | TopoDS, |
35 | TopLoc, |
36 | TopTools, |
37 | TopAbs |
38 | |
39 | is |
40 | |
41 | enumeration EdgeError is |
42 | ---Purpose: Errors that can occur at edge construction. |
43 | EdgeDone, -- no error |
44 | PointProjectionFailed, |
45 | ParameterOutOfRange, |
46 | DifferentPointsOnClosedCurve, |
47 | PointWithInfiniteParameter, |
48 | DifferentsPointAndParameter, |
49 | LineThroughIdenticPoints |
50 | end EdgeError; |
51 | |
52 | |
53 | enumeration WireError is |
54 | ---Purpose: Errors that can occur at wire construction. |
55 | WireDone, -- no error |
56 | EmptyWire, |
57 | DisconnectedWire, |
58 | NonManifoldWire |
59 | |
60 | end WireError; |
61 | |
62 | |
63 | enumeration FaceError is |
64 | ---Purpose: Errors that can occur at face construction. |
65 | FaceDone, -- no error |
66 | NoFace, -- not initialised |
67 | NotPlanar, |
68 | CurveProjectionFailed, |
69 | ParametersOutOfRange |
70 | |
71 | end FaceError; |
72 | |
73 | |
74 | enumeration ShellError is |
75 | ---Purpose: Errors that can occur at shell construction. |
76 | |
77 | ShellDone, -- no error |
78 | EmptyShell, |
79 | DisconnectedShell, |
80 | ShellParametersOutOfRange |
81 | |
82 | end ShellError; |
83 | |
84 | enumeration ShapeModification is |
85 | ---Purpose: Modification type after a topologic operation. |
86 | |
87 | Preserved, -- no modification |
88 | Deleted, |
89 | Trimmed, |
90 | Merged, |
91 | BoundaryModified |
92 | |
93 | end ShapeModification; |
94 | |
95 | deferred class Command; |
96 | ---Purpose: Root class for all BRepBuilderAPI commands. |
97 | |
98 | deferred class MakeShape; |
99 | ---Purpose: Root class for all shape constructions. |
100 | |
101 | -- |
102 | -- Construction of topology from geometry |
103 | -- |
104 | |
105 | class MakeVertex; |
106 | |
107 | class MakeEdge; |
108 | |
109 | class MakeEdge2d; |
110 | |
111 | class MakePolygon; |
112 | |
113 | class MakeFace; |
114 | |
115 | -- |
116 | -- Construction of composite topologies |
117 | -- |
118 | |
119 | class MakeWire; |
120 | |
121 | class MakeShell; |
122 | |
123 | class MakeSolid; |
124 | |
125 | |
126 | |
127 | |
128 | --- END of API commands. |
129 | |
130 | |
131 | |
132 | |
133 | class FindSurface; |
134 | ---Purpose: Find a surface in a set of edges. |
135 | |
136 | class FuseEdges; |
137 | ---Purpose: |
138 | |
139 | |
140 | -- |
141 | -- Default precison methods. |
142 | -- The default precision is initialized with Precision::Confusion() |
143 | -- |
144 | |
145 | Precision(P : Real); |
146 | ---Purpose: Sets the default precision. The current Precision |
147 | -- is returned. |
148 | ---Level: Public |
149 | |
150 | Precision returns Real; |
151 | ---Purpose: Returns the default precision. |
152 | ---Level: Public |
153 | |
154 | |
155 | -- |
156 | -- Default plane for 2d edges. |
157 | -- |
158 | |
159 | Plane(P : Plane from Geom); |
160 | ---Purpose: Sets the current plane to P. |
161 | ---Level: Public |
162 | |
163 | Plane returns Plane from Geom; |
164 | ---Purpose: Returns the current plane. |
165 | -- |
166 | ---C++: return const & |
167 | ---Level: Public |
168 | |
169 | |
170 | |
171 | CheckSameRange(E : Edge from TopoDS ; |
172 | Confusion : Real from Standard = 1.0e-12) |
173 | returns Boolean; |
174 | |
175 | ---Purpose: checks if the Edge is same range IGNORING |
176 | -- the same range flag of the edge |
177 | -- Confusion argument is to compare real numbers |
178 | -- idenpendently of any model space tolerance |
179 | -- |
180 | |
181 | |
182 | SameRange(E : Edge from TopoDS ; |
183 | Tolerance : Real from Standard = 1.0e-5) ; |
184 | ---Purpose: will make all the curve representation have |
185 | -- the same range domain for the parameters. |
186 | -- This will IGNORE the same range flag value |
187 | -- to proceed. |
188 | -- If there is a 3D curve there it will the |
189 | -- range of that curve. If not the first curve representation |
190 | -- encountered in the list will give its range to |
191 | -- the all the other curves. |
192 | |
193 | BuildCurve3d(E : Edge from TopoDS ; |
194 | Tolerance : Real from Standard = 1.0e-5 ; |
195 | Continuity : Shape from GeomAbs = GeomAbs_C1; |
196 | MaxDegree : Integer = 14; |
197 | MaxSegment : Integer = 0 --30 |
198 | ) returns Boolean; |
199 | ---Purpose: Computes the 3d curve for the edge <E> if it does |
200 | -- not exist. Returns True if the curve was computed |
201 | -- or existed. Returns False if there is no planar |
dfc06d1f |
202 | -- pcurve or the computation failed. |
7fd59977 |
203 | -- <MaxSegment> >= 30 in approximation |
204 | |
205 | BuildCurves3d(S : Shape from TopoDS ; |
206 | Tolerance : Real from Standard; |
207 | Continuity : Shape from GeomAbs = GeomAbs_C1; |
208 | MaxDegree : Integer = 14; |
209 | MaxSegment : Integer = 0 --30 |
210 | ) returns Boolean; |
211 | |
212 | ---Purpose: Computes the 3d curves for all the edges of <S> |
213 | -- return False if one of the computation failed. |
214 | -- <MaxSegment> >= 30 in approximation |
215 | |
216 | BuildCurves3d(S : Shape from TopoDS) |
217 | returns Boolean; |
218 | |
219 | ---Purpose: Computes the 3d curves for all the edges of <S> |
220 | -- return False if one of the computation failed. |
221 | |
222 | |
223 | -- |
224 | -- |
225 | UpdateEdgeTol( E : Edge from TopoDS ; |
226 | MinToleranceRequest : Real from Standard ; |
227 | MaxToleranceToCheck : Real from Standard) |
228 | ---Purpose: Checks if the edge has a Tolerance smaller than -- -- |
229 | -- -- -- MaxToleranceToCheck if so it will compute the |
230 | -- radius of -- the cylindrical pipe surface that |
231 | -- MinToleranceRequest is the minimum tolerance before it |
232 | -- is usefull to start testing. Usually it should be arround |
233 | -- 10e-5 |
234 | -- contains all -- the curve represenation of the edge |
235 | -- returns True if the Edge tolerance had to be updated |
236 | returns Boolean ; |
237 | |
238 | |
239 | UpdateEdgeTolerance(S : Shape from TopoDS; |
240 | MinToleranceRequest : Real from Standard ; |
241 | MaxToleranceToCheck : Real from Standard) |
242 | |
243 | ---Purpose: -- Checks all the edges of the shape whose -- -- -- |
244 | -- Tolerance is smaller than MaxToleranceToCheck -- |
245 | -- Returns True if at least one edge was updated -- |
246 | -- MinToleranceRequest is the minimum tolerance before |
247 | -- -- it -- is usefull to start testing. Usually it |
248 | -- should be arround -- 10e-5-- |
249 | -- |
250 | -- Warning :The method is very slow as it checks all. |
251 | -- Use only in interfaces or processing assimilate batch |
252 | -- |
253 | |
254 | returns Boolean ; |
255 | |
256 | SameParameter(E: Edge from TopoDS; |
257 | Tolerance : Real from Standard = 1.0e-5); |
258 | ---Purpose: Computes new 2d curve(s) for the edge <E> to have |
259 | -- the same parameter as the 3d curve. |
260 | -- The algorithm is not done if the flag SameParameter |
261 | -- was True on the Edge. |
262 | |
263 | |
264 | |
265 | SameParameter(S: Shape from TopoDS ; |
266 | Tolerance : Real from Standard = 1.0e-5; |
267 | forced : Boolean from Standard = Standard_False); |
268 | ---Purpose: Computes new 2d curve(s) for all the edges of <S> |
269 | -- to have the same parameter as the 3d curve. |
270 | -- The algorithm is not done if the flag SameParameter |
271 | -- was True on an Edge. |
272 | |
273 | UpdateTolerances(S: Shape from TopoDS; |
274 | verifyFaceTolerance : Boolean from Standard = Standard_False); |
275 | ---Purpose: Replaces tolerance of FACE EDGE VERTEX by the |
276 | -- tolerance Max of their connected handling shapes. |
277 | -- It is not necessary to use this call after |
278 | -- SameParameter. (called in) |
279 | |
280 | OrientClosedSolid(solid : in out Solid from TopoDS) |
281 | ---Purpose: Orients the solid forward and the shell with the |
282 | -- orientation to have matter in the solid. Returns |
283 | -- False if the solid is unOrientable (open or incoherent) |
284 | returns Boolean; |
285 | |
286 | |
287 | EncodeRegularity(S : Shape from TopoDS; |
288 | TolAng : Real from Standard = 1.0e-10); |
289 | ---Purpose: Encodes the Regularity of edges on a Shape. |
290 | -- Warning: <TolAng> is an angular tolerance, expressed in Rad. |
291 | -- Warning: If the edges's regularity are coded before, nothing |
292 | -- is done. |
293 | |
294 | EncodeRegularity(S : in out Edge from TopoDS; |
295 | F1, F2 : Face from TopoDS; |
296 | TolAng : Real from Standard = 1.0e-10); |
297 | ---Purpose: Encodes the Regularity beetween <F1> and <F2> by <E> |
298 | -- Warning: <TolAng> is an angular tolerance, expressed in Rad. |
299 | -- Warning: If the edge's regularity is coded before, nothing |
300 | -- is done. |
301 | |
302 | SortFaces (S : Shape from TopoDS; |
303 | LF : in out ListOfShape from TopTools); |
304 | ---Purpose: Sorts in LF the Faces of S on the complexity of |
305 | -- their surfaces |
306 | -- (Plane,Cylinder,Cone,Sphere,Torus,other) |
307 | |
308 | ReverseSortFaces (S : Shape from TopoDS; |
309 | LF : in out ListOfShape from TopTools); |
310 | ---Purpose: Sorts in LF the Faces of S on the reverse |
311 | -- complexity of their surfaces |
312 | -- (other,Torus,Sphere,Cone,Cylinder,Plane) |
313 | |
314 | end BRepLib; |