// File: GC_MakeArcOfCircle.cxx // Created: Fri Oct 2 16:30:57 1992 // Author: Remi GILET // #include #include #include #include #include #include #include #include //======================================================================= //function : GC_MakeArcOfCircle //purpose : //======================================================================= GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 , const gp_Pnt& P2 , const gp_Pnt& P3 ) { Standard_Boolean sense; // gce_MakeCirc Cir(P1, P2, P3); TheError = Cir.Status(); if (TheError == gce_Done) { Standard_Real Alpha1, Alpha3;//,Alpha2 gp_Circ C(Cir.Value()); //modified by NIZNHY-PKV Thu Mar 3 10:53:02 2005f //Alpha1 is always =0. //Alpha1 = ElCLib::Parameter(C,P1); //Alpha2 = ElCLib::Parameter(C,P2); //Alpha3 = ElCLib::Parameter(C,P3); // //if (Alpha2 >= Alpha1 && Alpha2 <= Alpha3) sense = Standard_True; //else if (Alpha1 <= Alpha3 && Alpha2 >= Alpha3 ) sense = Standard_True; //else sense = Standard_False; // Alpha1=0.; Alpha3 = ElCLib::Parameter(C, P3); sense=Standard_True; //modified by NIZNHY-PKV Thu Mar 3 10:53:04 2005t Handle(Geom_Circle) Circ = new Geom_Circle(C); TheArc= new Geom_TrimmedCurve(Circ, Alpha1, Alpha3, sense); } } //======================================================================= //function : GC_MakeArcOfCircle //purpose : //======================================================================= GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 , const gp_Vec& V , const gp_Pnt& P2 ) { gp_Circ cir; gce_MakeLin Corde(P1,P2); TheError = Corde.Status(); if (TheError == gce_Done) { gp_Lin corde(Corde.Value()); gp_Dir dir(corde.Direction()); gp_Dir dbid(V); gp_Dir Daxe(dbid^dir); gp_Dir Dir1(Daxe^dir); gp_Lin bis(gp_Pnt((P1.X()+P2.X())/2.,(P1.Y()+P2.Y())/2., (P1.Z()+P2.Z())/2.),Dir1); gp_Dir d(dbid^Daxe); gp_Lin norm(P1,d); Standard_Real Tol = 0.000000001; Extrema_ExtElC distmin(bis,norm,Tol); if (!distmin.IsDone()) { TheError = gce_IntersectionError; } else { Standard_Integer nbext = distmin.NbExt(); if (nbext == 0) { TheError = gce_IntersectionError; } else { Standard_Real TheDist = RealLast(); gp_Pnt pInt,pon1,pon2; Standard_Integer i = 1; Extrema_POnCurv Pon1,Pon2; while (i<=nbext) { if (distmin.SquareDistance(i)