From fc0180e5f31a87fd1ca13923672832dcf9780e9b Mon Sep 17 00:00:00 2001 From: aml Date: Thu, 12 Feb 2015 12:04:55 +0300 Subject: [PATCH] 0025810: Exception in extrema operation. Fixed computation of number of analytic intersection points. Test case for issue CR25810 --- src/Extrema/Extrema_ExtElCS.cxx | 6 +++--- tests/bugs/moddata_3/bug25810 | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 tests/bugs/moddata_3/bug25810 diff --git a/src/Extrema/Extrema_ExtElCS.cxx b/src/Extrema/Extrema_ExtElCS.cxx index 6eaac112b8..96384d0cb3 100644 --- a/src/Extrema/Extrema_ExtElCS.cxx +++ b/src/Extrema/Extrema_ExtElCS.cxx @@ -361,9 +361,9 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C, // Check whether two objects have intersection points IntAna_Quadric aCylQuad(S); IntAna_IntConicQuad aCircCylInter(C, aCylQuad); - Standard_Integer aNbInter = aCircCylInter.NbPoints(); - if (!aCircCylInter.IsDone()) - aNbInter = 0; + Standard_Integer aNbInter = 0; + if (aCircCylInter.IsDone()) + aNbInter = aCircCylInter.NbPoints(); // Compute the extremas. myNbExt = 2*aNbExt + aNbInter; diff --git a/tests/bugs/moddata_3/bug25810 b/tests/bugs/moddata_3/bug25810 new file mode 100644 index 0000000000..55ffa8081e --- /dev/null +++ b/tests/bugs/moddata_3/bug25810 @@ -0,0 +1,15 @@ +puts "============" +puts "OCC25810" +puts "============" +puts "" +####################################################################### +# Exception in extrema operation. +####################################################################### + +restore [locate_data_file bug25810_e1.brep] b1 +restore [locate_data_file bug25810_f1.brep] b2 + +mkcurve c1 b1 +mksurface s2 b2 + +extrema c1 s2