0023703: Projection algorithm produces incomplete 2D-Curve
authornbv <nbv@opencascade.com>
Fri, 15 Feb 2013 13:04:16 +0000 (17:04 +0400)
committernbv <nbv@opencascade.com>
Fri, 15 Feb 2013 13:04:16 +0000 (17:04 +0400)
Change compare algorithm.
Adding test case for this fix

src/ProjLib/ProjLib_CompProjectedCurve.cxx
tests/bugs/moddata/bug23703 [new file with mode: 0755]

index 944a37e..5d32f25 100755 (executable)
@@ -661,22 +661,27 @@ static Standard_Boolean InitialPoint(const gp_Pnt& Point,
         // as initial point for aPrjPS, so we switch them
        gp_Vec2d D;
        
-       if(U == Uinf && mySurface->IsUPeriodic())
+       if((Abs(U - Uinf) < mySurface->UResolution(Precision::PConfusion())) &&
+                                                        mySurface->IsUPeriodic())
         { 
          d1(t, U, V, D, myCurve, mySurface);
          if (D.X() < 0) U = Usup;
        }
-       else if(U == Usup && mySurface->IsUPeriodic())
-        {
+       else if((Abs(U - Usup) < mySurface->UResolution(Precision::PConfusion())) &&
+                                                        mySurface->IsUPeriodic())
+    {
          d1(t, U, V, D, myCurve, mySurface);
          if (D.X() > 0) U = Uinf;
        }
-       if(V == Vinf && mySurface->IsVPeriodic()) 
+
+       if((Abs(V - Vinf) < mySurface->VResolution(Precision::PConfusion())) && 
+                                                        mySurface->IsVPeriodic()) 
         {
          d1(t, U, V, D, myCurve, mySurface);
          if (D.Y() < 0) V = Vsup;
        }
-       else if(V == Vsup && mySurface->IsVPeriodic())
+       else if((Abs(V - Vsup) <= mySurface->VResolution(Precision::PConfusion())) &&
+                                                        mySurface->IsVPeriodic())
         {
          d1(t, U, V, D, myCurve, mySurface);
          if (D.Y() > 0) V = Vinf;
diff --git a/tests/bugs/moddata/bug23703 b/tests/bugs/moddata/bug23703
new file mode 100755 (executable)
index 0000000..098d07b
--- /dev/null
@@ -0,0 +1,20 @@
+puts "========"
+puts "CR23703"
+puts "========"
+puts ""
+####################################################################
+## Projection algorithm produces incomplete 2D-Curve
+####################################################################
+
+restore [locate_data_file bug23703_c2x.brep] c
+restore [locate_data_file bug23703_s1.brep] s
+
+mkface f s
+pcurve f
+
+project c2d c s
+
+v2d
+2dfit
+
+set only_screen_axo 1