]> OCCT Git - occt.git/commitdiff
0027114: [Regression to 6.7] DistShapeShape does not find a solution edge-face
authoraml <aml@opencascade.com>
Fri, 29 Jan 2016 06:11:46 +0000 (09:11 +0300)
committerabv <abv@opencascade.com>
Fri, 5 Feb 2016 08:14:45 +0000 (11:14 +0300)
Extrema Curve / Surface algorithm changed to perform more accurate search.

test case bug25232_8 - improvement, one additional intersection point is detected now.
test case bug23830 - normal behavior, position of extrema is changed.

test case for original issue added.

src/Extrema/Extrema_ExtCS.cxx
src/Extrema/Extrema_GenExtCS.cxx
tests/bugs/fclasses/bug27114 [new file with mode: 0644]
tests/bugs/modalg_5/bug25232_8
tests/bugs/moddata_3/bug23830

index 7b6d81042ac64f9e871683b2a8481ebe1d2c813a..c912150bb067db6a2d7d371b352bcc3d82255478 100644 (file)
@@ -192,7 +192,10 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
 
           }
 
-
+          if (myS->IsUPeriodic())
+            NbU = 13;
+          if (myS->IsVPeriodic())
+            NbV = 13;
 
           Extrema_GenExtCS Ext(C, *myS, NbT, NbU, NbV, cfirst, clast, ufirst, ulast,
             vfirst, vlast, mytolC, mytolS);
@@ -248,7 +251,9 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
         Ext.Perform(C, NbT, tmin, tmax, mytolC); // to avoid overflow
       }
       else {
-        if(myCtype == GeomAbs_Circle && NbT < 13) {
+        if((myCtype == GeomAbs_Circle       && NbT < 13) ||
+           (myCtype == GeomAbs_BSplineCurve && NbT < 13) )
+        {
           NbT = 13;
         }
         Ext.Perform(C, NbT, mytolC);
index 65bdac7f51abc183004e568c80442740d9142d01..dca7a2ac22bd91ffc6d9aad17b91eae50fb20178 100644 (file)
@@ -211,7 +211,7 @@ void Extrema_GenExtCS::Perform (const Adaptor3d_Curve& C,
   TUVsup(3) = trimvsup;
 
   // Number of particles used in PSO algorithm (particle swarm optimization).
-  const Standard_Integer aNbParticles = 32;
+  const Standard_Integer aNbParticles = 48;
 
   math_PSOParticlesPool aParticles(aNbParticles, 3);
 
diff --git a/tests/bugs/fclasses/bug27114 b/tests/bugs/fclasses/bug27114
new file mode 100644 (file)
index 0000000..0e9e166
--- /dev/null
@@ -0,0 +1,26 @@
+puts "========"
+puts "OCC27114"
+puts "========"
+puts ""
+##############################################
+# DistShapeShape gives not all solutions
+# Correct result is 2 solutions
+##############################################
+
+restore [locate_data_file bug27114.brep] aShape
+explode aShape
+set anInfo [distmini d aShape_1 aShape_2]
+
+# Check number of solutions
+if { [llength $anInfo] != 9 } {
+    puts "ERROR: Incorrect number of solutions"
+} else {
+ puts "OK: Two solutions is found"
+}
+
+# Check extrema distance
+set absTol 1.0e-10
+set relTol 0.001
+set aDist_Exp 0.0
+set aDist [dval d_val]
+checkreal "Distance value check" $aDist $aDist_Exp $absTol $relTol
\ No newline at end of file
index 49d0e7f63ae9101bb8257a346a195aa209f1e327..61892b8be45158ac9229c2402476abcc77147ae2 100644 (file)
@@ -27,5 +27,5 @@ mkvolume result fcon3 fp
 checkprops result -s 1706.51 
 checkshape result
 
-checknbshapes result -vertex 4 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 15
+checknbshapes result -vertex 5 -edge 6 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 17
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 39864634f2f506172ae733bdb204e2df15fb4cd0..bf518c9feb4428e069a70233c2c5a4eeddcbb898 100755 (executable)
@@ -18,7 +18,7 @@ foreach i ${Indices} {
   if { [isdraw ext_1] } {
     mkedge e ext_1
     regexp {Mass +: +([-0-9.+eE]+)} [lprops e] full l
-    if {$l > 1e-12} {
+    if {$l > 2.5e-12} {
       puts "Error: invalid result"
     }
     renamevar ext_1 r_$i