1 -- Created on: 1993-12-15
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
26 ---Purpose: The BRepLib package provides general utilities for
29 -- * FindSurface : Class to compute a surface through
32 -- * Compute missing 3d curve on an edge.
48 enumeration EdgeError is
49 ---Purpose: Errors that can occur at edge construction.
51 PointProjectionFailed,
53 DifferentPointsOnClosedCurve,
54 PointWithInfiniteParameter,
55 DifferentsPointAndParameter,
56 LineThroughIdenticPoints
60 enumeration WireError is
61 ---Purpose: Errors that can occur at wire construction.
70 enumeration FaceError is
71 ---Purpose: Errors that can occur at face construction.
73 NoFace, -- not initialised
75 CurveProjectionFailed,
81 enumeration ShellError is
82 ---Purpose: Errors that can occur at shell construction.
84 ShellDone, -- no error
87 ShellParametersOutOfRange
91 enumeration ShapeModification is
92 ---Purpose: Modification type after a topologic operation.
94 Preserved, -- no modification
100 end ShapeModification;
102 deferred class Command;
103 ---Purpose: Root class for all BRepBuilderAPI commands.
105 deferred class MakeShape;
106 ---Purpose: Root class for all shape constructions.
109 -- Construction of topology from geometry
123 -- Construction of composite topologies
135 --- END of API commands.
141 ---Purpose: Find a surface in a set of edges.
148 -- Default precison methods.
149 -- The default precision is initialized with Precision::Confusion()
153 ---Purpose: Sets the default precision. The current Precision
157 Precision returns Real;
158 ---Purpose: Returns the default precision.
163 -- Default plane for 2d edges.
166 Plane(P : Plane from Geom);
167 ---Purpose: Sets the current plane to P.
170 Plane returns Plane from Geom;
171 ---Purpose: Returns the current plane.
173 ---C++: return const &
178 CheckSameRange(E : Edge from TopoDS ;
179 Confusion : Real from Standard = 1.0e-12)
182 ---Purpose: checks if the Edge is same range IGNORING
183 -- the same range flag of the edge
184 -- Confusion argument is to compare real numbers
185 -- idenpendently of any model space tolerance
189 SameRange(E : Edge from TopoDS ;
190 Tolerance : Real from Standard = 1.0e-5) ;
191 ---Purpose: will make all the curve representation have
192 -- the same range domain for the parameters.
193 -- This will IGNORE the same range flag value
195 -- If there is a 3D curve there it will the
196 -- range of that curve. If not the first curve representation
197 -- encountered in the list will give its range to
198 -- the all the other curves.
200 BuildCurve3d(E : Edge from TopoDS ;
201 Tolerance : Real from Standard = 1.0e-5 ;
202 Continuity : Shape from GeomAbs = GeomAbs_C1;
203 MaxDegree : Integer = 14;
204 MaxSegment : Integer = 0 --30
206 ---Purpose: Computes the 3d curve for the edge <E> if it does
207 -- not exist. Returns True if the curve was computed
208 -- or existed. Returns False if there is no planar
209 -- pcurve or the computation failed.
210 -- <MaxSegment> >= 30 in approximation
212 BuildCurves3d(S : Shape from TopoDS ;
213 Tolerance : Real from Standard;
214 Continuity : Shape from GeomAbs = GeomAbs_C1;
215 MaxDegree : Integer = 14;
216 MaxSegment : Integer = 0 --30
219 ---Purpose: Computes the 3d curves for all the edges of <S>
220 -- return False if one of the computation failed.
221 -- <MaxSegment> >= 30 in approximation
223 BuildCurves3d(S : Shape from TopoDS)
226 ---Purpose: Computes the 3d curves for all the edges of <S>
227 -- return False if one of the computation failed.
232 UpdateEdgeTol( E : Edge from TopoDS ;
233 MinToleranceRequest : Real from Standard ;
234 MaxToleranceToCheck : Real from Standard)
235 ---Purpose: Checks if the edge has a Tolerance smaller than -- --
236 -- -- -- MaxToleranceToCheck if so it will compute the
237 -- radius of -- the cylindrical pipe surface that
238 -- MinToleranceRequest is the minimum tolerance before it
239 -- is usefull to start testing. Usually it should be arround
241 -- contains all -- the curve represenation of the edge
242 -- returns True if the Edge tolerance had to be updated
246 UpdateEdgeTolerance(S : Shape from TopoDS;
247 MinToleranceRequest : Real from Standard ;
248 MaxToleranceToCheck : Real from Standard)
250 ---Purpose: -- Checks all the edges of the shape whose -- -- --
251 -- Tolerance is smaller than MaxToleranceToCheck --
252 -- Returns True if at least one edge was updated --
253 -- MinToleranceRequest is the minimum tolerance before
254 -- -- it -- is usefull to start testing. Usually it
255 -- should be arround -- 10e-5--
257 -- Warning :The method is very slow as it checks all.
258 -- Use only in interfaces or processing assimilate batch
263 SameParameter(E: Edge from TopoDS;
264 Tolerance : Real from Standard = 1.0e-5);
265 ---Purpose: Computes new 2d curve(s) for the edge <E> to have
266 -- the same parameter as the 3d curve.
267 -- The algorithm is not done if the flag SameParameter
268 -- was True on the Edge.
272 SameParameter(S: Shape from TopoDS ;
273 Tolerance : Real from Standard = 1.0e-5;
274 forced : Boolean from Standard = Standard_False);
275 ---Purpose: Computes new 2d curve(s) for all the edges of <S>
276 -- to have the same parameter as the 3d curve.
277 -- The algorithm is not done if the flag SameParameter
278 -- was True on an Edge.
280 UpdateTolerances(S: Shape from TopoDS;
281 verifyFaceTolerance : Boolean from Standard = Standard_False);
282 ---Purpose: Replaces tolerance of FACE EDGE VERTEX by the
283 -- tolerance Max of their connected handling shapes.
284 -- It is not necessary to use this call after
285 -- SameParameter. (called in)
287 OrientClosedSolid(solid : in out Solid from TopoDS)
288 ---Purpose: Orients the solid forward and the shell with the
289 -- orientation to have matter in the solid. Returns
290 -- False if the solid is unOrientable (open or incoherent)
294 EncodeRegularity(S : Shape from TopoDS;
295 TolAng : Real from Standard = 1.0e-10);
296 ---Purpose: Encodes the Regularity of edges on a Shape.
297 -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
298 -- Warning: If the edges's regularity are coded before, nothing
301 EncodeRegularity(S : in out Edge from TopoDS;
302 F1, F2 : Face from TopoDS;
303 TolAng : Real from Standard = 1.0e-10);
304 ---Purpose: Encodes the Regularity beetween <F1> and <F2> by <E>
305 -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
306 -- Warning: If the edge's regularity is coded before, nothing
309 SortFaces (S : Shape from TopoDS;
310 LF : in out ListOfShape from TopTools);
311 ---Purpose: Sorts in LF the Faces of S on the complexity of
313 -- (Plane,Cylinder,Cone,Sphere,Torus,other)
315 ReverseSortFaces (S : Shape from TopoDS;
316 LF : in out ListOfShape from TopTools);
317 ---Purpose: Sorts in LF the Faces of S on the reverse
318 -- complexity of their surfaces
319 -- (other,Torus,Sphere,Cone,Cylinder,Plane)