1 -- Created on: 1996-01-25
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.
22 class GenLocateExtCS from Extrema
24 ---Purpose: With two close points it calculates the distance
25 -- between two surfaces.
26 -- This distance can be a minimum or a maximum.
28 uses POnSurf from Extrema,
31 Surface from Adaptor3d,
34 raises DomainError from Standard,
39 Create returns GenLocateExtCS;
41 Create (C:Curve from Adaptor3d; S: Surface from Adaptor3d;
42 T, U,V: Real; Tol1,Tol2: Real)
43 returns GenLocateExtCS
44 ---Purpose: Calculates the distance with two close points.
45 -- The close points are defined by the parameter values
46 -- T for C and (U,V) for S.
47 -- The function F(t,u,v)=distance(C(t),S(u,v))
48 -- has an extremun when gradient(F)=0. The algorithm searchs
49 -- a zero near the close points.
51 -- if T,U,V are outside the definition ranges of the
54 Perform(me: in out; C: Curve from Adaptor3d; S: Surface from Adaptor3d;
55 T, U,V: Real; Tol1,Tol2: Real)
59 IsDone (me) returns Boolean
60 ---Purpose: Returns True if the distance is found.
63 SquareDistance (me) returns Real
64 ---Purpose: Returns the value of the extremum square distance.
65 raises NotDone from StdFail
66 -- if IsDone(me)=False.
69 PointOnCurve (me) returns POnCurv
70 ---Purpose: Returns the point of the extremum distance on C.
72 raises NotDone from StdFail
73 -- if IsDone(me)=False.
77 PointOnSurface (me) returns POnSurf
78 ---Purpose: Returns the point of the extremum distance on S.
80 raises NotDone from StdFail
81 -- if IsDone(me)=False.
87 myPoint1: POnCurv from Extrema;
88 myPoint2: POnSurf from Extrema;