0025020: checkoverlapedges doesn't have the check for degenerated edges
authoribs <ibs@opencascade.com>
Thu, 19 Jun 2014 09:29:13 +0000 (13:29 +0400)
committerapn <apn@opencascade.com>
Thu, 19 Jun 2014 09:29:51 +0000 (13:29 +0400)
the check for degenerated edges added
Test case for issue CR25020

src/SWDRAW/SWDRAW_ShapeFix.cxx
tests/bugs/demo/bug25020 [new file with mode: 0755]

index 8dc75e5..de47ca3 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <Draw.hxx>
 #include <DBRep.hxx>
+#include <BRep_Tool.hxx>
 #include <SWDRAW.hxx>
 #include <gp_XYZ.hxx>
 #include <gp_Pnt2d.hxx>
@@ -635,6 +636,19 @@ static Standard_Integer checkoverlapedges(Draw_Interpretor& di, Standard_Integer
      di<<"Invalid type of arguments"<<"\n";
      return 1;
    }
+
+   if (BRep_Tool::Degenerated(e1))
+   {
+     di << a[1] << " is degenerated\n";
+     return 1;
+   }
+
+   if (BRep_Tool::Degenerated(e2))
+   {
+     di << a[2] << " is degenerated\n";
+     return 1;
+   }
+
    Standard_Real aTol = Precision::Confusion();
    Standard_Real aDistDomain = 0.0;
    Standard_Integer k = 3;
diff --git a/tests/bugs/demo/bug25020 b/tests/bugs/demo/bug25020
new file mode 100755 (executable)
index 0000000..e1f51c4
--- /dev/null
@@ -0,0 +1,21 @@
+puts "============"
+puts "CR25020"
+puts "============"
+puts ""
+##########################################################################################################
+# checkoverlapedges doesn't have the check for degenerated edges
+##########################################################################################################
+
+restore [locate_data_file bug25020_b.brep] b
+explode b e
+
+dlog reset
+dlog on
+catch {checkoverlapedges b_1 b_2}
+set info [dlog get]
+
+if { [regexp "degenerated" ${info} ] == 1 } {
+    puts "OK : checkoverlapedges have the check for degenerated edges"
+} else {
+    puts "Error : checkoverlapedges doesn't have the check for degenerated edges"
+}