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