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.
136 class CheckCurveOnSurface;
138 -- Computes the max distance between edge
139 -- and its 2d representation on the face.
142 -- Default precison methods.
143 -- The default precision is initialized with Precision::Confusion()
147 ---Purpose: Sets the default precision. The current Precision
151 Precision returns Real;
152 ---Purpose: Returns the default precision.
157 -- Default plane for 2d edges.
160 Plane(P : Plane from Geom);
161 ---Purpose: Sets the current plane to P.
164 Plane returns Plane from Geom;
165 ---Purpose: Returns the current plane.
167 ---C++: return const &
172 CheckSameRange(E : Edge from TopoDS ;
173 Confusion : Real from Standard = 1.0e-12)
176 ---Purpose: checks if the Edge is same range IGNORING
177 -- the same range flag of the edge
178 -- Confusion argument is to compare real numbers
179 -- idenpendently of any model space tolerance
183 SameRange(E : Edge from TopoDS ;
184 Tolerance : Real from Standard = 1.0e-5) ;
185 ---Purpose: will make all the curve representation have
186 -- the same range domain for the parameters.
187 -- This will IGNORE the same range flag value
189 -- If there is a 3D curve there it will the
190 -- range of that curve. If not the first curve representation
191 -- encountered in the list will give its range to
192 -- the all the other curves.
194 BuildCurve3d(E : Edge from TopoDS ;
195 Tolerance : Real from Standard = 1.0e-5 ;
196 Continuity : Shape from GeomAbs = GeomAbs_C1;
197 MaxDegree : Integer = 14;
198 MaxSegment : Integer = 0 --30
200 ---Purpose: Computes the 3d curve for the edge <E> if it does
201 -- not exist. Returns True if the curve was computed
202 -- or existed. Returns False if there is no planar
203 -- pcurve or the computation failed.
204 -- <MaxSegment> >= 30 in approximation
206 BuildCurves3d(S : Shape from TopoDS ;
207 Tolerance : Real from Standard;
208 Continuity : Shape from GeomAbs = GeomAbs_C1;
209 MaxDegree : Integer = 14;
210 MaxSegment : Integer = 0 --30
213 ---Purpose: Computes the 3d curves for all the edges of <S>
214 -- return False if one of the computation failed.
215 -- <MaxSegment> >= 30 in approximation
217 BuildCurves3d(S : Shape from TopoDS)
220 ---Purpose: Computes the 3d curves for all the edges of <S>
221 -- return False if one of the computation failed.
226 UpdateEdgeTol( E : Edge from TopoDS ;
227 MinToleranceRequest : Real from Standard ;
228 MaxToleranceToCheck : Real from Standard)
229 ---Purpose: Checks if the edge has a Tolerance smaller than -- --
230 -- -- -- MaxToleranceToCheck if so it will compute the
231 -- radius of -- the cylindrical pipe surface that
232 -- MinToleranceRequest is the minimum tolerance before it
233 -- is usefull to start testing. Usually it should be arround
235 -- contains all -- the curve represenation of the edge
236 -- returns True if the Edge tolerance had to be updated
240 UpdateEdgeTolerance(S : Shape from TopoDS;
241 MinToleranceRequest : Real from Standard ;
242 MaxToleranceToCheck : Real from Standard)
244 ---Purpose: -- Checks all the edges of the shape whose -- -- --
245 -- Tolerance is smaller than MaxToleranceToCheck --
246 -- Returns True if at least one edge was updated --
247 -- MinToleranceRequest is the minimum tolerance before
248 -- -- it -- is usefull to start testing. Usually it
249 -- should be arround -- 10e-5--
251 -- Warning :The method is very slow as it checks all.
252 -- Use only in interfaces or processing assimilate batch
257 SameParameter(E: Edge from TopoDS;
258 Tolerance : Real from Standard = 1.0e-5);
259 ---Purpose: Computes new 2d curve(s) for the edge <E> to have
260 -- the same parameter as the 3d curve.
261 -- The algorithm is not done if the flag SameParameter
262 -- was True on the Edge.
266 SameParameter(S: Shape from TopoDS ;
267 Tolerance : Real from Standard = 1.0e-5;
268 forced : Boolean from Standard = Standard_False);
269 ---Purpose: Computes new 2d curve(s) for all the edges of <S>
270 -- to have the same parameter as the 3d curve.
271 -- The algorithm is not done if the flag SameParameter
272 -- was True on an Edge.
274 UpdateTolerances(S: Shape from TopoDS;
275 verifyFaceTolerance : Boolean from Standard = Standard_False);
276 ---Purpose: Replaces tolerance of FACE EDGE VERTEX by the
277 -- tolerance Max of their connected handling shapes.
278 -- It is not necessary to use this call after
279 -- SameParameter. (called in)
281 OrientClosedSolid(solid : in out Solid from TopoDS)
282 ---Purpose: Orients the solid forward and the shell with the
283 -- orientation to have matter in the solid. Returns
284 -- False if the solid is unOrientable (open or incoherent)
288 EncodeRegularity(S : Shape from TopoDS;
289 TolAng : Real from Standard = 1.0e-10);
290 ---Purpose: Encodes the Regularity of edges on a Shape.
291 -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
292 -- Warning: If the edges's regularity are coded before, nothing
295 EncodeRegularity(S : in out Edge from TopoDS;
296 F1, F2 : Face from TopoDS;
297 TolAng : Real from Standard = 1.0e-10);
298 ---Purpose: Encodes the Regularity beetween <F1> and <F2> by <E>
299 -- Warning: <TolAng> is an angular tolerance, expressed in Rad.
300 -- Warning: If the edge's regularity is coded before, nothing
303 SortFaces (S : Shape from TopoDS;
304 LF : in out ListOfShape from TopTools);
305 ---Purpose: Sorts in LF the Faces of S on the complexity of
307 -- (Plane,Cylinder,Cone,Sphere,Torus,other)
309 ReverseSortFaces (S : Shape from TopoDS;
310 LF : in out ListOfShape from TopTools);
311 ---Purpose: Sorts in LF the Faces of S on the reverse
312 -- complexity of their surfaces
313 -- (other,Torus,Sphere,Cone,Cylinder,Plane)
315 EnsureNormalConsistency (S : Shape from TopoDS;
316 theAngTol: Real from Standard = 0.001;
317 ForceComputeNormals: Boolean from Standard = Standard_False)
319 ---Purpose: Corrects the normals in Poly_Triangulation of faces,
320 -- in such way that normals at nodes lying along smooth
321 -- edges have the same value on both adjacent triangulations.
322 -- Returns TRUE if any correction is done.