1 -- Created on: 1996-01-22
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1996-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
9 -- under the terms of the GNU Lesser General Public 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.
17 class GenLocateExtSS from Extrema
19 ---Purpose: With two close points it calculates the distance
20 -- between two surfaces.
21 -- This distance can be a minimum or a maximum.
23 uses POnSurf from Extrema,
25 Surface from Adaptor3d
27 raises DomainError from Standard,
32 Create returns GenLocateExtSS;
34 Create (S1, S2: Surface from Adaptor3d; U1,V1, U2,V2: Real; Tol1,Tol2: Real)
35 returns GenLocateExtSS
36 ---Purpose: Calculates the distance with two close points.
37 -- The close points are defined by the parameter values
38 -- (U1,V1) for S1 and (U2,V2) for S2.
39 -- The function F(u1,v1,u2,v2)=distance(S1(u1,v1),S2(u2,v2))
40 -- has an extremun when gradient(F)=0. The algorithm searchs
41 -- a zero near the close points.
43 -- if U1,V1,U2,V2 are outside the definition ranges of the
46 Perform(me: in out; S1, S2: Surface from Adaptor3d;
47 U1,V1, U2,V2: Real; Tol1,Tol2: Real)
51 IsDone (me) returns Boolean
52 ---Purpose: Returns True if the distance is found.
55 SquareDistance (me) returns Real
56 ---Purpose: Returns the value of the extremum square distance.
57 raises NotDone from StdFail
58 -- if IsDone(me)=False.
61 PointOnS1 (me) returns POnSurf
62 ---Purpose: Returns the point of the extremum distance on S1.
64 raises NotDone from StdFail
65 -- if IsDone(me)=False.
69 PointOnS2 (me) returns POnSurf
70 ---Purpose: Returns the point of the extremum distance on S2.
72 raises NotDone from StdFail
73 -- if IsDone(me)=False.
79 myPoint1: POnSurf from Extrema;
80 myPoint2: POnSurf from Extrema;