0027133: Incorrect result of the normal projection algorithm
authoraml <aml@opencascade.com>
Mon, 8 Feb 2016 08:39:54 +0000 (11:39 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 28 Mar 2016 14:31:09 +0000 (17:31 +0300)
Topological tolerances changed to geometric tolerances.
Protection from the usage of invalid result is added to restore good projection.
Test cases are updated.
Test case added.

Correction of test case for issue CR27133

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

index cca8a61..d3216c6 100644 (file)
@@ -621,7 +621,7 @@ void ProjLib_CompProjectedCurve::Init()
 
   gp_Pnt Triple, prevTriple;
 
-  //Basic loop  
+  //Basic loop
   while(t <= LastU) 
   {
     // Search for the beginning of a new continuous part
@@ -670,7 +670,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++;
@@ -1645,7 +1646,12 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt &thePoint) co
     return;
 
   Standard_Real U,V;
-  InitialPoint(myCurve->Value(thePoint.X()), thePoint.X(), myCurve, mySurface, myTolU, myTolV, U, V);
+  Standard_Boolean isDone = 
+    InitialPoint(myCurve->Value(thePoint.X()), thePoint.X(), myCurve, mySurface, 
+                 Precision::PConfusion(), Precision::PConfusion(), U, V);
+
+  if (!isDone)
+    return;
 
   // Restore original position in case of period jump.
   if (mySurface->IsUPeriodic() &&
index f786f30..9445f94 100755 (executable)
@@ -1,5 +1,7 @@
 puts "TODO OCC24156 MacOS: Tcl Exception: tolerance ang"
 puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
+puts "TODO OCC27203 ALL: Error: Max tolerance" 
+puts "TODO OCC27203 Linux: Error : The area of result shape is"
 
 puts "========"
 puts "OCC453"
@@ -25,6 +27,8 @@ explode result So
 tcopy result_1 result
 
 dchrono h2 stop
+
+# Check computation time
 set q2 [ dchrono h2 show ]
 regexp {CPU user time: ([-0-9.+eE]+) seconds} $q2 full z2
 puts "$z2"
@@ -34,5 +38,12 @@ if { $z2 > 85 } {
     puts "Elapsed time is less then 85 seconds - OK"      
 }
 
+# Properties check
+checkprops result -s 5.48216e+006
+
+# Tolerance check
+checkmaxtol result -ref 1628.2217761833963
+
+# Visual check
 checkview -display result -2d -path ${imagedir}/${test_image}.png
 
index 2328f35..43d3224 100644 (file)
@@ -14,6 +14,10 @@ pcurve f
 
 project c2d c s
 
+# Length check
+checklength c2d -l 6.2831853071795862
+
+# Visual Check
 v2d
 2dfit
 
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