]> OCCT Git - occt-copy.git/commitdiff
0027133: Incorrect result of the normal projection algorithm
authoraml <aml@opencascade.com>
Mon, 8 Feb 2016 08:39:54 +0000 (11:39 +0300)
committeraml <aml@opencascade.com>
Mon, 8 Feb 2016 10:37:44 +0000 (13:37 +0300)
Topological tolerances changed to geometric tolerances.
Test case added.

src/ProjLib/ProjLib_CompProjectedCurve.cxx
tests/bugs/moddata_3/bug27133 [new file with mode: 0644]

index 6b2535eaed7ad3cc8ba815db6fa14677d9836b4b..1d5cc6e470602c7dfcd7c528e22f1df4d28457fe 100644 (file)
@@ -611,7 +611,7 @@ void ProjLib_CompProjectedCurve::Init()
 
   gp_Pnt Triple, prevTriple;
 
-  //Basic loop  
+  //Basic loop
   while(t <= LastU) 
   {
     //Search for the begining a new continuous part
@@ -660,7 +660,8 @@ void ProjLib_CompProjectedCurve::Init()
 #ifdef OCCT_DEBUG_CHRONO
         InitChron(chr_init_point);
 #endif
-        initpoint=InitialPoint(CPoint, t,myCurve,mySurface, myTolU, myTolV, U, V);
+        // PConfusion - use geometric tolerances in extrema / optimization.
+        initpoint=InitialPoint(CPoint, t,myCurve,mySurface, Precision::PConfusion(), Precision::PConfusion(), U, V);
 #ifdef OCCT_DEBUG_CHRONO
         ResultChron(chr_init_point,t_init_point);
         init_point_count++;
@@ -855,10 +856,10 @@ void ProjLib_CompProjectedCurve::Init()
            (Abs (Triple.Z() - mySurface->FirstVParameter()) < Precision::Confusion() ||
             Abs (Triple.Z() - mySurface->LastVParameter() ) < Precision::Confusion() ))
         {
-          // Go out from possible attraktor.
-
+          // Go out from possible attractor.
           Standard_Real U,V;
-          InitialPoint(myCurve->Value(t), t, myCurve, mySurface, myTolU, myTolV, U, V);
+          // PConfusion - use geometric tolerances in extrema / optimization.
+          InitialPoint(myCurve->Value(t), t, myCurve, mySurface, Precision::PConfusion(), Precision::PConfusion(), U, V);
           if (Abs (Abs(U - Triple.Y()) - mySurface->UPeriod()) < Precision::Confusion())
           {
             // Handle period jump.
diff --git a/tests/bugs/moddata_3/bug27133 b/tests/bugs/moddata_3/bug27133
new file mode 100644 (file)
index 0000000..d988795
--- /dev/null
@@ -0,0 +1,23 @@
+puts "================"
+puts "0027133"
+puts "================"
+puts ""
+##############################################################
+# Incorrect result of the normal projection algorithm
+# Oscillation at the edge end
+##############################################################
+
+restore [locate_data_file bug27133_aE.brep] aE
+restore [locate_data_file bug27133_aF.brep] aF
+
+nproject result aE aF
+
+# Result length check.
+checkprops result -l 0.0037337
+
+# Visual check.
+donly result
+smallview
+fit
+display aE aF
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png