]> OCCT Git - occt-copy.git/commitdiff
Revert some suspicious changes
authorabv <abv@opencascade.com>
Sat, 13 Aug 2016 06:01:06 +0000 (09:01 +0300)
committerabv <abv@opencascade.com>
Sat, 13 Aug 2016 06:01:06 +0000 (09:01 +0300)
src/Intf/Intf_InterferencePolygonPolyhedron.gxx
src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx

index b860baa279a00078587c356d7ff49c8eef8eacbe..37507c3ac7ebd6da248e16f9da9b52eb56d978ea 100644 (file)
 
 #include <Extrema_ExtElC.hxx>
 #include <Extrema_POnCurv.hxx>
-#include <Precision.hxx>
 
 static const int Pourcent3[4] = {0, 1, 2, 0};
 
 static Standard_Boolean IsInSegment(const gp_Vec& P1P2,
-  const gp_Vec& P1P,
-  const Standard_Real NP1P2,
-  Standard_Real &Param,
-  const Standard_Real Tolerance) { 
-    Param = P1P2.Dot(P1P);
-    Param/= NP1P2;
-    if(Param > (NP1P2+Tolerance))
-      return(Standard_False);
-    if(Param < (-Tolerance))
-      return(Standard_False);
-    Param/=NP1P2;
-    if(Param<0.0) Param=0.0;
-    if(Param>1.0) Param=1.0;
-    return(Standard_True);
+                                   const gp_Vec& P1P,
+                                   const Standard_Real NP1P2,
+                                   Standard_Real &Param,
+                                   const Standard_Real Tolerance) { 
+  Param = P1P2.Dot(P1P);
+  Param/= NP1P2;
+  if(Param > (NP1P2+Tolerance))
+    return(Standard_False);
+  if(Param < (-Tolerance))
+    return(Standard_False);
+  Param/=NP1P2;
+  if(Param<0.0) Param=0.0;
+  if(Param>1.0) Param=1.0;
+  return(Standard_True);
 }
-
+    
 
 //=======================================================================
 //function : Intf_InterferencePolygonPolyhedron
@@ -58,7 +57,7 @@ static Standard_Boolean IsInSegment(const gp_Vec& P1P2,
 //=======================================================================
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron() 
-  : Intf_Interference (Standard_False),
+: Intf_Interference (Standard_False),
   BeginOfClosedPolygon (Standard_False),
   iLin (0)
 {} 
@@ -71,12 +70,12 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron()
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
   (const Polygon3d& thePolyg, const Polyhedron& thePolyh) 
-  : Intf_Interference (Standard_False),
+: Intf_Interference (Standard_False),
   BeginOfClosedPolygon (Standard_False),
   iLin (0)
 {
   Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
-    ToolPolyh::DeflectionOverEstimation(thePolyh);
+           ToolPolyh::DeflectionOverEstimation(thePolyh);
   if (Tolerance==0.)
     Tolerance=Epsilon(1000.);
 
@@ -88,13 +87,13 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
   (const Polygon3d& thePolyg, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid) 
-  : Intf_Interference (Standard_False),
+   Bnd_BoundSortBox &PolyhGrid) 
+: Intf_Interference (Standard_False),
   BeginOfClosedPolygon (Standard_False),
   iLin (0)
 {
   Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
-    ToolPolyh::DeflectionOverEstimation(thePolyh);
+           ToolPolyh::DeflectionOverEstimation(thePolyh);
   if (Tolerance==0.)
     Tolerance=Epsilon(1000.);
 
@@ -111,7 +110,7 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
   (const gp_Lin& theLin, const Polyhedron& thePolyh) 
-  : Intf_Interference (Standard_False),
+: Intf_Interference (Standard_False),
   BeginOfClosedPolygon (Standard_False),
   iLin (0)
 {
@@ -123,7 +122,7 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
   Bnd_BoundSortBox PolyhGrid;
   PolyhGrid.Initialize(ToolPolyh::Bounding(thePolyh),
-    ToolPolyh::ComponentsBounding(thePolyh));
+                      ToolPolyh::ComponentsBounding(thePolyh));
   Standard_Integer indTri;
 
   iLin=0;
@@ -136,9 +135,9 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
   while (iCl.More()) {
     indTri=iCl.Value();
     Intersect
-      (theLin.Location(), 
-      theLin.Location().Translated(gp_Vec(theLin.Direction())),
-      Standard_True, indTri, thePolyh);
+       (theLin.Location(), 
+        theLin.Location().Translated(gp_Vec(theLin.Direction())),
+        Standard_True, indTri, thePolyh);
     iCl.Next();
   }
 }
@@ -152,7 +151,7 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron 
   (const Intf_Array1OfLin& theLins, const Polyhedron& thePolyh) 
-  : Intf_Interference (Standard_False),
+: Intf_Interference (Standard_False),
   BeginOfClosedPolygon (Standard_False),
   iLin (0)
 {
@@ -166,7 +165,7 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
   Bnd_BoundSortBox PolyhGrid;
   PolyhGrid.Initialize(ToolPolyh::Bounding(thePolyh),
-    ToolPolyh::ComponentsBounding(thePolyh));
+                      ToolPolyh::ComponentsBounding(thePolyh));
 
   Standard_Integer indTri;
 
@@ -180,9 +179,9 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
     while (ilC.More()) {
       indTri=ilC.Value();
       Intersect
-        (theLins(iLin).Location(), 
-        theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
-        Standard_True, indTri, thePolyh);
+       (theLins(iLin).Location(), 
+       theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
+       Standard_True, indTri, thePolyh);
       ilC.Next();
     }
   }
@@ -199,13 +198,13 @@ void Intf_InterferencePolygonPolyhedron::Perform
 {
   SelfInterference(Standard_False);
   Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
-    ToolPolyh::DeflectionOverEstimation(thePolyh);
+           ToolPolyh::DeflectionOverEstimation(thePolyh);
   if (Tolerance==0.)
     Tolerance=Epsilon(1000.);
 
   if (!ToolPolygon3d::Bounding(thePolyg).IsOut
-    (ToolPolyh::Bounding(thePolyh))) {
-      Interference(thePolyg, thePolyh);
+      (ToolPolyh::Bounding(thePolyh))) {
+    Interference(thePolyg, thePolyh);
   }
 } 
 
@@ -227,7 +226,7 @@ void Intf_InterferencePolygonPolyhedron::Perform
 
   Bnd_BoundSortBox PolyhGrid;
   PolyhGrid.Initialize(ToolPolyh::Bounding(thePolyh),
-    ToolPolyh::ComponentsBounding(thePolyh));
+                      ToolPolyh::ComponentsBounding(thePolyh));
 
   Standard_Integer indTri;
 
@@ -241,9 +240,9 @@ void Intf_InterferencePolygonPolyhedron::Perform
   while (lCi.More()) {
     indTri=lCi.Value();
     Intersect
-      (theLin.Location(), 
-      theLin.Location().Translated(gp_Vec(theLin.Direction())),
-      Standard_True, indTri, thePolyh);
+       (theLin.Location(), 
+        theLin.Location().Translated(gp_Vec(theLin.Direction())),
+        Standard_True, indTri, thePolyh);
     lCi.Next();
   }
 }
@@ -269,7 +268,7 @@ void Intf_InterferencePolygonPolyhedron::Perform
 
   Bnd_BoundSortBox PolyhGrid;
   PolyhGrid.Initialize(ToolPolyh::Bounding(thePolyh),
-    ToolPolyh::ComponentsBounding(thePolyh));
+                      ToolPolyh::ComponentsBounding(thePolyh));
 
   Standard_Integer indTri;
 
@@ -282,9 +281,9 @@ void Intf_InterferencePolygonPolyhedron::Perform
     while (tlC.More()) {
       indTri=tlC.Value();
       Intersect
-        (theLins(iLin).Location(), 
-        theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
-        Standard_True, indTri, thePolyh);
+       (theLins(iLin).Location(), 
+       theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
+       Standard_True, indTri, thePolyh);
       tlC.Next();
     }
   }
@@ -305,7 +304,7 @@ void Intf_InterferencePolygonPolyhedron::Interference
 
   Bnd_BoundSortBox PolyhGrid;
   PolyhGrid.Initialize(ToolPolyh::Bounding(thePolyh),
-    ToolPolyh::ComponentsBounding(thePolyh));
+                      ToolPolyh::ComponentsBounding(thePolyh));
 
   Standard_Integer indTri;
   BeginOfClosedPolygon=ToolPolygon3d::Closed(thePolyg);
@@ -336,21 +335,21 @@ void Intf_InterferencePolygonPolyhedron::Interference
       gp_Vec Normale = PaPb.Crossed(PaPc);
       Standard_Real Norm_Normale=Normale.Magnitude();
       if(Norm_Normale<1e-14)
-        continue;
+       continue;
       Normale.Multiply(defPh/Norm_Normale);
       gp_Pnt p1m = p1.Translated(-Normale);
       gp_Pnt p1p = p1.Translated( Normale);
       gp_Pnt p2m = p2.Translated(-Normale);
       gp_Pnt p2p = p2.Translated( Normale);
       Intersect(p1m, 
-        p2p,
-        Standard_False, indTri, thePolyh);
+               p2p,
+               Standard_False, indTri, thePolyh);
       Intersect(p1p, 
-        p2m,
-        Standard_False, indTri, thePolyh);
-      //      Intersect(ToolPolygon3d::BeginOfSeg(thePolyg, iLin), 
-      //               ToolPolygon3d::EndOfSeg(thePolyg, iLin),
-      //               Standard_False, indTri, thePolyh);
+               p2m,
+               Standard_False, indTri, thePolyh);
+//      Intersect(ToolPolygon3d::BeginOfSeg(thePolyg, iLin), 
+//             ToolPolygon3d::EndOfSeg(thePolyg, iLin),
+//             Standard_False, indTri, thePolyh);
     }
     BeginOfClosedPolygon=Standard_False;
   }
@@ -383,8 +382,8 @@ void Intf_InterferencePolygonPolyhedron::Interference
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
   (const gp_Lin& theLin, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid) 
-  : Intf_Interference(Standard_False)
+   Bnd_BoundSortBox &PolyhGrid) 
+: Intf_Interference(Standard_False)
 {
   Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
   if (Tolerance==0.)
@@ -404,9 +403,9 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
   while (iCl.More()) {
     indTri=iCl.Value();
     Intersect
-      (theLin.Location(), 
-      theLin.Location().Translated(gp_Vec(theLin.Direction())),
-      Standard_True, indTri, thePolyh);
+       (theLin.Location(), 
+        theLin.Location().Translated(gp_Vec(theLin.Direction())),
+        Standard_True, indTri, thePolyh);
     iCl.Next();
   }
 }
@@ -420,8 +419,8 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
 Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron 
   (const Intf_Array1OfLin& theLins, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid) 
-  : Intf_Interference(Standard_False)
+   Bnd_BoundSortBox &PolyhGrid) 
+: Intf_Interference(Standard_False)
 {
   Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
   if (Tolerance==0.)
@@ -443,9 +442,9 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
     while (ilC.More()) {
       indTri=ilC.Value();
       Intersect
-        (theLins(iLin).Location(), 
-        theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
-        Standard_True, indTri, thePolyh);
+       (theLins(iLin).Location(), 
+       theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
+       Standard_True, indTri, thePolyh);
       ilC.Next();
     }
   }
@@ -459,17 +458,17 @@ Intf_InterferencePolygonPolyhedron::Intf_InterferencePolygonPolyhedron
 
 void Intf_InterferencePolygonPolyhedron::Perform 
   (const Polygon3d& thePolyg, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid) 
+   Bnd_BoundSortBox &PolyhGrid) 
 {
   SelfInterference(Standard_False);
   Tolerance=ToolPolygon3d::DeflectionOverEstimation(thePolyg)+
-    ToolPolyh::DeflectionOverEstimation(thePolyh);
+           ToolPolyh::DeflectionOverEstimation(thePolyh);
   if (Tolerance==0.)
     Tolerance=Epsilon(1000.);
 
   if (!ToolPolygon3d::Bounding(thePolyg).IsOut
-    (ToolPolyh::Bounding(thePolyh))) {
-      Interference(thePolyg, thePolyh,PolyhGrid);
+      (ToolPolyh::Bounding(thePolyh))) {
+    Interference(thePolyg, thePolyh,PolyhGrid);
   }
 } 
 
@@ -481,7 +480,7 @@ void Intf_InterferencePolygonPolyhedron::Perform
 
 void Intf_InterferencePolygonPolyhedron::Perform 
   (const gp_Lin& theLin, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid) 
+   Bnd_BoundSortBox &PolyhGrid) 
 {
   SelfInterference(Standard_False);
   Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
@@ -502,9 +501,9 @@ void Intf_InterferencePolygonPolyhedron::Perform
   while (lCi.More()) {
     indTri=lCi.Value();
     Intersect
-      (theLin.Location(), 
-      theLin.Location().Translated(gp_Vec(theLin.Direction())),
-      Standard_True, indTri, thePolyh);
+       (theLin.Location(), 
+        theLin.Location().Translated(gp_Vec(theLin.Direction())),
+        Standard_True, indTri, thePolyh);
     lCi.Next();
   }
 }
@@ -518,7 +517,7 @@ void Intf_InterferencePolygonPolyhedron::Perform
 
 void Intf_InterferencePolygonPolyhedron::Perform  
   (const Intf_Array1OfLin& theLins, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid) 
+   Bnd_BoundSortBox &PolyhGrid) 
 {
   SelfInterference(Standard_False);
   Tolerance=ToolPolyh::DeflectionOverEstimation(thePolyh);
@@ -540,9 +539,9 @@ void Intf_InterferencePolygonPolyhedron::Perform
     while (tlC.More()) {
       indTri=tlC.Value();
       Intersect
-        (theLins(iLin).Location(), 
-        theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
-        Standard_True, indTri, thePolyh);
+       (theLins(iLin).Location(), 
+       theLins(iLin).Location().Translated(gp_Vec(theLins(iLin).Direction())),
+       Standard_True, indTri, thePolyh);
       tlC.Next();
     }
   }
@@ -558,7 +557,7 @@ void Intf_InterferencePolygonPolyhedron::Perform
 
 void Intf_InterferencePolygonPolyhedron::Interference 
   (const Polygon3d& thePolyg, const Polyhedron& thePolyh,
-  Bnd_BoundSortBox &PolyhGrid)
+   Bnd_BoundSortBox &PolyhGrid)
 {
   Bnd_Box bofSeg;
 
@@ -595,38 +594,38 @@ void Intf_InterferencePolygonPolyhedron::Interference
       ToolPolyh::Triangle(thePolyh, indTri, pTri[0], pTri[1], pTri[2]);
       gp_XYZ triNor;                                   // Vecteur normal.
       Standard_Real triDp = 0.;                        // Distance polaire.
-
+      
       Intf::PlaneEquation(ToolPolyh::Point(thePolyh, pTri[0]),
-        ToolPolyh::Point(thePolyh, pTri[1]),
-        ToolPolyh::Point(thePolyh, pTri[2]),
-        triNor, triDp);
+                         ToolPolyh::Point(thePolyh, pTri[1]),
+                         ToolPolyh::Point(thePolyh, pTri[2]),
+                         triNor, triDp);
 
       // enlarge boundary segment
       if ( iLin == 1 ) {
-        gp_XYZ dif = p1.XYZ() - p2.XYZ();
-        Standard_Real dist = dif.Modulus();
-        if ( dist > gp::Resolution() ) {
-          dif /= dist;
-          Standard_Real aCos = dif * triNor;
-          aCos = fabs(aCos);
-          if ( aCos > gp::Resolution() ) {
-            Standard_Real shift = defPh / aCos;
-            Beg0.SetXYZ( p1.XYZ() + dif * shift );
-          }
-        }
+       gp_XYZ dif = p1.XYZ() - p2.XYZ();
+       Standard_Real dist = dif.Modulus();
+       if ( dist > gp::Resolution() ) {
+         dif /= dist;
+         Standard_Real aCos = dif * triNor;
+         aCos = fabs(aCos);
+         if ( aCos > gp::Resolution() ) {
+           Standard_Real shift = defPh / aCos;
+           Beg0.SetXYZ( p1.XYZ() + dif * shift );
+         }
+       }
       }
       else if ( iLin == ToolPolygon3d::NbSegments(thePolyg) ) {
-        gp_XYZ dif = p2.XYZ() - p1.XYZ();
-        Standard_Real dist = dif.Modulus();
-        if ( dist > gp::Resolution() ) {
-          dif /= dist;
-          Standard_Real aCos = dif * triNor;
-          aCos = fabs(aCos);
-          if ( aCos > gp::Resolution() ) {
-            Standard_Real shift = defPh / aCos;
-            End0.SetXYZ( p2.XYZ() + dif * shift );
-          }
-        }
+       gp_XYZ dif = p2.XYZ() - p1.XYZ();
+       Standard_Real dist = dif.Modulus();
+       if ( dist > gp::Resolution() ) {
+         dif /= dist;
+         Standard_Real aCos = dif * triNor;
+         aCos = fabs(aCos);
+         if ( aCos > gp::Resolution() ) {
+           Standard_Real shift = defPh / aCos;
+           End0.SetXYZ( p2.XYZ() + dif * shift );
+         }
+       }
       }
       Standard_Real dBegTri=(triNor*Beg0.XYZ())-triDp; // Distance <p1> plane
       Standard_Real dEndTri=(triNor*End0.XYZ())-triDp; // Distance <p2> plane
@@ -648,8 +647,8 @@ void Intf_InterferencePolygonPolyhedron::Interference
 //=======================================================================
 #if 0 
 void Intf_InterferencePolygonPolyhedron::Intersect 
-  (const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite,
 const Standard_Integer TTri, const Polyhedron& thePolyh)
+(const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite,
+ const Standard_Integer TTri, const Polyhedron& thePolyh)
 {
   Standard_Integer pTri0,pTri1,pTri2;
   ToolPolyh::Triangle(thePolyh, TTri, pTri0, pTri1, pTri2);
@@ -662,13 +661,13 @@ void Intf_InterferencePolygonPolyhedron::Intersect
   Standard_Real Norm_Normale=Normale.Magnitude();
   if(Norm_Normale<1e-14)
     return;
-
+  
   //-- Equation du Plan 
   Standard_Real A=Normale.X()/Norm_Normale;
   Standard_Real B=Normale.Y()/Norm_Normale;
   Standard_Real C=Normale.Z()/Norm_Normale;
   Standard_Real D=-(A*Pa.X()+B*Pa.Y()+C*Pa.Z());
-
+  
   gp_Vec BegOEndO(BegO,EndO);
   Standard_Real Norm_BegOEndO=BegOEndO.Magnitude();
   if(Norm_BegOEndO<1e-14) 
@@ -676,17 +675,17 @@ void Intf_InterferencePolygonPolyhedron::Intersect
   Standard_Real Lx=BegOEndO.X()/Norm_BegOEndO;
   Standard_Real Ly=BegOEndO.Y()/Norm_BegOEndO;
   Standard_Real Lz=BegOEndO.Z()/Norm_BegOEndO;
-
+  
   Standard_Real Vd=A*Lx+B*Ly+C*Lz;  //-- DirLigne . NormalePlan
-
+  
   if(Vd==0) { //-- Droite parallele au plan 
     return;
   }
-
-
+  
+  
   //-- Calcul du parametre sur la ligne 
   Standard_Real t=-(A*BegO.X()+B*BegO.Y()+C*BegO.Z()+D) / Vd;
-
+  
   Standard_Real tol=1e-8; //-- Deflection sur le triangle
   if(t<-tol || t>(Norm_BegOEndO+tol)) { 
     if(Infinite==Standard_False) {
@@ -696,11 +695,11 @@ void Intf_InterferencePolygonPolyhedron::Intersect
   //-- On a une intersection droite plan 
   //-- On teste si c est dans le triangle 
   gp_Pnt PRes(BegO.X()+t*Lx,BegO.Y()+t*Ly,BegO.Z()+t*Lz);
-
+  
   Standard_Real AbsA=A; if(AbsA<0) AbsA=-AbsA;
   Standard_Real AbsB=B; if(AbsB<0) AbsB=-AbsB;
   Standard_Real AbsC=C; if(AbsC<0) AbsC=-AbsC;
-
+  
   Standard_Real Au,Av,Bu,Bv,Cu,Cv,Pu,Pv;
   if(AbsA>AbsB) { 
     if(AbsA>AbsC) { 
@@ -730,7 +729,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect
   Standard_Real ABu=Bu-Au; Standard_Real ABv=Bv-Av;
   Standard_Real ACu=Cu-Au; Standard_Real ACv=Cv-Av;
   Standard_Real BCu=Cu-Bu; Standard_Real BCv=Cv-Bv;
-
+  
   Standard_Real t1,t2;
   //-- Test sur AB et C
   t1=-ABv*Cu + ABu*Cv;
@@ -749,18 +748,18 @@ void Intf_InterferencePolygonPolyhedron::Intersect
 
 
   Intf_SectionPoint SP(PRes,
-    Intf_EDGE, 
-    0, 
-    iLin, //-- !!!!! VARIABLE STATIQUE 
-    t / Norm_BegOEndO, 
-    Intf_FACE, 
-    TTri, 0, 0.,1.);
+                      Intf_EDGE, 
+                      0, 
+                      iLin, //-- !!!!! VARIABLE STATIQUE 
+                      t / Norm_BegOEndO, 
+                      Intf_FACE, 
+                      TTri, 0, 0.,1.);
   mySPoins.Append(SP);
 }
 #else 
 void Intf_InterferencePolygonPolyhedron::Intersect 
   (const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite,
-  const Standard_Integer TTri, const Polyhedron& thePolyh)
+   const Standard_Integer TTri, const Polyhedron& thePolyh)
 {
   Intf_PIType typOnG=Intf_EDGE;
   Standard_Real t;
@@ -770,9 +769,9 @@ void Intf_InterferencePolygonPolyhedron::Intersect
   Standard_Real triDp;                             // Distance polaire.
 
   Intf::PlaneEquation(ToolPolyh::Point(thePolyh, pTri[0]),
-    ToolPolyh::Point(thePolyh, pTri[1]),
-    ToolPolyh::Point(thePolyh, pTri[2]),
-    triNor, triDp);
+                     ToolPolyh::Point(thePolyh, pTri[1]),
+                     ToolPolyh::Point(thePolyh, pTri[2]),
+                     triNor, triDp);
 
 
   Standard_Real dBegTri=(triNor*BegO.XYZ())-triDp; // Distance <BegO> plan
@@ -787,12 +786,12 @@ void Intf_InterferencePolygonPolyhedron::Intersect
     param = dBegTri/t;
   else param = dBegTri;
   Standard_Real floatgap=Epsilon(1000.);
-
+  
   if (!Infinite) {
     if (dBegTri<=floatgap && dBegTri>=-floatgap ) {
       param=0.;typOnG=Intf_VERTEX;
       if (BeginOfClosedPolygon) 
-        NoIntersectionWithTriangle = Standard_False;
+       NoIntersectionWithTriangle = Standard_False;
     }
     else if (dEndTri<=floatgap && dEndTri>=-floatgap) {
       param=1.;typOnG=Intf_VERTEX;
@@ -811,154 +810,127 @@ void Intf_InterferencePolygonPolyhedron::Intersect
     Standard_Integer tbreak=0;
     { //-- is = 0
       gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[1]).XYZ()-
-        ToolPolyh::Point(thePolyh, pTri[0]).XYZ());
+                 ToolPolyh::Point(thePolyh, pTri[0]).XYZ());
       gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[0]).XYZ());
       dPtPi[0]=vecP.Modulus();
       if (dPtPi[0]<=floatgap) {
-        sVertex=0;
-        is=0;
-        tbreak=1;
+       sVertex=0;
+       is=0;
+       tbreak=1;
       }
       else { 
-        gp_XYZ segT_x_vecP(segT^vecP);
-        Standard_Real Modulus_segT_x_vecP;
-        if(Precision::IsInfinite(segT_x_vecP.X()) || Precision::IsInfinite(segT_x_vecP.Y()) ||
-          Precision::IsInfinite(segT_x_vecP.Z()))
-        {
-          Modulus_segT_x_vecP = Precision::Infinite();
-        }
-        else
-        {
-          Modulus_segT_x_vecP = segT_x_vecP.Modulus();
-        }
-        sigd = segT_x_vecP*triNor;
-        if(sigd>floatgap) 
-          sigd = 1.0;
-        else if(sigd<-floatgap)
-          sigd = -1.0;
-        else {
-          sigd = 0.0;
-        }
-        dPiE[0]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
-        if (dPiE[0]<=floatgap && dPiE[0]>=-floatgap) {
-          sEdge=0;
-          is=0;
-          tbreak=1;
-        }
+       gp_XYZ segT_x_vecP(segT^vecP);
+       Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
+       sigd = segT_x_vecP*triNor;
+       if(sigd>floatgap) 
+         sigd = 1.0;
+       else if(sigd<-floatgap)
+         sigd = -1.0;
+       else {
+         sigd = 0.0;
+       }
+       dPiE[0]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
+       if (dPiE[0]<=floatgap && dPiE[0]>=-floatgap) {
+         sEdge=0;
+         is=0;
+         tbreak=1;
+       }
       }
     }
 
     if(tbreak==0) { //-- is = 1 
       gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[2]).XYZ()-
-        ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
+                 ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
       gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
       dPtPi[1]=vecP.Modulus();
       if (dPtPi[1]<=floatgap) {
-        sVertex=1;
-        is=1;
-        tbreak=1;
+       sVertex=1;
+       is=1;
+       tbreak=1;
       }
       else { 
-        gp_XYZ segT_x_vecP(segT^vecP);
-        Standard_Real Modulus_segT_x_vecP;
-        if(Precision::IsInfinite(segT_x_vecP.X()) || Precision::IsInfinite(segT_x_vecP.Y()) ||
-          Precision::IsInfinite(segT_x_vecP.Z()))
-        {
-          Modulus_segT_x_vecP = Precision::Infinite();
-        }
-        else
-        {
-          Modulus_segT_x_vecP = segT_x_vecP.Modulus();
-        }
-        sigd = segT_x_vecP*triNor;
-        if(sigd>floatgap) 
-          sigd = 1.0;
-        else if(sigd<-floatgap)
-          sigd = -1.0;
-        else {
-          sigd = 0.0;
-        }
-        dPiE[1]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
-        if (dPiE[1]<=floatgap && dPiE[1]>=-floatgap) {
-          sEdge=1;
-          is=1;
-          tbreak=1;
-        }
+       gp_XYZ segT_x_vecP(segT^vecP);
+       Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
+       sigd = segT_x_vecP*triNor;
+       if(sigd>floatgap) 
+         sigd = 1.0;
+       else if(sigd<-floatgap)
+         sigd = -1.0;
+       else {
+         sigd = 0.0;
+       }
+       dPiE[1]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
+       if (dPiE[1]<=floatgap && dPiE[1]>=-floatgap) {
+         sEdge=1;
+         is=1;
+         tbreak=1;
+       }
       }
     }
     if(tbreak==0) { //-- is = 2
       gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[0]).XYZ()-
-        ToolPolyh::Point(thePolyh, pTri[2]).XYZ());
+                 ToolPolyh::Point(thePolyh, pTri[2]).XYZ());
       gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[2]).XYZ());
       dPtPi[2]=vecP.Modulus();
       if (dPtPi[2]<=floatgap) {
-        sVertex=2;
-        is=2;
+       sVertex=2;
+       is=2;
       }
       gp_XYZ segT_x_vecP(segT^vecP);
-      Standard_Real Modulus_segT_x_vecP;
-      if(Precision::IsInfinite(segT_x_vecP.X()) || Precision::IsInfinite(segT_x_vecP.Y()) ||
-        Precision::IsInfinite(segT_x_vecP.Z()))
-      {
-        Modulus_segT_x_vecP = Precision::Infinite();
-      }
-      else
-      {
-        Modulus_segT_x_vecP = segT_x_vecP.Modulus();
-      }
+      Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
       sigd = segT_x_vecP*triNor;
       if(sigd>floatgap) 
-        sigd = 1.0;
+       sigd = 1.0;
       else if(sigd<-floatgap)
-        sigd = -1.0;
+       sigd = -1.0;
       else {
-        sigd = 0.0;
+       sigd = 0.0;
       }
       dPiE[2]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
       if (dPiE[2]<=floatgap && dPiE[2]>=-floatgap) {
-        sEdge=2;
-        is=2;
+       sEdge=2;
+       is=2;
       }
     }
     //-- fin for i=0 to 2
     // !!cout<<endl;
-
+    
     Standard_Integer triCon, pedg;
     if      (sVertex>-1) {
       triCon=TTri;
       pedg=pTri[Pourcent3[sVertex+1]];
-      //--      while (triCon!=0) {
-      //--     ToolPolyh::TriConnex(thePolyh, triCon,pTri[sVertex],pedg,triCon,pedg);
-      //--     //-- if (triCon<TTri) return;
-      //--     if (triCon==TTri) break;
-      //--      }
+//--      while (triCon!=0) {
+//--   ToolPolyh::TriConnex(thePolyh, triCon,pTri[sVertex],pedg,triCon,pedg);
+//--   //-- if (triCon<TTri) return;
+//--   if (triCon==TTri) break;
+//--      }
       Intf_SectionPoint SP(spLieu,
-        typOnG, 0, iLin, param, 
-        Intf_VERTEX, pTri[is], 0, 0.,
-        1.);
+                          typOnG, 0, iLin, param, 
+                          Intf_VERTEX, pTri[is], 0, 0.,
+                          1.);
       mySPoins.Append(SP);
     }
     else if (sEdge>-1) {
       ToolPolyh::TriConnex(thePolyh, TTri, pTri[sEdge], pTri[Pourcent3[sEdge+1]],
-        triCon, pedg);
+                          triCon, pedg);
       //-- if (triCon<=TTri) return; ???????????????????? LBR 
       // !!cout<<" sEdge "<<endl;
       Intf_SectionPoint SP(spLieu,
-        typOnG, 0, iLin, param, 
-        Intf_EDGE, Min(pTri[sEdge], pTri[Pourcent3[sEdge+1]]),
-        Max(pTri[sEdge], pTri[Pourcent3[sEdge+1]]), 0.,
-        1.);
+                          typOnG, 0, iLin, param, 
+                          Intf_EDGE, Min(pTri[sEdge], pTri[Pourcent3[sEdge+1]]),
+                          Max(pTri[sEdge], pTri[Pourcent3[sEdge+1]]), 0.,
+                          1.);
       mySPoins.Append(SP);
     }
     else if (dPiE[0]>0. && dPiE[1]>0. && dPiE[2]>0.) {
       // !!cout<<" 3 Positifs "<<endl;
       Intf_SectionPoint SP(spLieu,
-        typOnG, 0, iLin, param, 
-        Intf_FACE, TTri, 0, 0.,
-        1.);
+                          typOnG, 0, iLin, param, 
+                          Intf_FACE, TTri, 0, 0.,
+                          1.);
       mySPoins.Append(SP);
     }
-    //  Modified by Sergey KHROMOV - Fri Dec  7 14:40:11 2001 Begin
+//  Modified by Sergey KHROMOV - Fri Dec  7 14:40:11 2001 Begin
     // Sometimes triangulation doesn't cover whole the face. In this
     // case it is necessary to take into account the deflection between boundary
     // isolines of the surface and boundary trianles. Computed value of this
@@ -967,54 +939,54 @@ void Intf_InterferencePolygonPolyhedron::Intersect
       Standard_Integer i;
 
       for (i = 1; i <= 3; i++) {
-        Standard_Integer indP1 = (i == 3) ? pTri[0] : pTri[i];
-        Standard_Integer indP2 = pTri[i - 1];
-
-        if (ToolPolyh::IsOnBound(thePolyh, indP1, indP2)) {
-          // For boundary line it is necessary to check the border deflection.
-          Standard_Real  Deflection = ToolPolyh::GetBorderDeflection(thePolyh);
-          const gp_Pnt  &BegP       = ToolPolyh::Point(thePolyh, indP1);
-          const gp_Pnt  &EndP       = ToolPolyh::Point(thePolyh, indP2);
-          gp_Vec         VecTri(BegP,EndP);
-          gp_Dir         DirTri(VecTri);
-          gp_Lin         LinTri(BegP,DirTri);
-          gp_Pnt         aPOnE(spLieu);
-          Standard_Real  aDist = LinTri.Distance(aPOnE);
-
-          if (aDist <= Deflection) {
-            gp_Vec        aVLocPOnE(BegP, aPOnE);
-            gp_Vec        aVecDirTri(DirTri);
-            Standard_Real aPar    = aVLocPOnE*aVecDirTri;
-            Standard_Real aMaxPar = VecTri.Magnitude();
-
-            if (aPar >= 0 && aPar <= aMaxPar) {
-              Intf_SectionPoint SP(spLieu,
-                typOnG, 0, iLin, param, 
-                Intf_FACE, TTri, 0, 0.,
-                1.);
-              mySPoins.Append(SP);
-            }
-          }
-        }
+       Standard_Integer indP1 = (i == 3) ? pTri[0] : pTri[i];
+       Standard_Integer indP2 = pTri[i - 1];
+
+       if (ToolPolyh::IsOnBound(thePolyh, indP1, indP2)) {
+         // For boundary line it is necessary to check the border deflection.
+         Standard_Real  Deflection = ToolPolyh::GetBorderDeflection(thePolyh);
+         const gp_Pnt  &BegP       = ToolPolyh::Point(thePolyh, indP1);
+         const gp_Pnt  &EndP       = ToolPolyh::Point(thePolyh, indP2);
+         gp_Vec         VecTri(BegP,EndP);
+         gp_Dir         DirTri(VecTri);
+         gp_Lin         LinTri(BegP,DirTri);
+         gp_Pnt         aPOnE(spLieu);
+         Standard_Real  aDist = LinTri.Distance(aPOnE);
+
+         if (aDist <= Deflection) {
+           gp_Vec        aVLocPOnE(BegP, aPOnE);
+           gp_Vec        aVecDirTri(DirTri);
+           Standard_Real aPar    = aVLocPOnE*aVecDirTri;
+           Standard_Real aMaxPar = VecTri.Magnitude();
+
+           if (aPar >= 0 && aPar <= aMaxPar) {
+             Intf_SectionPoint SP(spLieu,
+                                  typOnG, 0, iLin, param, 
+                                  Intf_FACE, TTri, 0, 0.,
+                                  1.);
+             mySPoins.Append(SP);
+           }
+         }
+       }
       }
     }
-    //  Modified by Sergey KHROMOV - Fri Dec  7 14:40:29 2001 End
+//  Modified by Sergey KHROMOV - Fri Dec  7 14:40:29 2001 End
   } //---- if(NoIntersectionWithTriangle == Standard_False)
-
+  
   //---------------------------------------------------------------------------
   //-- On teste la distance entre les cotes du triangle et le polygone 
   //-- 
   //-- Si cette distance est inferieure a Tolerance, on cree un SP.
   //--    
   //-- printf("\nIntf_InterferencePolygPolyh : dBegTri=%g dEndTri=%g Tolerance=%g\n",dBegTri,dEndTri,Tolerance);
-  //  if(Abs(dBegTri) <= Tolerance || Abs(dEndTri) <= Tolerance)
+//  if(Abs(dBegTri) <= Tolerance || Abs(dEndTri) <= Tolerance)
   {
     gp_Vec VecPol(BegO,EndO);
     Standard_Real NVecPol = VecPol.Magnitude();
     gp_Dir DirPol(VecPol);
     gp_Lin LinPol(BegO,DirPol);
     Standard_Real dist2,ParamOnO,ParamOnT;
-
+    
     for (Standard_Integer i=0; i<3; i++) {
       Standard_Integer pTri_ip1pc3 = pTri[Pourcent3[i+1]];
       Standard_Integer pTri_i      = pTri[i];
@@ -1026,38 +998,38 @@ void Intf_InterferencePolygonPolyhedron::Intersect
       gp_Lin  LinTri(BegT,DirTri);
       Extrema_ExtElC Extrema(LinPol,LinTri,0.00000001);
       if(Extrema.IsDone()) { 
-        if(Extrema.IsParallel() == Standard_False) { 
-          if(Extrema.NbExt()) { 
-            dist2 = Extrema.SquareDistance();
-            if(dist2<=Tolerance * Tolerance) {
-              Extrema_POnCurv POnC1,POnC2;
-              Extrema.Points(1,POnC1,POnC2);
-              const gp_Pnt& PO = POnC1.Value();
-              const gp_Pnt& PT = POnC2.Value();
-              //--cout<<" ** Nouveau "<<dist2<<endl;
-              if(IsInSegment(VecPol,gp_Vec(BegO,PO),NVecPol,ParamOnO,Tolerance)) {
-                if(IsInSegment(VecTri,gp_Vec(BegT,PT),NVecTri,ParamOnT,Tolerance)) {
-                  //-- cout<<" * "<<endl;
-                  gp_XYZ spLieu=BegT.XYZ()+((EndT.XYZ()-BegT.XYZ())*param);
-                  Standard_Integer tmin,tmax;
-                  if(pTri_i>pTri_ip1pc3) { 
-                    tmin=pTri_ip1pc3; tmax=pTri_i; 
-                  }
-                  else { 
-                    tmax=pTri_ip1pc3; tmin=pTri_i; 
-                  }
-                  Intf_SectionPoint SP(spLieu,
-                    typOnG, 0, iLin, ParamOnO, 
-                    Intf_EDGE, 
-                    tmin, 
-                    tmax, 0.,
-                    1.);
-                  mySPoins.Append(SP);
-                }
-              }
-            }
-          }
-        }
+       if(Extrema.IsParallel() == Standard_False) { 
+         if(Extrema.NbExt()) { 
+           dist2 = Extrema.SquareDistance();
+           if(dist2<=Tolerance * Tolerance) {
+             Extrema_POnCurv POnC1,POnC2;
+             Extrema.Points(1,POnC1,POnC2);
+             const gp_Pnt& PO = POnC1.Value();
+             const gp_Pnt& PT = POnC2.Value();
+             //--cout<<" ** Nouveau "<<dist2<<endl;
+             if(IsInSegment(VecPol,gp_Vec(BegO,PO),NVecPol,ParamOnO,Tolerance)) {
+               if(IsInSegment(VecTri,gp_Vec(BegT,PT),NVecTri,ParamOnT,Tolerance)) {
+                 //-- cout<<" * "<<endl;
+                 gp_XYZ spLieu=BegT.XYZ()+((EndT.XYZ()-BegT.XYZ())*param);
+                 Standard_Integer tmin,tmax;
+                 if(pTri_i>pTri_ip1pc3) { 
+                   tmin=pTri_ip1pc3; tmax=pTri_i; 
+                 }
+                 else { 
+                   tmax=pTri_ip1pc3; tmin=pTri_i; 
+                 }
+                 Intf_SectionPoint SP(spLieu,
+                                      typOnG, 0, iLin, ParamOnO, 
+                                      Intf_EDGE, 
+                                      tmin, 
+                                      tmax, 0.,
+                                      1.);
+                 mySPoins.Append(SP);
+               }
+             }
+           }
+         }
+       }
       }
     }
   } 
@@ -1066,14 +1038,14 @@ void Intf_InterferencePolygonPolyhedron::Intersect
 #endif
 
 void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO, 
-  const gp_Pnt& EndO, 
-  const Standard_Boolean Infinite,
-  const Standard_Integer TTri, 
-  const Polyhedron& thePolyh, 
-  const gp_XYZ& TriNormal,
-  const Standard_Real /*TriDp*/, 
-  const Standard_Real dBegTri, 
-  const Standard_Real dEndTri)
+                                                    const gp_Pnt& EndO, 
+                                                    const Standard_Boolean Infinite,
+                                                    const Standard_Integer TTri, 
+                                                    const Polyhedron& thePolyh, 
+                                                    const gp_XYZ& TriNormal,
+                                                    const Standard_Real /*TriDp*/, 
+                                                    const Standard_Real dBegTri, 
+                                                    const Standard_Real dEndTri)
 {
   Intf_PIType typOnG=Intf_EDGE;
   Standard_Real t;
@@ -1083,8 +1055,8 @@ void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO,
   //Standard_Real triDp = TriDp;                             // Distance polaire.
 
 
-  //   Standard_Real dBegTri=(triNor*BegO.XYZ())-triDp; // Distance <BegO> plan
-  //   Standard_Real dEndTri=(triNor*EndO.XYZ())-triDp; // Distance <EndO> plan
+//   Standard_Real dBegTri=(triNor*BegO.XYZ())-triDp; // Distance <BegO> plan
+//   Standard_Real dEndTri=(triNor*EndO.XYZ())-triDp; // Distance <EndO> plan
 
   Standard_Boolean NoIntersectionWithTriangle = Standard_False;
 
@@ -1094,12 +1066,12 @@ void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO,
     param = dBegTri/t;
   else param = dBegTri;
   Standard_Real floatgap=Epsilon(1000.);
-
+  
   if (!Infinite) {
     if (dBegTri<=floatgap && dBegTri>=-floatgap ) {
       param=0.;typOnG=Intf_VERTEX;
       if (BeginOfClosedPolygon) 
-        NoIntersectionWithTriangle = Standard_False;
+       NoIntersectionWithTriangle = Standard_False;
     }
     else if (dEndTri<=floatgap && dEndTri>=-floatgap) {
       param=1.;typOnG=Intf_VERTEX;
@@ -1118,154 +1090,127 @@ void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO,
     Standard_Integer tbreak=0;
     { //-- is = 0
       gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[1]).XYZ()-
-        ToolPolyh::Point(thePolyh, pTri[0]).XYZ());
+                 ToolPolyh::Point(thePolyh, pTri[0]).XYZ());
       gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[0]).XYZ());
       dPtPi[0]=vecP.Modulus();
       if (dPtPi[0]<=floatgap) {
-        sVertex=0;
-        is=0;
-        tbreak=1;
+       sVertex=0;
+       is=0;
+       tbreak=1;
       }
       else { 
-        gp_XYZ segT_x_vecP(segT^vecP);
-        Standard_Real Modulus_segT_x_vecP;
-        if(Precision::IsInfinite(segT_x_vecP.X()) || Precision::IsInfinite(segT_x_vecP.Y()) ||
-          Precision::IsInfinite(segT_x_vecP.Z()))
-        {
-          Modulus_segT_x_vecP = Precision::Infinite();
-        }
-        else
-        {
-          Modulus_segT_x_vecP = segT_x_vecP.Modulus();
-        }
-        sigd = segT_x_vecP*triNor;
-        if(sigd>floatgap) 
-          sigd = 1.0;
-        else if(sigd<-floatgap)
-          sigd = -1.0;
-        else {
-          sigd = 0.0;
-        }
-        dPiE[0]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
-        if (dPiE[0]<=floatgap && dPiE[0]>=-floatgap) {
-          sEdge=0;
-          is=0;
-          tbreak=1;
-        }
+       gp_XYZ segT_x_vecP(segT^vecP);
+       Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
+       sigd = segT_x_vecP*triNor;
+       if(sigd>floatgap) 
+         sigd = 1.0;
+       else if(sigd<-floatgap)
+         sigd = -1.0;
+       else {
+         sigd = 0.0;
+       }
+       dPiE[0]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
+       if (dPiE[0]<=floatgap && dPiE[0]>=-floatgap) {
+         sEdge=0;
+         is=0;
+         tbreak=1;
+       }
       }
     }
-
+    
     if(tbreak==0) { //-- is = 1 
       gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[2]).XYZ()-
-        ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
+                 ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
       gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[1]).XYZ());
       dPtPi[1]=vecP.Modulus();
       if (dPtPi[1]<=floatgap) {
-        sVertex=1;
-        is=1;
-        tbreak=1;
+       sVertex=1;
+       is=1;
+       tbreak=1;
       }
       else { 
-        gp_XYZ segT_x_vecP(segT^vecP);
-        Standard_Real Modulus_segT_x_vecP;
-        if(Precision::IsInfinite(segT_x_vecP.X()) || Precision::IsInfinite(segT_x_vecP.Y()) ||
-          Precision::IsInfinite(segT_x_vecP.Z()))
-        {
-          Modulus_segT_x_vecP = Precision::Infinite();
-        }
-        else
-        {
-          Modulus_segT_x_vecP = segT_x_vecP.Modulus();
-        }
-        sigd = segT_x_vecP*triNor;
-        if(sigd>floatgap) 
-          sigd = 1.0;
-        else if(sigd<-floatgap)
-          sigd = -1.0;
-        else {
-          sigd = 0.0;
-        }
-        dPiE[1]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
-        if (dPiE[1]<=floatgap && dPiE[1]>=-floatgap) {
-          sEdge=1;
-          is=1;
-          tbreak=1;
-        }
+       gp_XYZ segT_x_vecP(segT^vecP);
+       Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
+       sigd = segT_x_vecP*triNor;
+       if(sigd>floatgap) 
+         sigd = 1.0;
+       else if(sigd<-floatgap)
+         sigd = -1.0;
+       else {
+         sigd = 0.0;
+       }
+       dPiE[1]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
+       if (dPiE[1]<=floatgap && dPiE[1]>=-floatgap) {
+         sEdge=1;
+         is=1;
+         tbreak=1;
+       }
       }
     }
     if(tbreak==0) { //-- is = 2
       gp_XYZ segT(ToolPolyh::Point(thePolyh, pTri[0]).XYZ()-
-        ToolPolyh::Point(thePolyh, pTri[2]).XYZ());
+                 ToolPolyh::Point(thePolyh, pTri[2]).XYZ());
       gp_XYZ vecP(spLieu-ToolPolyh::Point(thePolyh, pTri[2]).XYZ());
       dPtPi[2]=vecP.Modulus();
       if (dPtPi[2]<=floatgap) {
-        sVertex=2;
-        is=2;
+       sVertex=2;
+       is=2;
       }
       gp_XYZ segT_x_vecP(segT^vecP);
-      Standard_Real Modulus_segT_x_vecP;
-      if(Precision::IsInfinite(segT_x_vecP.X()) || Precision::IsInfinite(segT_x_vecP.Y()) ||
-        Precision::IsInfinite(segT_x_vecP.Z()))
-      {
-        Modulus_segT_x_vecP = Precision::Infinite();
-      }
-      else
-      {
-        Modulus_segT_x_vecP = segT_x_vecP.Modulus();
-      }
+      Standard_Real Modulus_segT_x_vecP = segT_x_vecP.Modulus();
       sigd = segT_x_vecP*triNor;
       if(sigd>floatgap) 
-        sigd = 1.0;
+       sigd = 1.0;
       else if(sigd<-floatgap)
-        sigd = -1.0;
+       sigd = -1.0;
       else {
-        sigd = 0.0;
+       sigd = 0.0;
       }
       dPiE[2]=sigd*(Modulus_segT_x_vecP/segT.Modulus());
       if (dPiE[2]<=floatgap && dPiE[2]>=-floatgap) {
-        sEdge=2;
-        is=2;
+       sEdge=2;
+       is=2;
       }
     }
     //-- fin for i=0 to 2
     // !!cout<<endl;
-
+    
     Standard_Integer triCon, pedg;
     if      (sVertex>-1) {
       triCon=TTri;
       pedg=pTri[Pourcent3[sVertex+1]];
-      //--      while (triCon!=0) {
-      //--     ToolPolyh::TriConnex(thePolyh, triCon,pTri[sVertex],pedg,triCon,pedg);
-      //--     //-- if (triCon<TTri) return;
-      //--     if (triCon==TTri) break;
-      //--      }
+//--      while (triCon!=0) {
+//--   ToolPolyh::TriConnex(thePolyh, triCon,pTri[sVertex],pedg,triCon,pedg);
+//--   //-- if (triCon<TTri) return;
+//--   if (triCon==TTri) break;
+//--      }
       Intf_SectionPoint SP(spLieu,
-        typOnG, 0, iLin, param, 
-        Intf_VERTEX, pTri[is], 0, 0.,
-        1.);
+                          typOnG, 0, iLin, param, 
+                          Intf_VERTEX, pTri[is], 0, 0.,
+                          1.);
       mySPoins.Append(SP);
     }
     else if (sEdge>-1) {
       ToolPolyh::TriConnex(thePolyh, TTri, pTri[sEdge], pTri[Pourcent3[sEdge+1]],
-        triCon, pedg);
+                          triCon, pedg);
       //-- if (triCon<=TTri) return; ???????????????????? LBR 
       // !!cout<<" sEdge "<<endl;
       Intf_SectionPoint SP(spLieu,
-        typOnG, 0, iLin, param, 
-        Intf_EDGE, Min(pTri[sEdge], pTri[Pourcent3[sEdge+1]]),
-        Max(pTri[sEdge], pTri[Pourcent3[sEdge+1]]), 0.,
-        1.);
+                          typOnG, 0, iLin, param, 
+                          Intf_EDGE, Min(pTri[sEdge], pTri[Pourcent3[sEdge+1]]),
+                          Max(pTri[sEdge], pTri[Pourcent3[sEdge+1]]), 0.,
+                          1.);
       mySPoins.Append(SP);
     }
     else if (dPiE[0]>0. && dPiE[1]>0. && dPiE[2]>0.) {
       // !!cout<<" 3 Positifs "<<endl;
       Intf_SectionPoint SP(spLieu,
-        typOnG, 0, iLin, param, 
-        Intf_FACE, TTri, 0, 0.,
-        1.);
+                          typOnG, 0, iLin, param, 
+                          Intf_FACE, TTri, 0, 0.,
+                          1.);
       mySPoins.Append(SP);
     }
-    //  Modified by Sergey KHROMOV - Fri Dec  7 14:40:11 2001 Begin
+//  Modified by Sergey KHROMOV - Fri Dec  7 14:40:11 2001 Begin
     // Sometimes triangulation doesn't cover whole the face. In this
     // case it is necessary to take into account the deflection between boundary
     // isolines of the surface and boundary trianles. Computed value of this
@@ -1274,54 +1219,54 @@ void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO,
       Standard_Integer i;
 
       for (i = 1; i <= 3; i++) {
-        Standard_Integer indP1 = (i == 3) ? pTri[0] : pTri[i];
-        Standard_Integer indP2 = pTri[i - 1];
-
-        if (ToolPolyh::IsOnBound(thePolyh, indP1, indP2)) {
-          // For boundary line it is necessary to check the border deflection.
-          Standard_Real  Deflection = ToolPolyh::GetBorderDeflection(thePolyh);
-          const gp_Pnt  &BegP       = ToolPolyh::Point(thePolyh, indP1);
-          const gp_Pnt  &EndP       = ToolPolyh::Point(thePolyh, indP2);
-          gp_Vec         VecTri(BegP,EndP);
-          gp_Dir         DirTri(VecTri);
-          gp_Lin         LinTri(BegP,DirTri);
-          gp_Pnt         aPOnE(spLieu);
-          Standard_Real  aDist = LinTri.Distance(aPOnE);
-
-          if (aDist <= Deflection) {
-            gp_Vec        aVLocPOnE(BegP, aPOnE);
-            gp_Vec        aVecDirTri(DirTri);
-            Standard_Real aPar    = aVLocPOnE*aVecDirTri;
-            Standard_Real aMaxPar = VecTri.Magnitude();
-
-            if (aPar >= 0 && aPar <= aMaxPar) {
-              Intf_SectionPoint SP(spLieu,
-                typOnG, 0, iLin, param, 
-                Intf_FACE, TTri, 0, 0.,
-                1.);
-              mySPoins.Append(SP);
-            }
-          }
-        }
+       Standard_Integer indP1 = (i == 3) ? pTri[0] : pTri[i];
+       Standard_Integer indP2 = pTri[i - 1];
+
+       if (ToolPolyh::IsOnBound(thePolyh, indP1, indP2)) {
+         // For boundary line it is necessary to check the border deflection.
+         Standard_Real  Deflection = ToolPolyh::GetBorderDeflection(thePolyh);
+         const gp_Pnt  &BegP       = ToolPolyh::Point(thePolyh, indP1);
+         const gp_Pnt  &EndP       = ToolPolyh::Point(thePolyh, indP2);
+         gp_Vec         VecTri(BegP,EndP);
+         gp_Dir         DirTri(VecTri);
+         gp_Lin         LinTri(BegP,DirTri);
+         gp_Pnt         aPOnE(spLieu);
+         Standard_Real  aDist = LinTri.Distance(aPOnE);
+
+         if (aDist <= Deflection) {
+           gp_Vec        aVLocPOnE(BegP, aPOnE);
+           gp_Vec        aVecDirTri(DirTri);
+           Standard_Real aPar    = aVLocPOnE*aVecDirTri;
+           Standard_Real aMaxPar = VecTri.Magnitude();
+
+           if (aPar >= 0 && aPar <= aMaxPar) {
+             Intf_SectionPoint SP(spLieu,
+                                  typOnG, 0, iLin, param, 
+                                  Intf_FACE, TTri, 0, 0.,
+                                  1.);
+             mySPoins.Append(SP);
+           }
+         }
+       }
       }
     }
-    //  Modified by Sergey KHROMOV - Fri Dec  7 14:40:29 2001 End
+//  Modified by Sergey KHROMOV - Fri Dec  7 14:40:29 2001 End
   } //---- if(NoIntersectionWithTriangle == Standard_False)
-
+  
   //---------------------------------------------------------------------------
   //-- On teste la distance entre les cotes du triangle et le polygone 
   //-- 
   //-- Si cette distance est inferieure a Tolerance, on cree un SP.
   //--    
   //-- printf("\nIntf_InterferencePolygPolyh : dBegTri=%g dEndTri=%g Tolerance=%g\n",dBegTri,dEndTri,Tolerance);
-  //  if (Abs(dBegTri) <= Tolerance || Abs(dEndTri) <= Tolerance)
+//  if (Abs(dBegTri) <= Tolerance || Abs(dEndTri) <= Tolerance)
   {
     gp_Vec VecPol(BegO,EndO);
     Standard_Real NVecPol = VecPol.Magnitude();
     gp_Dir DirPol(VecPol);
     gp_Lin LinPol(BegO,DirPol);
     Standard_Real dist2,ParamOnO,ParamOnT;
-
+    
     for (Standard_Integer i=0; i<3; i++) {
       Standard_Integer pTri_ip1pc3 = pTri[Pourcent3[i+1]];
       Standard_Integer pTri_i      = pTri[i];
@@ -1333,38 +1278,38 @@ void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO,
       gp_Lin  LinTri(BegT,DirTri);
       Extrema_ExtElC Extrema(LinPol,LinTri,0.00000001);
       if(Extrema.IsDone()) { 
-        if(Extrema.IsParallel() == Standard_False) { 
-          if(Extrema.NbExt()) { 
-            dist2 = Extrema.SquareDistance();
-            if(dist2<=Tolerance * Tolerance) {
-              Extrema_POnCurv POnC1,POnC2;
-              Extrema.Points(1,POnC1,POnC2);
-              const gp_Pnt& PO = POnC1.Value();
-              const gp_Pnt& PT = POnC2.Value();
-              //--cout<<" ** Nouveau "<<dist2<<endl;
-              if(IsInSegment(VecPol,gp_Vec(BegO,PO),NVecPol,ParamOnO,Tolerance)) {
-                if(IsInSegment(VecTri,gp_Vec(BegT,PT),NVecTri,ParamOnT,Tolerance)) {
-                  //-- cout<<" * "<<endl;
-                  gp_XYZ spLieu=BegT.XYZ()+((EndT.XYZ()-BegT.XYZ())*param);
-                  Standard_Integer tmin,tmax;
-                  if(pTri_i>pTri_ip1pc3) { 
-                    tmin=pTri_ip1pc3; tmax=pTri_i; 
-                  }
-                  else { 
-                    tmax=pTri_ip1pc3; tmin=pTri_i; 
-                  }
-                  Intf_SectionPoint SP(spLieu,
-                    typOnG, 0, iLin, ParamOnO, 
-                    Intf_EDGE, 
-                    tmin, 
-                    tmax, 0.,
-                    1.);
-                  mySPoins.Append(SP);
-                }
-              }
-            }
-          }
-        }
+       if(Extrema.IsParallel() == Standard_False) { 
+         if(Extrema.NbExt()) { 
+           dist2 = Extrema.SquareDistance();
+           if(dist2<=Tolerance * Tolerance) {
+             Extrema_POnCurv POnC1,POnC2;
+             Extrema.Points(1,POnC1,POnC2);
+             const gp_Pnt& PO = POnC1.Value();
+             const gp_Pnt& PT = POnC2.Value();
+             //--cout<<" ** Nouveau "<<dist2<<endl;
+             if(IsInSegment(VecPol,gp_Vec(BegO,PO),NVecPol,ParamOnO,Tolerance)) {
+               if(IsInSegment(VecTri,gp_Vec(BegT,PT),NVecTri,ParamOnT,Tolerance)) {
+                 //-- cout<<" * "<<endl;
+                 gp_XYZ spLieu=BegT.XYZ()+((EndT.XYZ()-BegT.XYZ())*param);
+                 Standard_Integer tmin,tmax;
+                 if(pTri_i>pTri_ip1pc3) { 
+                   tmin=pTri_ip1pc3; tmax=pTri_i; 
+                 }
+                 else { 
+                   tmax=pTri_ip1pc3; tmin=pTri_i; 
+                 }
+                 Intf_SectionPoint SP(spLieu,
+                                      typOnG, 0, iLin, ParamOnO, 
+                                      Intf_EDGE, 
+                                      tmin, 
+                                      tmax, 0.,
+                                      1.);
+                 mySPoins.Append(SP);
+               }
+             }
+           }
+         }
+       }
       }
     }
   } 
index 597597e066e4c85020321c58e571ffa21481a8fc..4b410a518d1e48fbd2cc0bececddee5b7ac0ace2 100644 (file)
@@ -1508,14 +1508,7 @@ Handle(Geom2d_BSplineCurve)
   Standard_Real DistTol3d = 1.0*Tol3d;
   Standard_Real TolU = Surf->UResolution(Tol3d), TolV = Surf->VResolution(Tol3d);
   Standard_Real Tol2d = Max(Sqrt(TolU*TolU + TolV*TolV), Precision::PConfusion());
-  //
-  Standard_Real BigTol3d = 10.;
 
-  if(Tol3d > BigTol3d)
-  {
-    Tol2d = Max(Tol2d, 0.01 * Tol3d);//0.01 = PConfusion/Confusion
-  }
-  //
   Standard_Integer i;
   GeomAbs_SurfaceType TheTypeS = Surf->GetType();
   GeomAbs_CurveType TheTypeC = Curve->GetType();
index 35d6ad682d054d5ab218abecf4777a46f9213e62..1fc1cb1f21440b4a7e316a2544535d9dafacb66a 100644 (file)
@@ -328,7 +328,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv
         aMinParSpeed = Min(aMinParSpeed, aDist / aStep);
       }
       const Standard_Real aCoeff = aLength3d / (aLastParam - aFirstParam);
-      if (aCoeff > gp::Resolution())
+      if (Abs(aCoeff) > gp::Resolution())
         aKnotCoeffs.Append(aCoeff);
       aFirstParam = aLastParam;
     }