From 8444aedb1d6e25c2f1ab6bac24ffb74b3fea0f4a Mon Sep 17 00:00:00 2001 From: nbv Date: Mon, 18 Sep 2017 17:23:44 +0300 Subject: [PATCH] 0028150: Exception is raised during Boolean operation ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve2d - Using the correct number of points (computed in GCPnts_QuasiUniformAbscissa class) for creation of the initial curve. --- .../ProjLib_ComputeApproxOnPolarSurface.cxx | 1 + tests/bugs/modalg_7/bug28150_1 | 24 +++++++++++++++++++ tests/bugs/modalg_7/bug28150_2 | 21 ++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 tests/bugs/modalg_7/bug28150_1 create mode 100644 tests/bugs/modalg_7/bug28150_2 diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 16e1255320..82f567cac8 100644 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -885,6 +885,7 @@ Handle(Adaptor2d_HCurve2d) Standard_Integer NbOfPnts = 61; GCPnts_QuasiUniformAbscissa QUA(Curve->GetCurve(),NbOfPnts); + NbOfPnts = QUA.NbPoints(); TColgp_Array1OfPnt Pts(1,NbOfPnts); TColStd_Array1OfReal Param(1,NbOfPnts); Standard_Integer i, j; diff --git a/tests/bugs/modalg_7/bug28150_1 b/tests/bugs/modalg_7/bug28150_1 new file mode 100644 index 0000000000..bee594973e --- /dev/null +++ b/tests/bugs/modalg_7/bug28150_1 @@ -0,0 +1,24 @@ +puts "========" +puts "OCC28150" +puts "========" +puts "" +##################################################### +# Exception is raised during Boolean operation +##################################################### + +restore [locate_data_file bug28150_shapes.brep] b +explode b +bclearobjects +bcleartools +baddobjects b_1 +baddtools b_2 +bfillds +# Before fix: error +bbop result 0 + +checkshape result + +checknbshapes result -wire 5 -face 2 +checkprops result -s 14.5302 + +checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_7/bug28150_2 b/tests/bugs/modalg_7/bug28150_2 new file mode 100644 index 0000000000..8a44335a97 --- /dev/null +++ b/tests/bugs/modalg_7/bug28150_2 @@ -0,0 +1,21 @@ +puts "========" +puts "OCC28150" +puts "========" +puts "" +##################################################### +# Exception is raised during Boolean operation +##################################################### + +restore [locate_data_file bug28150_ef.brep] b +explode b +mkcurve c b_1 +mksurface s b_2 +project c2d c s + +checklength c2d -l 2.6097941390190726e-006 + +v2d +display c2d +2dfit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png