0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tests / bugs / modalg_6 / bug27937_2
1 puts "================"
2 puts "OCC27937"
3 puts "================"
4 puts ""
5 #######################################################################
6 # 0027937: Intersector loops infinitely while proceeding two simple surfaces
7 #######################################################################
8
9 cpulimit 100
10
11 # Attention!!!
12 # The test on performance meter.
13 # See issue #27937 for detail.
14 set GoodNbCurv 4
15
16 ellipse c1 0 0 0 0 0 1 6.03031367203927 3.11993062568844
17 extsurf s1 c1 0 0 1
18 cylinder s2 0 0 0 1 0 0 0.249128788767645
19
20 intersect result s1 s2
21
22 set che [whatis result]
23 set ind [string first "3d curve" $che]
24 if {${ind} >= 0} {
25   #Only variable "result" exists
26   renamevar result result_1
27 }
28
29 set ic 1
30 set AllowRepeate 1
31 while { $AllowRepeate != 0 } {
32   set che [whatis result_$ic]
33   set ind [string first "3d curve" $che]
34   if {${ind} < 0} {
35     set AllowRepeate 0
36   } else {
37     display result_$ic
38     
39     bounds result_$ic U1 U2
40     
41     dump U1 U2
42     
43     if {[dval U2-U1] < 1.0e-9} {
44       puts "Error: Wrong curve's range!"
45     }
46     
47     xdistcs result_$ic s1 U1 U2 10 4.0e-5
48     xdistcs result_$ic s2 U1 U2 10 1.0e-5
49     
50     for { set ip [expr $ic-1] } { $ip > 0 } { incr ip -1 } {
51       mkedge e1 result_$ic
52       mkedge e2 result_$ip
53
54       set coe [checkoverlapedges e1 e2 5.0e-5]
55
56       puts "result_$ic <-> result_$ip: $coe"
57       if { [regexp "Edges is not overlaped" $coe] != 1 } {
58         puts "Error: result_$ic and result_$ip are overlaped"
59       }
60     }
61      
62     incr ic
63   }
64 }
65
66 if {[expr {$ic - 1}] == $GoodNbCurv} {
67   puts "OK: Number of curves is good!"
68 } else {
69   puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!"
70 }
71
72 smallview
73 don result*
74 fit
75 clear
76 don s1 s2 result*
77 checkview -screenshot -2d -path ${imagedir}/${test_image}.png