From cea8d5c1abac76753ba91b290b88165ac6c9e918 Mon Sep 17 00:00:00 2001 From: emv Date: Thu, 4 Apr 2019 09:59:24 +0300 Subject: [PATCH] 0030629: Modeling Algorithms - Invalid result of fuse operation Plane/Torus intersection: take into account the Plane-Torus distance sign to compute the correct location of the section curve. Test case for the issue. --- src/IntAna/IntAna_QuadQuadGeo.cxx | 2 +- tests/bugs/modalg_7/bug30629 | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/bugs/modalg_7/bug30629 diff --git a/src/IntAna/IntAna_QuadQuadGeo.cxx b/src/IntAna/IntAna_QuadQuadGeo.cxx index 79a3ed250f..93e64b5283 100644 --- a/src/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/IntAna/IntAna_QuadQuadGeo.cxx @@ -2077,7 +2077,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& Pln, } // if (Abs(aDR) < aTolNum) { - aDist=aRMin; + aDist = (aDist < 0) ? -aRMin : aRMin; } // typeres = IntAna_Circle; diff --git a/tests/bugs/modalg_7/bug30629 b/tests/bugs/modalg_7/bug30629 new file mode 100644 index 0000000000..5ff601acab --- /dev/null +++ b/tests/bugs/modalg_7/bug30629 @@ -0,0 +1,22 @@ +puts "========" +puts "0030629: Modeling Algorithms - Invalid result of fuse operation" +puts "========" +puts "" + +restore [locate_data_file bug30629.brep] s + +explode s so + +bclearobjects +bcleartools +baddobjects s_1 +baddtools s_2 s_3 s_4 +bfillds + +bbop result 1 + +checkshape result +checknbshapes result -wire 11 -face 11 -shell 3 -solid 3 +checkprops result -s 725537 -v 1.33469e+07 + +checkview -display result -2d -path ${imagedir}/${test_image}.png