1 -- File: Extrema_GenLocateExtCS.cdl
2 -- Created: Thu Jan 25 15:26:00 1996
3 -- Author: Laurent PAINNOT
5 ---Copyright: Matra Datavision 1996
7 class GenLocateExtCS from Extrema
9 ---Purpose: With two close points it calculates the distance
10 -- between two surfaces.
11 -- This distance can be a minimum or a maximum.
13 uses POnSurf from Extrema,
16 Surface from Adaptor3d,
19 raises DomainError from Standard,
24 Create returns GenLocateExtCS;
26 Create (C:Curve from Adaptor3d; S: Surface from Adaptor3d;
27 T, U,V: Real; Tol1,Tol2: Real)
28 returns GenLocateExtCS
29 ---Purpose: Calculates the distance with two close points.
30 -- The close points are defined by the parameter values
31 -- T for C and (U,V) for S.
32 -- The function F(t,u,v)=distance(C(t),S(u,v))
33 -- has an extremun when gradient(F)=0. The algorithm searchs
34 -- a zero near the close points.
36 -- if T,U,V are outside the definition ranges of the
39 Perform(me: in out; C: Curve from Adaptor3d; S: Surface from Adaptor3d;
40 T, U,V: Real; Tol1,Tol2: Real)
44 IsDone (me) returns Boolean
45 ---Purpose: Returns True if the distance is found.
48 SquareDistance (me) returns Real
49 ---Purpose: Returns the value of the extremum square distance.
50 raises NotDone from StdFail
51 -- if IsDone(me)=False.
54 PointOnCurve (me) returns POnCurv
55 ---Purpose: Returns the point of the extremum distance on C.
57 raises NotDone from StdFail
58 -- if IsDone(me)=False.
62 PointOnSurface (me) returns POnSurf
63 ---Purpose: Returns the point of the extremum distance on S.
65 raises NotDone from StdFail
66 -- if IsDone(me)=False.
72 myPoint1: POnCurv from Extrema;
73 myPoint2: POnSurf from Extrema;