From 696d81d000c312ab2b26b466430cce873e4fe47e Mon Sep 17 00:00:00 2001 From: akz Date: Thu, 19 Feb 2015 15:14:11 +0300 Subject: [PATCH] 0025823: Self Intersecting wire translated from STEP file The number of points to divide the edge curve on a segments to compute a boundary box does not provide a good tolerance. So a resultant boundary box has an incorrect bounds. As a result the intersection near to a tangent of curve does not detected. Test case for issue CR25823 --- src/ShapeFix/ShapeFix_ComposeShell.cxx | 3 ++- tests/bugs/heal/bug25823 | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 tests/bugs/heal/bug25823 diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index 793157ab82..5ef63dc1ae 100644 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -1287,7 +1287,8 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine (ShapeFix_WireSegment &wire, // get bounding box of pcurve ShapeAnalysis_Curve sac; Bnd_Box2d box; - sac.FillBndBox ( c2d, f, l, 11, Standard_True, box ); + const Standard_Integer aNbPoints = 41; + sac.FillBndBox ( c2d, f, l, aNbPoints, Standard_True, box ); Standard_Real umin, vmin, umax, vmax; box.Get ( umin, vmin, umax, vmax ); diff --git a/tests/bugs/heal/bug25823 b/tests/bugs/heal/bug25823 new file mode 100755 index 0000000000..47e278bcec --- /dev/null +++ b/tests/bugs/heal/bug25823 @@ -0,0 +1,23 @@ +puts "================" +puts "OCC25823" +puts "================" +puts "" +####################################################################################### +# Self Intersecting wire translated from STEP file +####################################################################################### + +set BugNumber OCC25823 + +set aFile [locate_data_file bug25823_280612.stp] +stepread $aFile a * +set aLog [checkshape a_1] + +if {$aLog == "This shape seems to be valid" } { + puts "OK ${BugNumber}" +} else { + puts "Faulty ${BugNumber}" +} + +smallview +fit +set only_screen_axo 1