]> OCCT Git - occt-copy.git/commitdiff
0023177: Intersection of plane and torus misses a result and never produces analytica...
authornbv <nbv@opencascade.com>
Mon, 29 May 2017 14:35:06 +0000 (17:35 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 1 Jun 2017 10:55:20 +0000 (13:55 +0300)
Creation of the test case.

tests/bugs/modalg_6/bug23177_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug23177_2 [new file with mode: 0644]

diff --git a/tests/bugs/modalg_6/bug23177_1 b/tests/bugs/modalg_6/bug23177_1
new file mode 100644 (file)
index 0000000..17efcb1
--- /dev/null
@@ -0,0 +1,58 @@
+puts "========"
+puts "OCC23177"
+puts "========"
+puts ""
+####################################################################
+# Intersection of plane and torus misses a result and never produces analytical result
+####################################################################
+
+set GoodNbCurv 2
+
+torus s1 100 10
+plane s2 0 0 0 0 1 0
+intersect res s1 s2
+
+set che [whatis res]
+set ind [string first "3d curve" $che]
+if {${ind} >= 0} {
+  #Only variable "res" exists
+  renamevar res res_1
+}
+
+set ic 1
+set AllowRepeate 1
+while { $AllowRepeate != 0 } {
+  set che [whatis res_$ic]
+  set ind [string first "3d curve" $che]
+  if {${ind} < 0} {
+    set AllowRepeate 0
+    break;
+  } else {
+    if { ![regexp "Circle" [dump res_$ic]] } {
+      puts "Error: Intersection result must be circle"
+    }
+    
+    bounds res_$ic U1 U2
+    
+    checkreal CurveBoundaries [dval U2-U1] [dval 2*pi] 1.0e-10 0.0
+    
+    xdistcs res_$ic s1 U1 U2 10 1.0e-7
+    xdistcs res_$ic s2 U1 U2 10 1.0e-7
+    incr ic    
+  }  
+}
+
+if {[expr {$ic - 1}] == $GoodNbCurv} {
+  puts "OK: Number of curves is good!"
+} else {
+  puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!"
+}
+  
+  
+smallview
+don res_*
+fit
+don s1 s2
+disp res_*
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
diff --git a/tests/bugs/modalg_6/bug23177_2 b/tests/bugs/modalg_6/bug23177_2
new file mode 100644 (file)
index 0000000..12f1991
--- /dev/null
@@ -0,0 +1,58 @@
+puts "========"
+puts "OCC23177"
+puts "========"
+puts ""
+####################################################################
+# Intersection of plane and torus misses a result and never produces analytical result
+####################################################################
+
+set GoodNbCurv 2
+
+torus s1 100 10
+plane s2  0 0 0 1 0 0
+intersect res s1 s2
+
+set che [whatis res]
+set ind [string first "3d curve" $che]
+if {${ind} >= 0} {
+  #Only variable "res" exists
+  renamevar res res_1
+}
+
+set ic 1
+set AllowRepeate 1
+while { $AllowRepeate != 0 } {
+  set che [whatis res_$ic]
+  set ind [string first "3d curve" $che]
+  if {${ind} < 0} {
+    set AllowRepeate 0
+    break;
+  } else {
+    if { ![regexp "Circle" [dump res_$ic]] } {
+      puts "Error: Intersection result must be circle"
+    }
+    
+    bounds res_$ic U1 U2
+    
+    checkreal CurveBoundaries [dval U2-U1] [dval 2*pi] 1.0e-10 0.0
+    
+    xdistcs res_$ic s1 U1 U2 10 1.0e-7
+    xdistcs res_$ic s2 U1 U2 10 1.0e-7
+    incr ic    
+  }  
+}
+
+if {[expr {$ic - 1}] == $GoodNbCurv} {
+  puts "OK: Number of curves is good!"
+} else {
+  puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!"
+}
+  
+  
+smallview
+don res_*
+fit
+don s1 s2
+disp res_*
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file