d07a6c39 |
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 | restore [locate_data_file bug27937_int1.draw] s1 |
17 | restore [locate_data_file bug27937_int2.draw] s2 |
18 | |
19 | intersect result s1 s2 |
20 | |
21 | set che [whatis result] |
22 | set ind [string first "3d curve" $che] |
23 | if {${ind} >= 0} { |
24 | #Only variable "result" exists |
25 | renamevar result result_1 |
26 | } |
27 | |
28 | set ic 1 |
29 | set AllowRepeate 1 |
30 | while { $AllowRepeate != 0 } { |
31 | set che [whatis result_$ic] |
32 | set ind [string first "3d curve" $che] |
33 | if {${ind} < 0} { |
34 | set AllowRepeate 0 |
35 | } else { |
36 | display result_$ic |
37 | |
38 | bounds result_$ic U1 U2 |
39 | |
40 | dump U1 U2 |
41 | |
42 | if {[dval U2-U1] < 1.0e-9} { |
43 | puts "Error: Wrong curve's range!" |
44 | } |
45 | |
46 | xdistcs result_$ic s1 U1 U2 10 3.0e-5 |
47 | xdistcs result_$ic s2 U1 U2 10 1.0e-5 |
48 | |
49 | for { set ip [expr $ic-1] } { $ip > 0 } { incr ip -1 } { |
50 | mkedge e1 result_$ic |
51 | mkedge e2 result_$ip |
52 | |
53 | set coe [checkoverlapedges e1 e2 5.0e-5] |
54 | |
55 | puts "result_$ic <-> result_$ip: $coe" |
56 | if { [regexp "Edges is not overlaped" $coe] != 1 } { |
57 | puts "Error: result_$ic and result_$ip are overlaped" |
58 | } |
59 | } |
60 | |
61 | incr ic |
62 | } |
63 | } |
64 | |
65 | if {[expr {$ic - 1}] == $GoodNbCurv} { |
66 | puts "OK: Number of curves is good!" |
67 | } else { |
68 | puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!" |
69 | } |
70 | |
71 | smallview |
72 | don result* |
73 | fit |
74 | clear |
75 | don s1 s2 result* |
76 | checkview -screenshot -2d -path ${imagedir}/${test_image}.png |