1 -- Created on: 1996-01-22
2 -- Created by: Laurent PAINNOT
3 -- Copyright (c) 1996-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.
23 class GenLocateExtSS from Extrema
25 ---Purpose: With two close points it calculates the distance
26 -- between two surfaces.
27 -- This distance can be a minimum or a maximum.
29 uses POnSurf from Extrema,
31 Surface from Adaptor3d
33 raises DomainError from Standard,
38 Create returns GenLocateExtSS;
40 Create (S1, S2: Surface from Adaptor3d; U1,V1, U2,V2: Real; Tol1,Tol2: Real)
41 returns GenLocateExtSS
42 ---Purpose: Calculates the distance with two close points.
43 -- The close points are defined by the parameter values
44 -- (U1,V1) for S1 and (U2,V2) for S2.
45 -- The function F(u1,v1,u2,v2)=distance(S1(u1,v1),S2(u2,v2))
46 -- has an extremun when gradient(F)=0. The algorithm searchs
47 -- a zero near the close points.
49 -- if U1,V1,U2,V2 are outside the definition ranges of the
52 Perform(me: in out; S1, S2: Surface from Adaptor3d;
53 U1,V1, U2,V2: Real; Tol1,Tol2: Real)
57 IsDone (me) returns Boolean
58 ---Purpose: Returns True if the distance is found.
61 SquareDistance (me) returns Real
62 ---Purpose: Returns the value of the extremum square distance.
63 raises NotDone from StdFail
64 -- if IsDone(me)=False.
67 PointOnS1 (me) returns POnSurf
68 ---Purpose: Returns the point of the extremum distance on S1.
70 raises NotDone from StdFail
71 -- if IsDone(me)=False.
75 PointOnS2 (me) returns POnSurf
76 ---Purpose: Returns the point of the extremum distance on S2.
78 raises NotDone from StdFail
79 -- if IsDone(me)=False.
85 myPoint1: POnSurf from Extrema;
86 myPoint2: POnSurf from Extrema;