// Created on: 1993-03-17 // Created by: Laurent BUCHARD // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #define TOLTANGENCY 0.0000000001 #include #include #include #define Debug(expr) cout<<" expr :"<Compute(tu1,tv1,tu2,tv2,aP,aT,aTS1,aTS2); P=MyPnt; } //======================================================================= //function : SeekPoint //purpose : Computes point on curve and // parameters on the surfaces. //======================================================================= Standard_Boolean ApproxInt_PrmPrmSvSurfaces::SeekPoint(const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, IntSurf_PntOn2S& Point) { gp_Pnt aP; gp_Vec aT; gp_Vec2d aTS1,aTS2; Standard_Real tu1=u1; Standard_Real tu2=u2; Standard_Real tv1=v1; Standard_Real tv2=v2; if (!Compute(tu1,tv1,tu2,tv2,aP,aT,aTS1,aTS2)) return Standard_False; Point.SetValue(aP, tu1,tv1,tu2,tv2); return Standard_True; } //-------------------------------------------------------------------------------- Standard_Boolean ApproxInt_PrmPrmSvSurfaces::Tangency(const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec& T) { gp_Pnt aP; gp_Vec aT; gp_Vec2d aTS1,aTS2; Standard_Real tu1=u1; Standard_Real tu2=u2; Standard_Real tv1=v1; Standard_Real tv2=v2; Standard_Boolean t=this->Compute(tu1,tv1,tu2,tv2,aP,aT,aTS1,aTS2); T=MyTg; return(t); } //-------------------------------------------------------------------------------- Standard_Boolean ApproxInt_PrmPrmSvSurfaces::TangencyOnSurf1(const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec2d& T) { gp_Pnt aP; gp_Vec aT; gp_Vec2d aTS1,aTS2; Standard_Real tu1=u1; Standard_Real tu2=u2; Standard_Real tv1=v1; Standard_Real tv2=v2; Standard_Boolean t=this->Compute(tu1,tv1,tu2,tv2,aP,aT,aTS1,aTS2); T=MyTguv1; return(t); } //-------------------------------------------------------------------------------- Standard_Boolean ApproxInt_PrmPrmSvSurfaces::TangencyOnSurf2(const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec2d& T) { gp_Pnt aP; gp_Vec aT; gp_Vec2d aTS1,aTS2; Standard_Real tu1=u1; Standard_Real tu2=u2; Standard_Real tv1=v1; Standard_Real tv2=v2; Standard_Boolean t=this->Compute(tu1,tv1,tu2,tv2,aP,aT,aTS1,aTS2); T=MyTguv2; return(t); } //-------------------------------------------------------------------------------- #if 0 //------------------------------------------------------------ //-- Calcul de Tguv1 //-- ThePSurfaceTool::D1(MySurf1,u1,v1,P,TU,TV); TUTV = TU.Dot(TV); TgTU = Tg.Dot(TU); TgTV = Tg.Dot(TV); UmTUTV2 = 1.0 - TUTV * TUTV; DeltaU = (TgTU - TgTV * TUTV ) / UmTUTV2 ; DeltaV = (TgTV - TgTU * TUTV ) / UmTUTV2 ; Delta = 1.0 / Sqrt(DeltaU * DeltaU + DeltaV * DeltaV); Tguv1.Multiplied(Delta); MyTguv1 = Tguv1; //------------------------------------------------------------ //-- Calcul de Tguv2 //-- ThePSurfaceTool::D1(MySurf2,u2,v2,P,TU,TV); TUTV = TU.Dot(TV); TgTU = Tg.Dot(TU); TgTV = Tg.Dot(TV); UmTUTV2 = 1.0 - TUTV * TUTV; DeltaU = (TgTU - TgTV * TUTV ) / UmTUTV2 ; DeltaV = (TgTV - TgTU * TUTV ) / UmTUTV2 ; Delta = 1.0 / Sqrt(DeltaU * DeltaU + DeltaV * DeltaV); Tguv2.Multiplied(Delta); MyTguv2 = Tguv2; return(Standard_True); } #endif