1 -- Created on: 1993-12-15
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1993-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 under
9 -- the terms of the GNU Lesser General Public License 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.
19 ---Purpose: The BRepLib package provides general utilities for
22 -- * FindSurface : Class to compute a surface through
25 -- * Compute missing 3d curve on an edge.
41 enumeration EdgeError is
42 ---Purpose: Errors that can occur at edge construction.
44 PointProjectionFailed,
46 DifferentPointsOnClosedCurve,
47 PointWithInfiniteParameter,
48 DifferentsPointAndParameter,
49 LineThroughIdenticPoints
53 enumeration WireError is
54 ---Purpose: Errors that can occur at wire construction.
63 enumeration FaceError is
64 ---Purpose: Errors that can occur at face construction.
66 NoFace, -- not initialised
68 CurveProjectionFailed,
74 enumeration ShellError is
75 ---Purpose: Errors that can occur at shell construction.
77 ShellDone, -- no error
80 ShellParametersOutOfRange
84 enumeration ShapeModification is
85 ---Purpose: Modification type after a topologic operation.
87 Preserved, -- no modification
93 end ShapeModification;
95 deferred class Command;
97 deferred class MakeShape;
100 -- Construction of topology from geometry
114 -- Construction of composite topologies
126 --- END of API commands.
138 -- Default precison methods.
139 -- The default precision is initialized with Precision::Confusion()
143 ---Purpose: Sets the default precision. The current Precision
147 Precision returns Real;
148 ---Purpose: Returns the default precision.
153 -- Default plane for 2d edges.
156 Plane(P : Plane from Geom);
157 ---Purpose: Sets the current plane to P.
160 Plane returns Plane from Geom;
161 ---Purpose: Returns the current plane.
163 ---C++: return const &
168 CheckSameRange(E : Edge from TopoDS ;
169 Confusion : Real from Standard = 1.0e-12)
172 ---Purpose: checks if the Edge is same range IGNORING
173 -- the same range flag of the edge
174 -- Confusion argument is to compare real numbers
175 -- idenpendently of any model space tolerance
179 SameRange(E : Edge from TopoDS ;
180 Tolerance : Real from Standard = 1.0e-5) ;
181 ---Purpose: will make all the curve representation have
182 -- the same range domain for the parameters.
183 -- This will IGNORE the same range flag value
185 -- If there is a 3D curve there it will the
186 -- range of that curve. If not the first curve representation
187 -- encountered in the list will give its range to
188 -- the all the other curves.
190 BuildCurve3d(E : Edge from TopoDS ;
191 Tolerance : Real from Standard = 1.0e-5 ;
192 Continuity : Shape from GeomAbs = GeomAbs_C1;
193 MaxDegree : Integer = 14;
194 MaxSegment : Integer = 0 --30
196 ---Purpose: Computes the 3d curve for the edge <E> if it does
197 -- not exist. Returns True if the curve was computed
198 -- or existed. Returns False if there is no planar
199 -- pcurve or the computation failed.
200 -- <MaxSegment> >= 30 in approximation
202 BuildCurves3d(S : Shape from TopoDS ;
203 Tolerance : Real from Standard;
204 Continuity : Shape from GeomAbs = GeomAbs_C1;
205 MaxDegree : Integer = 14;
206 MaxSegment : Integer = 0 --30
209 ---Purpose: Computes the 3d curves for all the edges of <S>
210 -- return False if one of the computation failed.
211 -- <MaxSegment> >= 30 in approximation
213 BuildCurves3d(S : Shape from TopoDS)
216 ---Purpose: Computes the 3d curves for all the edges of <S>
217 -- return False if one of the computation failed.
222 UpdateEdgeTol( E : Edge from TopoDS ;
223 MinToleranceRequest : Real from Standard ;
224 MaxToleranceToCheck : Real from Standard)
225 ---Purpose: Checks if the edge has a Tolerance smaller than -- --
226 -- -- -- MaxToleranceToCheck if so it will compute the
227 -- radius of -- the cylindrical pipe surface that
228 -- MinToleranceRequest is the minimum tolerance before it
229 -- is usefull to start testing. Usually it should be arround
231 -- contains all -- the curve represenation of the edge
232 -- returns True if the Edge tolerance had to be updated
236 UpdateEdgeTolerance(S : Shape from TopoDS;
237 MinToleranceRequest : Real from Standard ;
238 MaxToleranceToCheck : Real from Standard)
240 ---Purpose: -- Checks all the edges of the shape whose -- -- --
241 -- Tolerance is smaller than MaxToleranceToCheck --
242 -- Returns True if at least one edge was updated --
243 -- MinToleranceRequest is the minimum tolerance before
244 -- -- it -- is usefull to start testing. Usually it
245 -- should be arround -- 10e-5--
247 -- Warning :The method is very slow as it checks all.
248 -- Use only in interfaces or processing assimilate batch
253 SameParameter(E: Edge from TopoDS;
254 Tolerance : Real from Standard = 1.0e-5);
255 ---Purpose: Computes new 2d curve(s) for the edge <E> to have
256 -- the same parameter as the 3d curve.
257 -- The algorithm is not done if the flag SameParameter
258 -- was True on the Edge.
262 SameParameter(S: Shape from TopoDS ;
263 Tolerance : Real from Standard = 1.0e-5;
264 forced : Boolean from Standard = Standard_False);
265 ---Purpose: Computes new 2d curve(s) for all the edges of <S>
266 -- to have the same parameter as the 3d curve.
267 -- The algorithm is not done if the flag SameParameter
268 -- was True on an Edge.
270 UpdateTolerances(S: Shape from TopoDS;
271 verifyFaceTolerance : Boolean from Standard = Standard_False);
272 ---Purpose: Replaces tolerance of FACE EDGE VERTEX by the
273 -- tolerance Max of their connected handling shapes.
274 -- It is not necessary to use this call after
275 -- SameParameter. (called in)
277 OrientClosedSolid(solid : in out Solid from TopoDS)
278 ---Purpose: Orients the solid forward and the shell with the
279 -- orientation to have matter in the solid. Returns
280 -- False if the solid is unOrientable (open or incoherent)
284 EncodeRegularity(S : Shape from TopoDS;
285 TolAng : Real from Standard = 1.0e-10);
286 ---Purpose: Encodes the Regularity of edges on a Shape.
287 -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
288 -- Warning: If the edges's regularity are coded before, nothing
291 EncodeRegularity(S : in out Edge from TopoDS;
292 F1, F2 : Face from TopoDS;
293 TolAng : Real from Standard = 1.0e-10);
294 ---Purpose: Encodes the Regularity beetween <F1> and <F2> by <E>
295 -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
296 -- Warning: If the edge's regularity is coded before, nothing
299 SortFaces (S : Shape from TopoDS;
300 LF : in out ListOfShape from TopTools);
301 ---Purpose: Sorts in LF the Faces of S on the complexity of
303 -- (Plane,Cylinder,Cone,Sphere,Torus,other)
305 ReverseSortFaces (S : Shape from TopoDS;
306 LF : in out ListOfShape from TopTools);
307 ---Purpose: Sorts in LF the Faces of S on the reverse
308 -- complexity of their surfaces
309 -- (other,Torus,Sphere,Cone,Cylinder,Plane)