1 -- Created on: 2000-11-16
2 -- Created by: Peter KURNEV
3 -- Copyright (c) 2000-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class Tools from IntTools
19 --- The class contains handy static functions
20 --- dealing with the geometry and topology.
33 CommonPrt from IntTools,
36 SequenceOfCurves from IntTools,
44 ComputeVV (myclass;V1,V2:Vertex from TopoDS)
45 returns Integer from Standard;
47 --- Computes distance between vertex V1 and vertex V2,
48 --- if the distance is less than sum of vertex tolerances
50 --- otherwise returns negative value
53 HasInternalEdge (myclass;
55 returns Boolean from Standard;
57 --- Returns True if wire aW contains edges
58 --- with INTERNAL orientation
61 MakeFaceFromWireAndFace (myclass;
64 aFNew:out Face from TopoDS);
66 --- Build a face based on surface of given face aF
67 --- and bounded by wire aW
70 ClassifyPointByFace (myclass;
73 returns State from TopAbs;
78 IsVertex (myclass; E: Edge from TopoDS;
79 t: Real from Standard)
80 returns Boolean from Standard;
82 --- Computes square distance between a point on the edge E
83 --- corresponded to parameter t and vertices of edge E.
84 --- Returns True if this distance is less than square
85 --- tolerance of vertex, otherwise returns false.
88 IsVertex (myclass; E: Edge from TopoDS;
89 V: Vertex from TopoDS;
90 t: Real from Standard)
91 returns Boolean from Standard;
93 --- Returns True if square distance between vertex V
94 --- and a point on the edge E corresponded to parameter t
95 --- is less than square tolerance of V
98 IsVertex (myclass; aCmnPrt: CommonPrt from IntTools)
99 returns Boolean from Standard;
101 --- Returns True if IsVertx for middle parameter of fist range
102 --- and first edge returns True
103 --- and if IsVertex for middle parameter of second range and
104 --- second range returns True,
105 --- otherwise returns False
108 IsMiddlePointsEqual(myclass;
109 E1: Edge from TopoDS;
110 E2: Edge from TopoDS)
111 returns Boolean from Standard;
113 --- Gets boundary of parameters of E1 and E2.
114 --- Computes 3d points on each corresponded to average parameters.
115 --- Returns True if distance between computed points is less than
116 --- sum of edge tolerance, otherwise returns False.
121 aTolPV: Real from Standard;
122 aV: Vertex from TopoDS)
123 returns Boolean from Standard;
125 --- Returns True if the distance between point aP and
126 --- vertex aV is less or equal to sum of aTolPV and
127 --- vertex tolerance, otherwise returns False
130 IntermediatePoint (myclass;
131 aFirst: Real from Standard;
132 aLast : Real from Standard)
133 returns Real from Standard;
135 --- Returns some value between aFirst and aLast
139 aC : Curve from IntTools;
140 aS :out SequenceOfCurves from IntTools)
141 returns Integer from Standard;
143 --- Split aC by average parameter if aC is closed in 3D.
144 --- Returns positive value if splitting has been done,
145 --- otherwise returns zero.
149 aSIn: SequenceOfCurves from IntTools;
150 aSOut:out SequenceOfCurves from IntTools);
152 --- Puts curves from aSIn to aSOut except those curves that
153 --- are coincide with first curve from aSIn.
156 IsDirsCoinside (myclass;
159 returns Boolean from Standard;
161 --- Returns True if D1 and D2 coinside
164 IsDirsCoinside (myclass;
167 aTol:Real from Standard)
168 returns Boolean from Standard;
170 --- Returns True if D1 and D2 coinside with given tolerance
174 aC : Curve from Geom)
175 returns Boolean from Standard;
177 --- Returns True if aC is BoundedCurve from Geom and
178 --- the distance between first point
179 --- of the curve aC and last point
180 --- is less than 1.e-12
183 CurveTolerance(myclass;
184 aC : Curve from Geom;
185 aTolBase : Real from Standard)
186 returns Real from Standard;
188 --- Returns adaptive tolerance for given aTolBase
189 --- if aC is trimmed curve and basis curve is parabola,
190 --- otherwise returns value of aTolBase
192 --~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195 theC:Curve from Geom;
196 theTol:Real from Standard;
197 theBox:out Box from Bnd)
198 returns Boolean from Standard;
201 theT:Real from Standard;
202 theRange:Range from IntTools;
203 theTol: Real from Standard)
204 returns Boolean from Standard;
206 VertexParameters(myclass;
207 theCP:CommonPrt from IntTools;
208 theT1:out Real from Standard;
209 theT2:out Real from Standard);
211 VertexParameter(myclass;
212 theCP:CommonPrt from IntTools;
213 theT:out Real from Standard);
216 theT:Real from Standard;
217 theRange:Range from IntTools;
218 theTol: Real from Standard)
219 returns Boolean from Standard;
222 theRRef : Range from IntTools;
223 theR : Range from IntTools;
224 theTol : Real from Standard)
225 returns Boolean from Standard;
226 ---Purpose: Checks if the range <theR> interfere with the range <theRRef>
229 theLin : Lin from gp;
230 theTLin1 : Real from Standard;
231 theTLin2 : Real from Standard;
232 theTolLin: Real from Standard;
233 thePln : Pln from gp;
234 theTolPln: Real from Standard;
235 theP :out Pnt from gp;
236 theT :out Real from Standard;
237 theTolP :out Real from Standard;
238 theTmin :out Real from Standard;
239 theTmax :out Real from Standard)
240 returns Integer from Standard;
242 ComputeTolerance(myclass;
243 theCurve3D : Curve from Geom;
244 theCurve2D : Curve from Geom2d;
245 theSurf : Surface from Geom;
246 theFirst : Real from Standard;
247 theLast : Real from Standard;
248 theMaxDist : out Real from Standard;
249 theMaxPar : out Real from Standard)
250 returns Boolean from Standard;
252 -- Computes the max distance between points
253 -- taken from 3D and 2D curves by the same parameter