223b72581c1680a9f5d084599486638157c6015f
[occt.git] / tests / bugs / moddata_2 / bug567_1
1 puts "========"
2 puts "OCC567: Can not intersect two Rectangular Trimmed Surfaces ."
3 puts "========"
4 puts ""
5
6 # Different result between Debian 7 and Debian 8 and between MSVC 2010 and 2017.
7 puts "TODO ?OCC30012 Linux: Error: 10 curves are expected but 9 ones are found."
8 puts "TODO ?OCC30012 Linux: Error: 10 curves are expected but 8 ones are found."
9 puts "TODO ?OCC29910 Windows: Error: 10 curves are expected but 11 ones are found."
10 puts "TODO ?OCC29910 Windows: Error :  is WRONG because number of EDGE entities in shape \"rs\" is 15"
11 puts "TODO ?OCC29910 Linux: Error :  is WRONG because number of EDGE entities in shape \"rs\" is 8"
12 puts "TODO ?OCC29910 Windows: Error: 0 vertices are expected but 2 are found"
13
14 set GoodNbCurves 10
15
16 foreach a [directory res*] {unset $a}
17
18 restore [locate_data_file OCC567a.draw] s1 
19 restore [locate_data_file OCC567b.draw] s2 
20
21 if { [catch {intersect res s1 s2 } catch_result] } {
22     puts "Faulty OCC567: function intersection works wrongly with infinite Surfaces"
23 } else {
24   set che [whatis res]
25   set ind [string first "3d curve" $che]
26   if {${ind} >= 0} {
27     #Only variable "res" exists
28     renamevar res res_1
29   }
30
31   bclearobjects
32   bcleartools
33   
34   set ic 1
35   set AllowRepeat 1
36   while { $AllowRepeat != 0 } {
37     set che [whatis res_$ic]
38     set ind [string first "3d curve" $che]
39     if {${ind} < 0} {
40       set AllowRepeat 0
41     } else {
42      
43       bounds res_$ic U1 U2
44       
45       if {[dval U2-U1] < 1.0e-9} {
46         puts "Error: Wrong curve's range!"
47       }
48       
49       xdistcs res_$ic s1 U1 U2 100 2.0e-7
50       xdistcs res_$ic s2 U1 U2 100 2.0e-7
51       
52       for { set ip [expr $ic-1] } { $ip > 0 } { incr ip -1 } {
53         mkedge e1 res_$ic
54         mkedge e2 res_$ip
55
56         set coe [checkoverlapedges e1 e2 5.0e-5]
57
58         puts "res_$ic <-> res_$ip: $coe"
59         if { [regexp "Edges is not overlaped" $coe] != 1 } {
60           puts "Error: res_$ic and res_$ip are overlaped"
61         }
62       }
63       
64       mkedge ee res_$ic
65       baddobjects ee
66       
67       incr ic
68     }
69   }
70
71   incr ic -1
72   
73   if {$ic != $GoodNbCurves} {
74     puts "Error: $GoodNbCurves curves are expected but $ic ones are found."
75   }
76   
77   if {$ic != 1} {
78     # Check of gaps between intersection curves
79     bfillds
80     bbuild rs
81
82     checknbshapes rs -edge 14
83     checksection rs -r 0
84   }
85 }
86
87 smallview
88 don res_*
89
90 fit
91 don s1 s2
92 disp res_*
93
94 checkview -screenshot -2d -path ${imagedir}/${test_image}.png